The Zentrunk REST API provides details of completed calls.
BaseURI
https://zt.plivo.com/v1/Account/{auth_id}/Call/
A Zentrunk object is created when an outbound call is initiated or when an inbound call is received. You can use the Call object to retrieve details about completed calls.
call_uuid string |
The unique identifier used to identify the call. |
duration string |
The duration of the call in seconds. This might be different from the bill_duration based on the billing interval of the prefix called. |
from_number string |
The number from which the calls were made. |
to_number string |
The destination number to which the call was made. |
trunk_id string |
Unique ID of the trunk on which the call was made. |
trunk_domain string |
The unique name of the trunk. |
region string |
The regional server through which the call went. |
bill_duration optional |
The duration for which the call was billed in seconds. This might be different from the duration based on the billing interval of the prefix called. |
end_time optional |
The timestamp when the call ended. |
call_direction string |
Indicates whether the call was outbound or inbound. |
hangup_initiator optional |
The source for the call hangup. Refer to our list of hangup causes and sources. |
hangup_cause optional |
The reason for the call hangup. Refer to our list of hangup causes and sources. Refer to our list of hangup causes and sources. |
rate integer |
The per-minute rate charged based on the destination number. |
initiation_time string |
The timestamp when the call was initiated. |
answer_time string |
The timestamp when the call was answered. |
from_country string |
The call origination country. |
to_counrty string |
The call destination country. |
transport_protocol string |
The protocol used to transport the media. |
srtp boolean |
If connection made was srtp or RTP. |
secure_trunking string |
The rate associated for secure trunking |
secure_trunking_rate string |
If Secure Trunking is enabled: Zentrunk will communicate with your PBX or SBC over TLS for Signaling. If Secure Trunking is disabled: The calls will be over TCP/UDP for Signaling. |
stir_verification optional |
For outbound calls: Gives details about the attestation assigned to the call by Plivo For inbound calls: Gives details about the attestation received on the inbound call to your Plivo phone number. Allowed values:
Read more about STIR/SHAKEN here. |
hangup_code integer |
The integer code for the hangup cause. Refer to our list of hangup causes and sources. |
total_amount integer |
The total amount charged for the call. |
{
"call_uuid": "6c3a8b60-26e0-4842-9387-2350de79f16b",
"bill_duration": 7200,
"trunk_id": "126041xxxx",
"end_time": "2022-05-26 13:32:37",
"from_number": 552135006716,
"to_number": 12604109832,
"call_direction": "outbound",
"duration": 28,
"hangup_cause": "normal_hangup",
"hangup_initiator": "customer",
"rate": 0.318,
"total_amount": 0.318,
"initiation_time": "2022-05-26 13:32:06",
"answer_time": "2022-05-26 13:32:09",
"trunk_domain": "31723558297410168.zt.plivops.com",
"region": "us-east-1",
"from_country": "BR",
"to_country": "US",
"transport_protocol": "udp",
"srtp": false,
"hangup_code": 3010,
"secure_trunking": true,
"secure_trunking_rate": 0,
"stir_verification": "Not Verified"
}
Plivo uses offset-based pagination to list resources.
For instance, if your search request has a result of 100 objects with limit = 10 and offset = 5, then objects with indices 51 through 60 are returned.
limit integer | A limit on the number of results to be returned. limit can range between 1 and 20, and the default is 20. |
offset integer | A pagination cursor to denote the number of objects by which the results should be offset. |
This method lets you retrieve details of all completed calls. The maximum number of results that you can fetch with a single API call is 20.
GET
https://zt.plivo.com/v1/Account/{auth_id}/Call/
initiation_time string |
The timestamp when the call was initiated. Timezone: Local timezone as updated in the Plivo console Format: yyyy-MM-dd HH:mm:ss |
call_direction string |
The direction of the call, if you want to filter results by call direction. Allowed values: </mark>inbound</mark>, outbound. |
from_number string |
The number from which the calls were made, if you want to filter results by source number. You can filter the details by using the exact number or the prefix. |
to_number string |
The destination number to which the calls were made, if you want to filter results by destination. You can filter the details by using the exact number or the prefix. |
trunk_id string |
The ID of a trunk, if you want to retrieve only calls made from a specific trunk. |
bill_duration optional |
Filters calls by billed duration in seconds. The filter can be used in these five forms:
|
end_time optional |
Filters calls by their completion time. The time format expected is YYYY-MM-DD HH:MM[:ss[.uuuuuu]]. The filter can be used in these five forms:
|
limit optional |
Limits the number of results retrieved. The maximum it can be set to is 20. Defaults to 20. |
offset optional |
Denotes the number of value items by which the results should be offset. For example, if the results contains 1,000 values and limit is set to 10 and offset is set to 705, then values 706 through 715 are displayed in the results. This parameter is also used for pagination of the results. |
HTTP Status Code: 200
{
"api_id": "91d15144-e8c1-45fa-8226-061702f297fe",
"meta": {
"limit": 20,
"next": true,
"offset": 0,
"previous": false,
"total_count": 4
},
"objects": [
{
"call_uuid": "6c3a8b60-26e0-4842-9387-2350de79f16b",
"bill_duration": 7200,
"trunk_id": "126041xxxx",
"end_time": "2022-05-26 13:32:37",
"from_number": 552135006716,
"to_number": 12604109832,
"call_direction": "outbound",
"duration": 28,
"hangup_cause": "normal_hangup",
"hangup_initiator": "customer",
"rate": 0.318,
"total_amount": 0.318,
"initiation_time": "2022-05-26 13:32:06",
"answer_time": "2022-05-26 13:32:09",
"trunk_domain": "31723558297410168.zt.plivops.com",
"region": "us-east-1",
"from_country": "BR",
"to_country": "US",
"transport_protocol": "udp",
"srtp": false,
"hangup_code": 3010,
"secure_trunking": true,
"secure_trunking_rate": 0,
"stir_verification": "Not Verified"
}
]
}