The Calls API provides a simple interface to manage calls.

The API allows you to create, read and delete your calls. You can retrieve individual calls, as well as list of all calls.

JSON format

NameTypeRead onlyDescription
idnumbertrueUnique identifier of the call.
user_idnumberfalseUnique identifier of the user who performed the call.
summarystringfalseContent of the note about this call.
recording_urlstringfalseURL pointing to call recording.
outcome_idnumberfalseUnique identifier of Call Outcome assigned to the call. See more at Call Outcomes.
durationnumberfalseDuration of the call in seconds.
phone_numbernumberfalsePhone number of the person with which the call was made.
incomingbooleanfalseIndicator of whether the call was incoming or not.
missedbooleanfalseIndicator of whether the call was missed (not answered) by the user or not.
resource_typestringfalseName of the resource type the call is attached to. If provided, then resource_id also has to be provided. Possible values: lead, contact
resource_idnumberfalseUnique identifier of the resource the call is attached to. If provided, then resource_type also has to be provided.
associated_deal_idsarrayfalseAn array of ids of deals associated to the call.
made_atstringfalseDate and time of when the call was made (started) in UTC (ISO8601 format).
updated_atstringtrueDate and time of the last update in UTC (ISO8601 format).
external_idstringfalseUnique identifier of a call from an external system.

Retrieve All Calls

GET /v2/calls

Returns all calls available to the user, according to the parameters provided. Calls are always sorted by made_at in descending order.

Parameters

NameTypeInRequiredDescription
pagenumberQueryfalsePage number to start from. Page numbering starts at 1, and omitting the page parameter will return the first page. e.g. ?page=2
per_pagenumberQueryfalseNumber of records to return per page. Default limit is 25 and the maximum number that can be returned is 100. e.g. ?per_page=20
idsnumberQueryfalseComma-separated list of call IDs to be returned in request. e.g. ?ids=1,2,3
resource_typenumberQueryfalseName of the type of resource calls are attached to. Possible valies: lead, contact. e.g. ?resource_type=lead
resource_idnumberQueryfalseUnique identifier of the resource calls are attached to. e.g. ?associated_deal_id=12

Allowed for

  • Agents

Using curl

curl -v -X GET https://api.getbase.com/v2/calls \-H "Accept: application/json" \-H "Authorization: Bearer $ACCESS_TOKEN"

Example Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8Content-Language: en
{  "items": [    {      "data": {        "id": 1,        "user_id": 1,        "summary": "Schedule another call.",        "recording_url": "https://{subdomain}.zendesk.com/sales/apis/voice/api/v1/recordings/15934235/recording.mp3",        "outcome_id": 8,        "duration": 115,        "phone_number": "+44-208-1234567",        "incoming": true,        "missed": false,        "resource_type": "contact",        "resource_id": 7,        "associated_deal_ids": [          12        ],        "made_at": "2016-10-02T11:08:56Z",        "updated_at": "2016-10-03T16:32:56Z",        "external_id": "a897658e-5e44-4477-9102-d576a2601284"      },      "meta": {        "type": "call"      }    }  ],  "meta": {    "type": "collection",    "count": 1,    "links": {      "self": "http://api.getbase.com/v2/calls.json"    }  }}

Create a Call

POST /v2/calls

Creates a new call.

Parameters

NameTypeRequiredDescription
user_idnumberfalseUnique identifier of the user who performed the call.
summarystringfalseContent of the note about this call.
recording_urlstringfalseURL pointing to call recording.
outcome_idnumberfalseUnique identifier of Call Outcome assigned to the call. See more at Call Outcomes.
durationnumberfalseDuration of the call in seconds.
phone_numbernumbertruePhone number of the person with which the call was made.
incomingbooleanfalseIndicator of whether the call was incoming or not.
missedbooleanfalseIndicator of whether the call was missed (not answered) by the user or not.
resource_typestringfalseName of the resource type the call is attached to. If provided, then resource_id also has to be provided. Possible values: lead, contact
resource_idnumberfalseUnique identifier of the resource the call is attached to. If provided, then resource_type also has to be provided.
associated_deal_idsarrayfalseAn array of ids of deals associated to the call.
made_atstringfalseDate and time of when the call was made (started) in UTC (ISO8601 format).
updated_atstringfalseDate and time of the last update in UTC (ISO8601 format).
external_idstringfalseUnique identifier of a call from an external system. Defaults to null

Allowed for

  • Agents

Using cURL

curl -v -X POST https://api.getbase.com/v2/calls \-H "Accept: application/json" \-H "Content-Type: application/json" \-H "Authorization: Bearer $ACCESS_TOKEN" \-d '{  "data": {    "user_id": 1,    "summary": "Schedule another call.",    "recording_url": "https://{subdomain}.zendesk.com/sales/apis/voice/api/v1/recordings/15934235/recording.mp3",    "outcome_id": 8,    "duration": 115,    "phone_number": "+44-208-1234567",    "incoming": true,    "missed": false,    "resource_type": "contact",    "resource_id": 7,    "associated_deal_ids": [      12    ],    "made_at": "2016-10-02T11:08:56Z",    "external_id": "a897658e-5e44-4477-9102-d576a2601284"  }}'

Example Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8Content-Language: en
{  "data": {    "id": 1,    "user_id": 1,    "summary": "Schedule another call.",    "recording_url": "https://{subdomain}.zendesk.com/sales/apis/voice/api/v1/recordings/15934235/recording.mp3",    "outcome_id": 8,    "duration": 115,    "phone_number": "+44-208-1234567",    "incoming": true,    "missed": false,    "resource_type": "contact",    "resource_id": 7,    "associated_deal_ids": [      12    ],    "made_at": "2016-10-02T11:08:56Z",    "updated_at": "2016-10-03T16:32:56Z",    "external_id": "a897658e-5e44-4477-9102-d576a2601284"  },  "meta": {    "type": "call"  }}

Retrieve a Single Call

GET /v2/calls/:id

Returns a single call available to the user, according to the unique call ID provided. If the specified call does not exist, this query returns an error.

Parameters

NameTypeInRequiredDescription
idnumberQuerytrueUnique identifier of the call.

Allowed for

  • Agents

Using cURL

curl -v -X GET https://api.getbase.com/v2/calls/1 \-H "Accept: application/json" \-H "Authorization: Bearer $ACCESS_TOKEN"

Example Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8Content-Language: en
{  "data": {    "id": 1,    "user_id": 1,    "summary": "Schedule another call.",    "recording_url": "https://{subdomain}.zendesk.com/sales/apis/voice/api/v1/recordings/15934235/recording.mp3",    "outcome_id": 8,    "duration": 115,    "phone_number": "+44-208-1234567",    "incoming": true,    "missed": false,    "resource_type": "contact",    "resource_id": 7,    "associated_deal_ids": [      12    ],    "made_at": "2016-10-02T11:08:56Z",    "updated_at": "2016-10-03T16:32:56Z",    "external_id": "a897658e-5e44-4477-9102-d576a2601284"  },  "meta": {    "type": "call"  }}

Update a Call

PUT /v2/calls/:id

Updates an existing call. For calls created using Sell Voice, you can only update the following properties:

  • summary
  • outcome_id
  • duration
  • phone_number
  • incoming
  • missed
  • made_at
  • external_id

Parameters

NameTypeMandatoryDescription
resource_typestringfalseName of the resource type attached to the call. If provided, resource_id is required. Possible values are "lead" and "contact"
resource_idnumberfalseUnique identifier of the resource attached to the call. If provided, resource_type is required
recording_urlstringfalseURL for the call recording
summarystringfalseNotes associated with the call
outcome_idnumberfalseUnique identifier for the call's outcome. See Call Outcomes
durationnumberfalseDuration of the call in seconds
phone_numbernumberfalsePhone number for the call
incomingbooleanfalseIndicates whether the call was incoming or not
missedbooleanfalseIndicates whether the call was answered by the contact or lead
made_atstringfalseTimestamp when the call started
external_idstringfalseUnique identifier of the call in an external system

Allowed for

  • Agents

Using curl

curl -v -X PUT https://api.getbase.com/v2/calls/1 \-H Accept: application/json \-H Content-Type: application/json \-H Authorization: Bearer $ACCESS_TOKEN \-d '{  "data": {    "resource_type": "contact",    "resource_id": 12345,    "summary": "Schedule another call.",    "outcome_id": 8,    "duration": 115,    "phone_number": "+44-208-1234567",    "incoming": true,    "missed": false,    "made_at": "2016-10-02T11:08:56Z",    "external_id": "a897658e-5e44-4477-9102-d576a2601284"  }}'

Example Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8Content-Language: en
{  "data": {    "id": 1,    "user_id": 1,    "summary": "Schedule another call.",    "recording_url": "https://{subdomain}.zendesk.com/sales/apis/voice/api/v1/recordings/15934235/recording.mp3",    "outcome_id": 8,    "duration": 115,    "phone_number": "+44-208-1234567",    "incoming": true,    "missed": false,    "resource_type": "contact",    "resource_id": 12345,    "associated_deal_ids": [      12    ],    "made_at": "2016-10-02T11:08:56Z",    "updated_at": "2016-10-03T16:32:56Z"  },  "meta": {    "type": "call"  }}

Delete a Call

DELETE /v2/calls/:id

Delete an existing call. If the specified call does not exist, this query returns an error. This operation cannot be undone.

Parameters

NameTypeInRequiredDescription
idnumberQuerytrueUnique identifier of the call.

Allowed for

  • Agents

Using curl

curl -v -X DELETE https://api.getbase.com/v2/calls/1 \-H "Authorization: Bearer $ACCESS_TOKEN"

Example Response

HTTP/1.1 204 No Content

Retrieve a Call Recording

GET /v2/calls/:id/recording.mp3

Returns a call recording based on the call id.

Parameters

NameTypeInRequiredDescription
idnumberQuerytrueUnique identifier of the call

Allowed for

  • Agents

Using curl

curl -v -X GET https://api.getbase.com/v2/calls/140173744/recording.mp3 \-H "Authorization: Bearer ACCESS_TOKEN" \-o "myrecording.mp3"

Example Response

HTTP/2 200content-type: audio/mpeg