Send Single Voice Message playFile (Audio File)

This endpoint is used to send Voice Messages individually (1 request per Voice Message).

It is ideal for sending single personalised messages for use cases like notifications or OTP messages.
CLID whitelisting is mandatory for source; please reach out to your account manager or email [email protected]

curl --request POST \
     --url https://voice.wavecell.com/api/v1/subaccounts/subAccountId1/callflows \
     --header 'accept: application/json' \
     --header 'authorization: Bearer axxxxxxxxxxxefg' \
     --header 'content-type: application/json' \
     --data '
{
  "validUntil": "2024-07-15T08:25:16.225Z",
  "callflow": [
    {
      "action": "makeCall",
      "params": {
        "source": "6512345678",
        "destination": "6590000000"
      }
    },
    {
      "action": "playFile",
      "params": {
        "fileUrl": "https://www.example.com/hello.mp3",
        "repetition": 
      }
    },
    {
      "action": "hangup"
    }
  ]
}
'

subAccountId - (string required)
You must replace {subAccountId} with the subaccountid that you want to use. By default this is generated once you have completed the voice onboarding.

BODY PARAMS

  • To send a single Voice Message using the 8x8 Voice Message API you need to POST a JSON object to the url defined above.
  • Additionally it is required to set either a language code or a voice profile in the request, to guarantee the correct pronunciation of the voice message.
  • The JSON object takes the following properties:

validUntil date-time (Optional)
date time. format: YYYY-MM-DDTHH:MM:SS.SSSZ
Example: 2024-07-03T05:59:32.226Z

action: makeCall(string-required)
makeCall enables you to create an outbound voice call to a specified destination with the caller id
specified as source. Once the call is answered by the receiving party, the rest of the callflow actions
will be executed in sequence.

PARAMS OBJECT

source (string - required)
Originator phone number. For CLIDs that have been whitelisted and CLID overwrite is enabled for the subaccount, please set the CLID as "6588000000".
Example: [+] [country code] [88000000]

destination (string -required)
Destination phone number in E.164 international format.
Example: +6590000000 [+] [country code] [subscriber number including area code]

action: playFile(string-required)
playFile enables you to send an audio recording to an end user.

PARAMS OBJECT
fileUrl(string-required)
url of the audio to be played in the call

  • supported protocols - http, https
  • max file size - 5120 KB
  • supported media formats - mp3, wav

Example: https://www.example.com/hello.mp3

repetition (integer)
The amount of times to repeat the voice message during the call. Accepted values are 1, 2 or 3. Default value is 1 for no repeat.

action: hangup(string-required)
hangup enables you to disconnect the active call and may also be used to indicate the end of the callflow.