Callback Profiles in Voice APIs
This document provides the details of how to use Callback Profiles in Outbound Calling API and Click to Call API.
Callback Profiles
Callback Profiles are used to trigger the configured endpoints and receive callback data for the configured callback event. Callback Profiles can be created in two HTTP methods, GET and POST.
For information about how to create a Callback Profile refer to Callback Profiles.
Callback Profile in Outbound Calling API
You can use Callback Profiles in Outbound Calling API.
Note:
- A maximum of 10 callback profile IDs and URLs are allowed in Outbound Calling API.
- You can configure one or more callback events among the following events call_start, call_answer, and call_end.
- The keys in the JSON are case insensitive.
- Add a new parameter as “callback” in the Outbound Calling API.
- Fill in with the valid callback profile ID and URL before triggering the call.
Outbound Calling has these three events using which the callback can be triggered:
Event | Description | Format | Example |
---|---|---|---|
Call_start | This event is triggered when the call is initiated. | {"call_start":{"callback_profile":[],"url":[]}} | { "call_start": { "callback_profile": [ "SG_cXX9-bXX4-4XX9-aXXf-27XX9" ], "url": [ "https://webhook.site/2cXX9-6XX0-4XX7-bXX9-aeXX31?caller={{caller}}" ] } } |
Call_answer | This event is triggered when the call is answered. | {"call_answer":{"callback_profile":[],"url":[]}} | { "call_answer": { "callback_profile": [ "SG_96XX3-2XXb-4XX2-9XX3-feXXe" ], "url": [ "https://webhook.site/2cXX9-6XX0-4XX7-bXX9-aeXX31?caller={{caller}}" ] } } |
Call_end | This event is triggered when the call is disconnected. | {call_end":{"callback_profile":[],"url":[]}} | { "call_end": { "callback_profile": [ "SG_f8XX40-fXX8-4XXf-aXX3-c9XXb" ], "url": [ "https://webhook.site/2cXX9-6XX0-4XX7-bXX9-aeXX1?caller={{caller}}", "https://webhook.site/2cXX89-6XX0-4XX7-bXX9-aeXX1?callee={callee}" ] } } |
Callback Profile in Click to Call API
You can use Callback Profiles in the Click to Call API.
Note:
- A maximum of 10 callback profile IDs and URLs can be given in C2C API.
- The keys in the JSON are case insensitive.
- One or more callback events can be configured among the following: To_call_start, From_call_start, To_call_answer, From_call_asnwer, and call_end.
- Add a new parameter as “callback” in the Click to Call API.
- Fill in with the valid callback profile ID and URL before triggering the call. Click to Call API has three different events for both channel 1 and channel 2 using which callback can be triggered.
Event | Description | Format | Example |
---|---|---|---|
from_call_start | This event is triggered when the call is initiated to channel 1. | {"from_call_start":{"callback_profile":[],"url":[]}} | { "from_call_start": { "callback_profile": [ "SG_xxxx" ], "url": [ "https://webhook.site/2c2xxxx?caller={{caller}}" ] } } |
to_call_start | This event is triggered when the call is initiated to channel 2. | {"to_call_start":{"callback_profile":[],"url":[]}} | { "to_call_start": { "callback_profile": [ "SG_SG_xxxxxxx" ], "url": [ "https://webhook.site//2c2xxxxxxxxxxx?caller={{caller}}" ] } } |
from_call_answer | This event is triggered when the call is answered by channel 1. | {"from_call_answer":{"callback_profile":[],"url":[]}} | { "from_call_answer": { "callback_profile": [ "SG_SG_xxxx" ], "url": [ "https://webhook.site//2c2xxxxxxxxxxx?caller={{caller}}" ] } } |
to_call_answer | This event is triggered when the call is answered by channel 2 | {"to_call_answer":{"callback_profile":[],"url":[]}} | { "to_call_answer": { "callback_profile": [ "SG_SG_xxxxxxxx" ], "url": [ "https://webhook.site//2c2xxxxxxxxx?caller={{caller}}" ] } } |
call_end | This event is triggered when the call is disconnected in either Channel 1 or 2. | {"call_end":{"callback_profile":[],"url":[]}} | { "call_end": { "callback_profile": [ "SG_SG_xxxxxxx" ], "url": [ "https://webhook.site//2c2xxxxxxxx?caller={{caller}}" ] } } |
Updated about 1 year ago