Call
Required product: Switch or MobileGet a list of calls to or from one or more numbers.
Call properties
Name | Description |
answered_at |
{"answered_at":"2014-10-10T02:48:48+02:00"}The time the call was answered in ISO-8601. |
answered_by |
{"answered_by":{"id":1,"name":"John Smith","number":"4571999999"}}Minimal representation of the employee that first answered the call |
call_uuid |
{"call_uuid":"45981120-324b-0132-d3ef-14dae9edd21d"}Unique ID. |
company_id |
{"company_id":1}Company ID. |
direction |
{"direction":"incoming"} {"direction":"outgoing"}Direction of the call. |
ended_at |
{"ended_at":"2014-10-10T02:48:48+02:00"}The time the call was hungup in ISO-8601. |
endpoint |
{"endpoint":"Employee#1"} {"endpoint":"Reception#1"}The employee or reception the call was made to. |
endpoint_type |
{"endpoint_type":"employee"} {"endpoint_type":"reception"}Whether the call was to an employee or a reception |
from_number |
{"from_number":"4571999999"}Phone number of the caller. |
from_contact | Contact representing the caller. |
ringing_at |
{"ringing_at":"2014-10-10T02:48:48+02:00"}The time the call started ringing in ISO-8601. |
smiley | If a smiley for this calls exists, it is included here. See the Smiley reference for more info. |
started_at |
{"started_at":"2014-10-10T02:48:48+02:00"}The time the call was received in ISO-8601. |
status |
{"status":"ringing"} {"status":"orphaned"} {"status":"missed"} {"status":"voicemail"} {"status":"answered"}The current status for ongoing calls or final status for ended calls. See the Call Lifecycle section for more information. |
to_contact | Contact representing the callee. |
to_number |
{"to_number":"4571999999"}Phone number of the callee. |
Get all calls
List all calls to and from all numbers.
Pagination
If you want to fetch all calls you should continue paginating through the API
until you receive a response with 0 calls. For performance reasons the API
might return fewer calls than you specified via limit
even though there
are more calls to return.
URL parameters
Name | Description | Example |
endpoint | Show calls to specified employee or reception. |
Employee#1
Reception#2
|
direction | Show incoming or outgoing calls. |
incoming
outgoing
|
status | Show calls with specified status. |
answered
|
number | Show calls to or from specified number. |
4571999999
|
limit |
Number of calls to show.
default: 30, maximum: 100 |
10
|
started_at_gt_or_eq | Show calls started at or after the specified time as ISO 8601. |
2014-10-10T02:48:48+02:00
|
started_at_lt_or_eq | Show calls started at or before the specified time as ISO 8601. |
2014-10-10T02:48:48+02:00
|
ended_at_gt_or_eq | Show calls ended at or after the specified time as ISO 8601. |
2014-10-10T02:48:48+02:00
|
ended_at_lt_or_eq | Show calls ended at or before the specified time as ISO 8601. |
2014-10-10T02:48:48+02:00
|
Request
GET /api/v2/calls
Response
Status: 200 OK
{ "calls": [ { "call_uuid": "e54f5820-386d-0132-5bc3-14dae9edd21d", "company_id": 1, "endpoint": "Reception#1", "from_number": "4512345678", "to_number": "4571999999", "from_contact": { "id": 1, "number": "4512345678", "name": "Kim Kontakt", "email": "kimkontakt@example.com" }, "to_contact": null, "direction": "incoming", "started_at": "2014-03-21T13:59:04Z", "answered_at": "2014-03-21T13:59:07Z", "answered_by": { "id": 2, "name": "Karsten Kollega", "number": "4587654321" }, "ended_at": "2014-03-21T13:59:59Z", "status": "answered" } ] }
Get a single call by UUID
Get a single call by its UUID.
Request
GET /api/v2/calls/:uuid
Response
Status: 200 OK
{ "call": { "call_uuid": "e54f5820-386d-0132-5bc3-14dae9edd21d", "company_id": 1, "endpoint": "Reception#1", "from_number": "4512345678", "to_number": "4571999999", "from_contact": { "id": 1, "number": "4512345678", "name": "Kim Kontakt", "email": "kimkontakt@example.com" }, "to_contact": null, "direction": "incoming", "started_at": "2014-03-21T13:59:04Z", "answered_at": "2014-03-21T13:59:07Z", "answered_by": { "id": 2, "name": "Karsten Kollega", "number": "4587654321" }, "ended_at": "2014-03-21T13:59:59Z", "status": "answered" } }