Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

You can test API methods on the interactive API browser page and without writing code
Some of the resources described on the page may not be available by default due to the type of application (see Creating and authorizing applications).

This resource allows you to get the client call data for a certain period of time or for a an unique call identifier. It is a combination of the resources "Calls (/calls/)" and “Call Data Record (/cdr/)”:

Image RemovedImage Added
Table of Contents

Description of Data Structures 

Expand
titleResource call_history

Resource call_history 

Tabs
[{"content":{"

Name 

Type 

Mandatory 

Description 

bridged_domain 

string 

no 

User domain of the subscriber whom the connection has been established with 

bridged_duration 

int 

no 

Duration of connection of two subscribers. May be null if connection with the second subscriber has not been established 

bridged_time_gmt 

string 

no 

UTC time when two subscribers were connected. May be null if no connection with the second subscriber has been established 

bridged_username 

string 

no 

Number of the subscriber whom the connection has been established with 

call_uuid 

string 

no 

Unique call identifier 

cdr 

Array[cdr_response] 

no 

Call Part Description: The cdr_response resource fields are described below 

client_owner_id 

int 

no 

Identifier of the client whom the call belongs to 

did_domain 

string 

no 

External number domain (DID – Direct Inward Dialing), which the call entered to 

did_number 

string 

no 

External number (DID – Direct Inward Dialing), which the call entered to 

duration 

int 

no 

Call duration 

ext_number_reg 

string 

no 

The external number of the extension number, which the call belongs to, if the extension number has an external number registration. Otherwise, the field has the value null 

extension_group_owner_id 

int 

no 

Group identifier of the extension number, which the call belongs to. May be null if the extension number was not a member of any group at the time of the call 

extension_id 

int 

no 

Identifier of the extension number, which the call belongs to. 

extension_name 

string 

no 

Name of the extension number, which the call belongs to. 

extension_type 

string 

no 

Type of the extension number, which the call belongs to. 

flow 

string 

no 

Call direction. May take the value in or out 

from_domain 

string 

no 

Caller domain 

from_screen_name 

string 

no 

Caller name 

from_username 

string 

no 

Caller number 

hangup_cause 

string 

no 

Reason of the call end (field may be ignored, it is used for backward compatibility) 

hangup_disposition  

string 

no 

Used to determine the disconnection initiator: 

  • callee_bye – the callee hung up; 

  • caller_bye – the caller hung up;

  • caller_cancel – the caller refused to wait for an answer; 

  • callee_refuse – the callee refused to answer (was busy, there was no registration, etc.); 

  • internal_cancel – the call was terminated by the server (usually due to call timeout or if the call was answered by another extension number); 

  • '' (empty) – failed to determine 

hangup_time_gmt 

string 

no 

Call end UTC time 

init_time_gmt 

string 

no 

Call start UTC time 

result 

string 

no 

Call result. Because the resource call_history consists of /calls/ and /cdr/, then you need to distinguish between the corresponding result values of these resources (see the figure at the very beginning of the article). 
For example, /calls/ (whole call) cannot have "result: answered elsewhere", and /cdr/ (call parts) cannot have "result: bridged"

start_time_gmt 

string 

no 

UTC time when the call was answered. May be null if the call was not answered 

to_domain 

string 

no 

Callee domain 

to_username 

string 

no 

Callee number 

Example 

Let's get the call history for March and April of 2020: 

call_month

string

no

Indication of the month of the call. In the format “yyyy-mm” (example: “2022-05”) . If specified, the response to the request will come faster.

callback

object

no

Contains information if a callback was made.

dst_num - The destination number of the call

src_num - The calling subscriber's number

src_id - id of the extension src_num

Example 

Let's get the call history for March and April of 2020: 

Tabs
[{"content":{"version":1,"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"In the "},{"type":"text","text":"authentication ","marks":[{"type":"strong"}]},{"type":"text","text":"section enter the "},{"type":"text","text":"Application_ID","marks":[{"type":"strong"}]},{"type":"text","text":" and "},{"type":"text","text":"Application_Secret","marks":[{"type":"strong"}]},{"type":"text","text":" values obtained during the application registration in the "},{"type":"text","text":"client_id ","marks":[{"type":"strong"}]},{"type":"text","text":"and "},{"type":"text","text":"client_secret","marks":[{"type":"strong"}]},{"type":"text","text":" fields, then click on the \""},{"type":"text","text":"Try it out!","marks":[{"type":"strong"}]},{"type":"text","text":"\" button. If the application data is correct, an access token ("},{"type":"text","text":"access_token","marks":[{"type":"strong"}]},{"type":"text","text":") will be returned in response. The received access token should be entered into the \""},{"type":"text","text":"Access Token Field","marks":[{"type":"strong"}]},{"type":"text","text":"\" at the top of the page and saved by clicking the \""},{"type":"text","text":"Set Token","marks":[{"type":"strong"}]},{"type":"text","text":"\" button."}]},{"type":"table","attrs":{"isNumberColumnEnabled":false,"layout":"default"},"content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Method","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Resourse","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Data","marks":[{"type":"strong"}]}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"GET"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"/client/@me/call_history/?start_datetime=2020-03-01%2000%3A00%3A00&order=desc&end_datetime=2020-04-30%2000%3A00%3A00&per_page=100000&page=1"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"hardBreak"}]},{"type":"paragraph","content":[{"type":"text","text":" "}]}]}]}]},{"type":"paragraph","content":[]}]},"id":"d83c92de-6159-46d0-a311-96fe6d133ba5","label":"Interactive API Browser","type":"tab"},{"content":{"version":1,"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"To send requests using the cURL program, set the values of the "},{"type":"text","text":"url ","marks":[{"type":"strong"}]},{"type":"text","text":"and "},{"type":"text","text":"access_token","marks":[{"type":"strong"}]},{"type":"text","text":" variables:"}]},{"type":"paragraph","content":[{"type":"text","text":"export url=\"https://<hostname>/api/ver1.0\"","marks":[{"type":"code"}]},{"type":"text","text":" "},{"type":"hardBreak"},{"type":"text","text":"(where the hostname — is the hostname of the API-server provider of IP-telephony),"}]},{"type":"paragraph","content":[{"type":"text","text":"export access_token=\"8SNsrS0jV35vfmKqKeKtRrHfpbg4UX\"","marks":[{"type":"code"}]},{"type":"text","text":" "},{"type":"hardBreak"},{"type":"text","text":"(the received access token)."}]},{"type":"paragraph","content":[{"type":"text","text":"Send a request:"}]},{"type":"codeBlock","attrs":{"language":"shell"},"content":[{"type":"text","text":"curl \\\n-H \"Authorization: Bearer ${access_token}\" \\\n-X GET \"${url}/client/@me/call_history/?start_datetime=2020-03-01%2000:00:00&end_datetime=2020-04-30%2000:00:00&order=desc&per_page=100000&page=1\""}]},{"type":"paragraph","content":[&per_page=100000&page=1\""}]},{"type":"paragraph","content":[]}]},"id":"b8658cd4-90b1-43cd-af09-acd3bc21e11e","label":"cURL Program","type":"tab"},{"content":{"version":1,"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"To send requests in Python, set the values of the variables URL and ACCESS_TOKEN:"}]},{"type":"paragraph","content":[{"type":"text","text":"URL = \"https://<hostname>/api/ver1.0\"","marks":[{"type":"code"}]},{"type":"hardBreak"},{"type":"text","text":"(where the hostname — is the hostname of the API-server provider of IP-telephony),"}]},{"type":"paragraph","content":[{"type":"text","text":"ACCESS_TOKEN = \"8SNsrS0jV35vfmKqKeKtRrHfpbg4UX\"","marks":[{"type":"code"}]},{"type":"hardBreak"},{"type":"text","text":"(the received access token)."}]},{"type":"codeBlock","attrs":{"language":"python"},"content":[{"type":"text","text":"#!/usr/bin/python\n\nimport requests\n\nurl = f'{URL}/client/@me/call_history/?start_datetime=2020-03-01%2000%3A00%3A00&end_datetime=2020-04-30%2000%3A00%3A00&order=desc&per_page=100000&page=1'\nheaders = {\n    'Authorization': f'Bearer {ACCESS_TOKEN}'\n}\nresponse = requests.get(url, headers=headers)\nprint(response.text)"}]}]},"id":"b8658cd4ec447d2f-90b1bdc3-43cd48e0-af09b5d8-acd3bc21e11e034699c0729c","label":"cURLIn ProgramPython3","type":"tab"}]
Expand
titleSystem response:
Code Block
languagejson
{ 
  "page": 1,
  "per_page": 100000,
  "order": "desc",
  "call_history": [
    {
      "flow": "in",
      "init_time_gmt": "2020-03-17 14:46:43",
      "start_time_gmt": "2020-03-17 14:46:43",
      "bridged_time_gmt": null,
      "hangup_time_gmt": "2020-03-17 14:46:48",
      "duration": 5,
      "bridged_duration": 0,
      "extension_id": 372802,
      "extension_name": "0005*101@sip.ringme.ru",
      "extension_type": "phone",
      "extension_group_owner_id": null,
      "client_owner_id": 32362,
      "result": "answered",
      "from_username": "00010037",
      "from_domain": "sip.ringme.ru",
      "bridged_username": null,
      "bridged_domain": null,
      "did_number": null,
      "did_domain": null,
      "to_username": "0005*101",
      "to_domain": "sip.ringme.ru",
      "from_screen_name": "Ivanov I.I.",
      "hangup_cause": "NORMAL_CLEARING",
      "ext_number_reg": null,
      "call_uuid": "CAE26E8A4A7041D684F7CF5C480D1047",
      "hangup_disposition": "callee_refuse",
      "cdr": [
        {
          "flow": "in",
          "init_time_gmt": "2020-03-17 14:46:43.31",
          "start_time_gmt": "2020-03-17 14:46:48",
          "hangup_time_gmt": "2020-03-17 14:46:48",
          "duration": 0,
          "extension_id": 372802,
          "extension_name": "0005*101@sip.ringme.ru",
          "extension_type": "phone",
          "extension_group_owner_id": null,
          "client_owner_id": 32362,
          "result": "answered",
          "from_username": "0005*101",
          "from_domain": "sip.ringme.ru",
          "source_number": "0005*101",
          "source_domain": "sip.ringme.ru",
          "to_username": "0005*101",
          "to_domain": "sip.ringme.ru",
          "dest_number": null,
          "dest_domain": null,
          "did_number": null,
          "did_domain": null,
          "from_screen_name": "Ivanov I.I.",
          "hangup_cause": "NORMAL_CLEARING",
          "ext_number_reg": null,
          "application": null,
          "hangup_disposition": "callee_bye",
          "ani_number": null,
          "record_uuid": null,
          "record_file_size": null
        },
...
      ]
    }
  ]
}
Expand
titleGET /client/{client_id}/call_history/

_id}/call_history/ 

Get the client call history 

URL Options 

Name 

Type 

client_id 

string 

Request Options 

Name 

Type 

start_datetime 

string 

from_username 

array [string] 

start_bridged_duration 

integer 

flow 

array [string] 

bridged_username 

array [string] 

end_bridged_duration 

integer 

order 

string 

end_datetime 

string 

did_number 

array [string] 

per_page 

integer 

end_duration 

integer 

extension_id 

array [integer] 

to_username 

array [string] 

start_duration 

integer 

page 

integer 

Response Fields 

Name 

Type 

call_history 

Array[call_history] 

order 

string 

page 

long 

per_page 

long 

Resource call_history 

Name 

Type 

bridged_domain 

string 

bridged_duration 

long 

bridged_time_gmt 

string 

bridged_username 

string 

call_uuid 

string 

cdr 

Array[cdr_response] 

client_owner_id 

long 

did_domain 

string 

did_number 

string 

duration 

long 

ext_number_reg 

string 

extension_group_owner_id 

long 

extension_id 

long 

extension_name 

string 

extension_type 

string 

flow 

string 

from_domain 

string 

from_screen_name 

string 

from_username 

string 

hangup_cause 

string 

hangup_disposition  

string 

hangup_time_gmt 

string 

init_time_gmt 

string 

result 

string 

start_time_gmt 

string 

to_domain 

string 

to_username 

string 

Resource cdr_response 

Name 

Type 

ani_number 

string 

application 

string 

call_uuid 

string 

calls_hangup_disposition  

string 

calls_result 

string 

client_owner_id 

long 

dest_domain 

string 

dest_number 

string 

did_domain 

string 

did_number 

string 

duration 

long 

ext_number_reg 

string 

extension_group_owner_id 

long 

extension_id 

long 

extension_name 

string 

extension_type 

string 

flow 

string 

from_domain 

string 

from_screen_name 

string 

from_username 

string 

hangup_cause 

string 

hangup_disposition 

string 

hangup_time_gmt 

string 

init_time_gmt 

string 

record_file_size 

long 

record_uuid 

string 

result 

string 

source_domain 

string 

source_number 

string 

start_time_gmt 

string 

to_domain 

string 

to_username 

string 

Expand
titleGET /client/{client_id}/call_history/{call_uuid}

GET /client/{client_id}/call_history/{call_uuid} 

Get information about the call using its unique identifier 

URL Options 

Name 

Type 

client_id 

string 

call_uuid 

string 

call_month

string 

Response Fields 

Name 

Type 

bridged_domain 

string 

bridged_duration 

long 

bridged_time_gmt 

string 

bridged_username 

string 

call_uuid 

string 

cdr 

Array[cdr_response] 

client_owner_id 

long 

did_domain 

string 

did_number 

string 

duration 

long 

ext_number_reg 

string 

extension_group_owner_id 

long 

extension_id 

long 

extension_name 

string 

extension_type 

string 

flow 

string 

from_domain 

string 

from_screen_name 

string 

from_username 

string 

hangup_cause 

string 

hangup_disposition  

string 

hangup_time_gmt 

string 

init_time_gmt 

string 

result 

string 

start_time_gmt 

string 

to_domain 

string 

to_username 

string 

Resource cdr_response 

Name 

Type 

ani_number 

string 

application 

string 

call_uuid 

string 

calls_hangup_disposition  

string 

calls_result  

string 

client_owner_id 

long 

dest_domain 

string 

dest_number 

string 

did_domain 

string 

did_number 

string 

duration 

long 

ext_number_reg 

string 

extension_group_owner_id 

long 

extension_id 

long 

extension_name 

string 

extension_type 

string 

flow 

string 

from_domain 

string 

from_screen_name 

string 

from_username 

string 

hangup_cause 

string 

hangup_disposition 

string 

hangup_time_gmt 

string 

init_time_gmt 

string 

record_file_size 

long 

record_uuid 

string 

result 

string 

source_domain 

string 

source_number 

string 

start_time_gmt 

string 

to_domain 

string 

to_username 

string