Conversation Records (/record/)
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).
The conversation record resource allows you to get a list of available records of a client or extension number for a certain period, to get the record files directly, and also to delete records in a range or per item.Â
- 1 Description of Data StructuresÂ
- 2 Retrieving List of Conversation Records
- 3 Retrieving Statistics of Conversation RecordsÂ
- 4 Retrieving Files of Conversation Records from StorageÂ
- 5 Retrieving Files of Conversation Records from APIÂ
- 6 Retrieving Files Using Basic HTTP AuthenticationÂ
- 7 Retrieving Archive of Files of Conversation RecordsÂ
- 8 "Client" Section ResourcesÂ
- 9 "Extension Number Group" Section ResourcesÂ
- 10 "Extension Number" Section ResourcesÂ
Description of Data StructuresÂ
Retrieving List of Conversation Records
The interval to get and to delete a list is specified by the request options start_datetime and end_datetime. The datetime value in the option end_datetime should not exceed the last day of the month following the start_datetime value. To obtain data for a longer period, you should make several requests. Â
When getting the list, you can specify the request parameter order that specifies the direction to sort the resulting list by the field init_time_gmt (in ascending or descending order).Â
Request optionsÂ
Name | Type | Mandatory | Default Value |
---|---|---|---|
start_datetime | YYYY-MM-DD HH:MM:SS | yes |  |
end_datetime | YYYY-MM-DD HH:MM:SS | yes |  |
order | asc or desc | no | desc |
Retrieving Statistics of Conversation RecordsÂ
Request optionsÂ
Name | Type | Mandatory | Default Value |
---|---|---|---|
start_datetime | YYYY-MM-DD HH:MM:SS | yes |  |
end_datetime | YYYY-MM-DD HH:MM:SS | yes |  |
Fields of Statistics of Conversation RecordsÂ
Name | Type | Description |
---|---|---|
files_size | long | Total size of record files |
records_count | long | Number of record files |
Retrieving Files of Conversation Records from StorageÂ
If the system has an external storage of conversation records, then to get a link to a record in the storage, you must use the following method:Â
GET /client/{client_id}/record/{record_uuid}/storage_url/. In response, the API will return a URL to get the record from the storage. Retrieving the record from the storage does not require authentication. The link is permanent.Â
Retrieving the record files using a repository link is the preferred and most reliable method.Â
Example Â
Retrieving the link to the record from the storage:Â
System response:Â
{
  "record_url": "https://storage.hostname.ru/bd7zzrXD5395gn7FMgzKtB8zhZnNoYx8BdkX_HgNdeE2lnJjPMLcOR_1hQprGf-dW94wuTCNRAY6MDjMZ0zWIg=="
}
Retrieving Files of Conversation Records from APIÂ
To directly receive a conversation record file from a REST API server, you need to make a GET request to the resource corresponding to the required user level, specifying the record identifier:
GET /client/{client_id}/record/{record_uuid}
GET /extension_group/{ext_group_id}/record/{record_uuid}
GET /extension/{extension_id}/record/{record_uuid}
The record file data will be returned in the request body, the file name is contained in the header Content-Disposition.Â
Example
System response:Â
HTTP/1.0 200 OK
Content-Length: 1008
Content-Disposition: attachment; filename=2016-04-18-13-13-47_outbound_0000000000_300.mp3
Server:Â nginx/1.8.1
Date: Tue, 19 Apr 2016 11:56:19 GMT
Content-Type: audio/mpeg |
---|
Retrieving Files Using Basic HTTP AuthenticationÂ
You can access the conversation record files using Basic HTTP Authentication instead of transferring the OAuth2 token. You can see more information in the page "Retrieving Files Using Basic HTTP Authentication".Â
Retrieving Archive of Files of Conversation RecordsÂ
You can get an archive with several record files for a time period. To do it, you need to use a special API resource:
POST /client/{client_id}/record/archive/
transferring the time range and email address to send the link to download the archive. The size of the files in the archive and the date range are limited. You cannot request a new archive within one hour without downloading the previous one. Possible error codes are listed in subsection "Returned codes and statuses". The conversation recordings for the link will be available for 12 hours.Â
JSON OptionsÂ
Name | Type | Mandatory | Default Value |
---|---|---|---|
start_datetime | string (YYYY-MM-DD HH:MM:SS) | yes | Start of the range in the format YYYY-MM-DD HH:MM:SS |
end_datetime | string (YYYY-MM-DD HH:MM:SS) | yes | End of the range in the format YYYY-MM-DD HH:MM:SS |
email | string | yes | Email address to send the link to the archive. You may list several addresses separated by commas |