In this section, you will be acquainted with making an Outgoing 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"
}
Info
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. In order to get an audio ID, simply follow this guide.
{
"status": "Request has been sent.",
"callId": "1c9ebf6a-dd62-4c49-b0b3-c1b1494e01f1"
}
- Once an API attempt is accepted, an API response will be returned, and the call status will be set as "Queued".
How do I know if the call has taken place?
Each call status can be tracked via a Webhook