Tutorial¶
Prerequisites¶
Before working with recordings, you need:
An authentication token. Obtain one via
POST /auth/loginor use an access key fromGET /accesskeys.A call or conference with recording enabled. Start a recording via the
recording_startflow action or viaPOST /calls/{id}/recording_start.A recording ID (UUID). Obtain from the call’s
recording_idsfield viaGET /calls/{id}or by listing recordings viaGET /recordings.
Note
AI Implementation Hint
Recording files are only available for download after the recording reaches ended status. If you attempt to download immediately after stopping a recording, the file may not be ready. Poll GET /recordings/{id} and check for status: "ended" before calling GET /recordingfiles/{id}.
Get list of recordings¶
Example
$ curl -k --location --request GET 'https://api.voipbin.net/v1.0/recordings?token=<YOUR_AUTH_TOKEN>&page_size=10&page_token=2021-05-03+21%3A35%3A02.809'
{
"result": [
{
"id": "348d988b-2ac9-4702-84f0-ae81301ad349",
"customer_id": "5e4a0680-804e-11ec-8477-2fea5968d85b",
"owner_type": "customer",
"owner_id": "5e4a0680-804e-11ec-8477-2fea5968d85b",
"activeflow_id": "00000000-0000-0000-0000-000000000000",
"reference_type": "call",
"reference_id": "531bc6f4-c695-4c6d-a478-f28b88dfc2ca",
"status": "ended",
"format": "wav",
"on_end_flow_id": "00000000-0000-0000-0000-000000000000",
"tm_start": "2021-01-29 05:31:47.870000",
"tm_end": "2021-01-29 05:31:58.932000",
"tm_create": "2021-01-29 05:31:45.051136",
"tm_update": "2021-01-29 05:31:58.943456",
"tm_delete": ""
},
{
"id": "142e8ef8-392c-4514-abf0-8656da5d2fdf",
"customer_id": "5e4a0680-804e-11ec-8477-2fea5968d85b",
"owner_type": "customer",
"owner_id": "5e4a0680-804e-11ec-8477-2fea5968d85b",
"activeflow_id": "00000000-0000-0000-0000-000000000000",
"reference_type": "call",
"reference_id": "f457951b-9918-44af-a834-2216b1cc31bc",
"status": "ended",
"format": "wav",
"on_end_flow_id": "00000000-0000-0000-0000-000000000000",
"tm_start": "2021-01-29 03:18:10.790000",
"tm_end": "2021-01-29 03:18:22.131000",
"tm_create": "2021-01-29 03:18:07.950164",
"tm_update": "2021-01-29 03:18:22.144432",
"tm_delete": ""
},
{
"id": "f27d65bc-2f10-49e1-a49d-a7762965df13",
"customer_id": "5e4a0680-804e-11ec-8477-2fea5968d85b",
"owner_type": "customer",
"owner_id": "5e4a0680-804e-11ec-8477-2fea5968d85b",
"activeflow_id": "00000000-0000-0000-0000-000000000000",
"reference_type": "call",
"reference_id": "5f7a0eff-9de9-4c41-a018-08bffd4a19aa",
"status": "ended",
"format": "wav",
"on_end_flow_id": "00000000-0000-0000-0000-000000000000",
"tm_start": "2021-01-28 09:17:00.814000",
"tm_end": "2021-01-28 09:17:11.883000",
"tm_create": "2021-01-28 09:16:58.076735",
"tm_update": "2021-01-28 09:17:11.890500",
"tm_delete": ""
}
],
"next_page_token": "2021-01-28 09:16:58.076735"
}
Get detail of recording¶
Example
$ curl -k --location --request GET 'https://api.voipbin.net/v1.0/recordings/f27d65bc-2f10-49e1-a49d-a7762965df13?token=<YOUR_AUTH_TOKEN>'
{
"id": "f27d65bc-2f10-49e1-a49d-a7762965df13",
"customer_id": "5e4a0680-804e-11ec-8477-2fea5968d85b",
"owner_type": "customer",
"owner_id": "5e4a0680-804e-11ec-8477-2fea5968d85b",
"activeflow_id": "00000000-0000-0000-0000-000000000000",
"reference_type": "call",
"reference_id": "5f7a0eff-9de9-4c41-a018-08bffd4a19aa",
"status": "ended",
"format": "wav",
"on_end_flow_id": "00000000-0000-0000-0000-000000000000",
"tm_start": "2021-01-28 09:17:00.814000",
"tm_end": "2021-01-28 09:17:11.883000",
"tm_create": "2021-01-28 09:16:58.076735",
"tm_update": "2021-01-28 09:17:11.890500",
"tm_delete": ""
}
Simple recordingfile download¶
Example
$ curl -k --location --request GET 'https://api.voipbin.net/v1.0/recordingfiles/348d988b-2ac9-4702-84f0-ae81301ad349?token=<YOUR_AUTH_TOKEN>' -o tmp.wav
$ play tmp.wav 11s
tmp.wav:
File Size: 170k Bit Rate: 128k
Encoding: Signed PCM
Channels: 1 @ 16-bit
Samplerate: 8000Hz
Replaygain: off
Duration: 00:00:10.62
In:100% 00:00:10.62 [00:00:00.00] Out:85.0k [ | ] Hd:4.4 Clip:0
Done.