Call records
A call record stores information about an incoming or outgoing call.
Fields
- class CallRecord
- agent: integer
The agent assigned to the call.
- broadcast_duration: integer
The time (in seconds) spent playing an audio message. For incoming calls this is the time spent in an IVR. For outgoing calls this either the time spent in an IVR or the duration of the message left on voicemail.
- campaign: integer
The campaign the job belongs to.
- direction: string
The call’s direction.
outgoing = outgoing call
incoming = incoming call
- error: integer
The call’s outcome.
0 = succeeded
1 = bad number
2 = outside business hours
3 = voicemail detected
4 = relay failed
5 = call abandoned
6 = no agent
7 = busy
8 = no answer
9 = congestion
10 = policy violation
- id: integer
The call record’s unique ID.
- job: integer
The call’s job.
- label: integer
The call’s business-specific label.
- local_number: string
Your phone number, in international format.
- number: string
The contact’s phone number, in international format.
- reference: string
Your reference for this job (e.g. customer ID), which must be unique within the campaign.
- talk_duration: integer
The call’s actual conversation time (in seconds).
- team: integer
The call record’s team.
- timestamp: datetime
The call record’s date and time.
- wait_duration: integer
The time (in seconds) spent waiting for an agent.
API
- GET /j/call_records
Retrieves the list of call records.
You must specify a start date and an end date.
Example request:
GET /j/call_records?start=2015-01-06T00:00:00Z&end=2015-01-07T00:00:00Z&team=1 HTTP/1.1 Authorization: Bearer 0a1b2c3d4e5f
Example response:
HTTP/1.1 200 OK Content-Type: application/json [ { "agent": 1, "campaign": 1, "direction": "outgoing", "error": 0, "id": 1, "job": 1, "label": null, "number": "+33612345678", "reference": "123456", "talk_duration": 84, "team": 1, "timestamp": "2015-01-06T10:21:14.243Z", "wait_duration": 0 } ]
- Request Headers:
Authorization – OAuth token to authenticate
- Query Parameters:
agent (integer) – An optional agent ID.
end (datetime) – An end date and time.
recorded (boolean) – If set to true, only return calls with an audio recording.
start (datetime) – A start date and time.
team (integer) – An optional team ID.
- Response JSON Array of Objects:
agent (integer) – The agent assigned to the call.
broadcast_duration (integer) – The time (in seconds) spent playing an audio message. For incoming calls this is the time spent in an IVR. For outgoing calls this either the time spent in an IVR or the duration of the message left on voicemail.
campaign (integer) – The campaign the job belongs to.
direction (string) – The call’s direction.
error (integer) – The call’s outcome.
id (integer) – The call record’s unique ID.
job (integer) – The call’s job.
label (integer) – The call’s business-specific label.
local_number (string) – Your phone number, in international format.
number (string) – The contact’s phone number, in international format.
reference (string) – Your reference for this job (e.g. customer ID), which must be unique within the campaign.
talk_duration (integer) – The call’s actual conversation time (in seconds).
team (integer) – The call record’s team.
timestamp (datetime) – The call record’s date and time.
wait_duration (integer) – The time (in seconds) spent waiting for an agent.
- Status Codes:
200 OK – no error
400 Bad Request – for instance a required field is missing
403 Forbidden – you tried to access a forbidden resource, check you provided a valid OAuth token
- GET /j/call_records/ongoing
Retrieves the list of ongoing calls.
This is intended to be used to get a call’s ID in order to mute or unmute its audio recording. As such, only a limited number of fields are returned in the response.
Example request:
GET /j/call_records/ongoing?agent=1 HTTP/1.1 Authorization: Bearer 0a1b2c3d4e5f
Example response:
HTTP/1.1 200 OK Content-Type: application/json [ { "agent": 1, "id": 1, "team": 1 } ]
- Request Headers:
Authorization – OAuth token to authenticate
- Query Parameters:
agent (integer) – An optional agent ID.
team (integer) – An optional team ID.
- Response JSON Array of Objects:
agent (integer) – The agent assigned to the call.
id (integer) – The call record’s unique ID.
team (integer) – The call record’s team.
- Status Codes:
200 OK – no error
400 Bad Request – for instance a required field is missing
403 Forbidden – you tried to access a forbidden resource, check you provided a valid OAuth token
- POST /j/call_records/:id/recording
Requests that the audio recording for an ongoing call be muted or unmuted.
If the call is not being recorded, no action is performed.
Example request:
POST /j/call_records/14/recording HTTP/1.1 Authorization: Bearer 0a1b2c3d4e5f Content-Type: application/json { "muted": true }
Example response:
HTTP/1.1 200 OK
- Request Headers:
Authorization – OAuth token to authenticate
- Request JSON Object:
muted (boolean) – whether the recording should be muted (true) or unmuted (false)
- Status Codes:
200 OK – no error
403 Forbidden – you tried to access a forbidden resource, check you provided a valid OAuth token
404 Not Found – the specified call was not found, or is not ongoing