Making an Outbound Call that Plays an Audio

In this section, you will be acquainted with making an outbound call that plays audio in your voice app, which could be achieved using Unifonic Voice APIs.

curl --location --request POST 'https://voice.unifonic.com/v1/calls' \
--header 'AppsId: 'XXXXXXXXXXXXX'\
--header 'Content-Type: application/json' \
{
    "recipient": [
        "+966111111111"
    ],
    "type": "audioUrl",
    "callerId": "+966115218998",
    "audioId": "c9544e9b-7f5a-4b04-ba1f-2125c95bc584"
}

📘

This is a sample payload that creates a phone call to the recipient +966111111111 and plays an audio file which is characterized by the audioId.

{
    "status": "Request has been sent.",
    "callId": "1c9ebf6a-dd62-4c49-b0b3-c1b1494e01f1"
}
  • Once an API attempt is accepted, an API response will be returned.
    Each call status can be tracked using GET/Call Status API or via a Webhook. (Insert link)