In this section, you will be acquainted with the APIs which you can rely on to fetch your call status.
Pre-requisite
i. You need to trigger a voice call through Unifonic and receive a callId in return.
ii. Or, you have a referenceId which was sent in the original call request
Invoke the Voice Call Logs API
(Some customers know this as the get/callStatus API)
Get Voice Call Logs | Response | Remarks |
---|---|---|
https://voice.unifonic.com/v1/providers/voice-call-log/{callId} --header 'AppsId: XXXXXXXXXXXXXXX' --header 'Content-Type: application/json' | { "callId": "dc19e770-7060-4038-87f9-4eb44c3d0cb9", "type": "ivr", "retry": null, "callerId": "+966115219111", "recipients": [ "callId":"", "callSid":"", "parentCallSid":"", "accountId":"", "to":"", "timeStamp":"", "receivedAt":"", "recordingUrl":"", "referenceId":"", "status": "busy", "duration": "0" } ] } | Depending on the number of recipients defined in this callId, you may receive more than 1 recipient object. |
https://voice.unifonic.com/v1/providers/voice-call-log/{referenceId} --header 'AppsId: XXXXXXXXXXXXXXX' --header 'Content-Type: application/json' | { "referenceId": "dc19sj2r0-7920-4038-sj23-4eb3ww3d0cb9", "recipients": [ { "callId":"", "callSid":"", "parentCallSid":"", "accountId":"", "to":"", "from":"", "timeStamp":"", "receivedAt":"", "recordingUrl":"", "status": "busy", "duration": "0" } ] } | LIVE since 12th September. Depending on the number of recipient that may have the same referenceId, you may receive more than 1 recipient object. |
With this API, you would be able to retrieve call status retrospectively. In case your webhook has failed, you may be able to make use of this API to sync up their data.
Use other methods to fetch your call status