Calls API

This page contains details on how to trigger calls through an API and check on its statu

Triggering Calls through API

After copying the API key, it is to be used as a header in the request to trigger the call

curl --location 'https://voicehub.dataqueue.ai/api/v1/calls/api-call' \
--header 'x-dq-api-key: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
  "to": "<voip-call-phone-number-destination>",
  "agentId": "<agent-id-to-be-used>"
  "context": {<json-dict-of-context>}
}'

It returns a json object containing details about the call triggered

{
    "id": "<generated-call-id>",
    "status": "<call-status>",
    "type": "voip"
}

Checking status of the call

The following endpoint allows to read through the status of the call triggered

curl --location 'https://voicehub.dataqueue.ai/api/v1/calls/status/<call-id>/' \
--header 'x-dq-api-key: <api-key>'

response returned is similar to that of the trigger call api response

Last updated