Make voice call
Overview
To initiate a call to a phone number or a SIP endpoint, make the POST request to /accounts/{accountSID}/calls.
When a call is initiated, a new instance of the calls resource is created (/accounts/{accountSID}/calls/{callSID}). You can then see the call status, cost and other details by requesting the corresponding resource instance.
For call status control please refer to the article Call progress events
Parameter | Required | Description | Default value |
---|
Request example
The following example demonstrates making a call to a landline phone number.
curl –X POST https://api.apifonica.com/v2/accounts/{accountSID}/messages \
-H 'Content-Type: application/json' \
-d '{
"from": "35315313424",
"to": "447860041755",
"text": "Apifonica API provides a really cool SMS messaging service"
}' \
-u {accountSID}:{authToken}
The following example demonstrates making a call to Viber.
curl –X POST https://api.apifonica.com/v2/accounts/{accountSID}/calls \
-H 'Content-Type: application/json' \
-d '{
"from": "35315313424",
"to": "447860041755",
"call_app_sid": "app1f255680-95dd-34c6-b83f-c86b8095adcb",
"channel": "viber"
}' \
-u {accountSID}:{authToken}
Response example
{
"status_code": 201,
"status_message": "CREATED",
"uri": "/accounts/{accountSID}/calls/{callSID}"
}