playFile
enables you to send an audio recording to an end user.
The requests for all actions are the same as v1.1 except the removal of clientRequestId
Path for the new API
/POST /api/v1/subaccounts/{{sub-account-id}}/callflows
- v1.2
PlayFile file URL
url of the audio to be played in the call
- supported protocols - http, https
- max file size - 5120 KB
- supported media formats - mp3, wav
Sample of a playFile
request
playFile
request{
"callflow": [
{
"action": "playFile",
"params": {
"source": "+6568332000",
"destination": "+6591234567",
"fileUrl": "https://sample-videos.com/audio/mp3/wave.mp3",
"repetition": 2
}
}
]
}
Response
Success
{
"sessionId": "d9874358-89ac-4c50-bbab-1eb634482a94",
"sessionStatus": "CREATED",
"callFlowRequestId": "89b545a5-0676-11ee-8100-d500c0d203fc",
"statusCode": 1,
"statusMessage": "Created"
}
Failure
{
"sessionStatus": "NOT_CREATED",
"callFlowRequestId": "0564e804-0a7e-11ee-9c83-6df9c048a122",
"statusCode": -1007,
"statusMessage": "$.callflow[talk].action should be one of: [say,playFile,sayAndCapture]
Explaining Session Status
Session status indicates if a call is successfully accepted & created or not created on the 8x8 platform. 8x8 returns two status:
CREATED
- call is successfully created on the platform.NOT CREATED
- call is not successfully created on the platform and 8x8 returnsstatusCode
andstatusMessage
to understand why the call was not accepted on the platform
Status Code and Status Message
Status Code | Message |
---|---|
1 | Created |
-1001 | Invalid JSON request body |
-1002 | Speech profile or language parameter invalid |
-1003 | Valid maxDigits required when minDigits provided |
-1005 | Valid overallTimeout is required when digitTimeout provided |
-1007 | $.callflow[0].action should be one of: [Call action names] Eg: $.callflow[0].action should be one of: say,playFile,sayAndCapture |
-1008 | Valid maxDigits is required when completeOnHash is false |
-1009 | Invalid call flow entry provided. [Additional error details here]. Eg: Invalid call flow entry provided. $.callflow[0].params.text: is missing but it is required |
-9999 | An unknown error has occurred. |