Recordings
Recordings
Recordings are generated when you use the <Record> verb. Those recordings are hosted with CPaaS for you to retrieve. The Recordings list resource represents the set of an account’s recordings.
Recording Resource URI
/2012-04-24/Accounts/{AccountSid}/Recordings/{RecordingSid}
To download the audio file just append .wav after the RecordingSid.
The URLs that contain the actual audio recordings are accessible by everyone without the need to authenticate with CPaaS. This is per design to allow for your apps to easily access the recordings without revealing your credentials. The same is NOT true for the resource to retrieve the list of recordings so unauthenticated users cannot access the RecordingSid and hence not able to download the actual recording.
Although Recording Sids in Recording URLs are essentially long random strings that are very difficult to guess, you still need to make sure that they don’t fall in the wrong hands |
Resource Properties
Property | Description |
---|---|
Sid |
A string that uniquely identifies this recording. |
DateCreated |
The date that this recording was created. |
DateUpdated |
The date that this recording was last updated. |
AccountSid |
The unique id of the Account that created this recording. |
CallSid |
The unique id of the call during which the recording was made. |
Duration |
The length of the recording, in seconds. |
ApiVersion |
The API version in use during the recording. |
Uri |
The URI for this account, relative to |
FileUri |
The File URI for this recording, relative to |
S3Uri |
The S3 URI for this recording - Exists ONLY IF Amazon S3 integration is enabled and security level is NONE- |
Recording List Resource
Recording List Resource URI
-
/2012-04-24/Accounts/{AccountSid}/Recordings
-
/2012-04-24/Accounts/{AccountSid}/Calls/{CallSid}/Recordings
The resource /2012-04-24/Accounts/{AccountSid}/Calls/{CallSid}/Recordings is deprecated and will be removed in the near future. Users are encouraged to use /2012-04-24/Accounts/{AccountSid}/Recordings?CallSid={CallSid} queries instead. |
Unlike the Recording instance resource described above, the list of recordings IS protected by your account credentials like most parts of this API. You must use HTTP basic auth to access the Recordings list resource.* |
Get List of Recordings
Here’s how you can list your recordings:
curl -X GET https://mycompany.restcomm.com/restcomm/2012-04-24/Accounts/ACCOUNT_SID/Recordings.json \
-u 'YourAccountSid:YourAuthToken'
The response will be similar to the one below.
{"page":0,"num_pages":0,"page_size":50,"total":34,"start":"0","end":"34","uri":"/api/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings.json","first_page_uri":"/api/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings.json?Page=0&PageSize=50","previous_page_uri":"null","next_page_uri":"null","last_page_uri":"/api/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings.json?Page=0&PageSize=50","recordings":
[
{
"sid":"RFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"date_created":"Mon, 6 Jan 2014 08:51:07 +0900",
"date_updated":"Mon, 6 Jan 2014 08:51:07 +0900",
"account_sid":"ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"call_sid":"CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"duration":"14.70275",
"api_version":"2012-04-24",
"uri":"/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings/RE50675909d9c94acda36f0e119b6cb431.json",
"file_uri":"\https://$DOMAIN/restcomm/recordings/RE50675909d9c94acda36f0e119b6cb431.wav"
},
...
]
}
<Sid> holds the file name of the recorded message. The recording Sid.wav is available in the file system only. |
If you want to return the recording url you will need to parse the <Uri>/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings/REb4c03af76cdc4a27aad0d9d759e119bc</Uri> response from CPaaS and add the extension .wav
The <Uri> holds the http URI that can be used for playback or to download the recorded message.
Here is how to access the file using http \https://$DOMAIN/restcomm/recordings/REb4c03af76cdc4a27aad0d9d759e119bc.wav`
List Filter
HTTP GET. The following GET query string parameters allow you to limit the list returned. Note, parameters are case-sensitive:
Request Parameters
Parameter | Description |
---|---|
StartTime |
Only show recordings that were made on this date/time or later, given as an ISO-8601 date/time string, like |
EndTime |
Only show recordings that were made on this date/time or earlier, given as an ISO-8601 date/time string, like |
CallSid |
Only show recordings that have been started from this CallSid |
Filter using the CallSid parameter.
The example below will only return Recordings that has been started from this CallSid
curl -X GET https://mycompany.restcomm.com/restcomm/2012-04-24/Accounts/ACCOUNT_SID/Recordings.json?CallSid=CAfe9ce46f104f5beeb10c83a5dad2be66 \
-u 'YourAccountSid:YourAuthToken'
The result will be similar to the one below
{"page":0,"num_pages":0,"page_size":50,"total":17,"start":"0","end":"17","uri":"/api/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings.json","first_page_uri":"/api/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings.json?Page=0&PageSize=50","previous_page_uri":"null","next_page_uri":"null","last_page_uri":"/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings.json?Page=0&PageSize=50","recordings":
[
{
"sid":"RFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"date_created":"Mon, 6 Jan 2014 08:51:07 +0900",
"date_updated":"Mon, 6 Jan 2014 08:51:07 +0900",
"account_sid":"ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"call_sid":"CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"duration":"14.70275",
"api_version":"2012-04-24",
"uri":"/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings/RE50675909d9c94acda36f0e119b6cb431.json",
"file_uri":"\https://$DOMAIN/restcomm/recordings/RE50675909d9c94acda36f0e119b6cb431.wav"
},
...
]
}
Paging Information
HTTP GET. The following GET query string parameters allow you to limit the list returned. Note, parameters are case-sensitive:
Request Parameters
Parameter | Description |
---|---|
Page |
The current page number. Zero-indexed, so the first page is 0. |
PageSize |
How many items are in each page |
Limit |
The total number of items in the list. |
StartTime |
The position in the overall list of the first item in this page. |
EndTime |
The position in the overall list of the last item in this page. |
CallSid |
The Call sid of the resource. |
Example.
The command below will return a single item from the list of recordings using the PageSize parameter
curl -X GET https://mycompany.restcomm.com/restcomm/2012-04-24/Accounts/ACCOUNT_SID/Recordings.json?PageSize=1 \
-u 'YourAccountSid:YourAuthToken'
The result of the PageSize parameter
{
"page": 0,
"num_pages": 0,
"page_size": 1,
"total": 34,
"limit": 10000,
"start": "0",
"end": "0",
"uri": "/restcomm/2012-04-24/Accounts/ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/Recordings",
"first_page_uri": "/restcomm/2012-04-24/Accounts/ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/Recordings?Page=0&PageSize=1&Limit=10000",
"previous_page_uri": "null",
"next_page_uri": "null",
"last_page_uri": "/restcomm/2012-04-24/Accounts/ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/Recordings?Page=0&PageSize=1&Limit=10000",
"recordings": [{
"sid": "RE50675909d9c94acda36f0e119b6cb431",
"date_created": "Tue, 5 Jan 2016 08:51:07 +0200",
"date_updated": "Tue, 5 Jan 2016 08:51:07 +0200",
"account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"call_sid": "CAfe9ce46f104f4beeb10c83a5dad2be66",
"duration": "14.70275",
"api_version": "2012-04-24",
"uri": "/2012-04-24/Accounts/ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/Recordings/RE50675909d9c94acda36f0e119b6cb431.json",
"file_uri": "http://instance1.restcomm.com/restcomm/recordings/RE50675909d9c94acda36f0e119b6cb431.wav"
}]
}
The command below, using Limit parameter will return a list of 500 records in total
curl -X GET https://mycompany.restcomm.com/restcomm/2012-04-24/Accounts/ACCOUNT_SID/Recordings.json?PageSize=1&Limit=500 \
-u 'YourAccountSid:YourAuthToken'
The result of the Limit parameter
{
"page": 0,
"num_pages": 0,
"page_size": 1,
"total": 34,
"limit": 500,
"start": "0",
"end": "0",
"uri": "/restcomm/2012-04-24/Accounts/ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/Recordings",
"first_page_uri": "/restcomm/2012-04-24/Accounts/ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/Recordings?Page=0&PageSize=1&Limit=500",
"previous_page_uri": "null",
"next_page_uri": "null",
"last_page_uri": "/restcomm/2012-04-24/Accounts/ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/Recordings?Page=0&PageSize=1&Limit=500",
"recordings": [{
"sid": "RE50675909d9c94acda36f0e119b6cb431",
"date_created": "Tue, 5 Jan 2016 08:51:07 +0200",
"date_updated": "Tue, 5 Jan 2016 08:51:07 +0200",
"account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"call_sid": "CAfe9ce46f104f4beeb10c83a5dad2be66",
"duration": "14.70275",
"api_version": "2012-04-24",
"uri": "/2012-04-24/Accounts/ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/Recordings/RE50675909d9c94acda36f0e119b6cb431.json",
"file_uri": "http://instance1.restcomm.com/restcomm/recordings/RE50675909d9c94acda36f0e119b6cb431.wav"
}]
}
Additional Paging Information.
The API returns URIs to the next, previous, first and last pages of the returned list as shown in the table below:
Sorting Information
HTTP GET. You can use the SortBy GET query parameter to determine which attribute you want to sort by and in which direction; direction can either be 'asc' for ascending and 'desc' for descending sort ordering. Here’s the overall format: SortBy=<sorting attribute>:<direction>. If no direction parameter is provided, then the listing of recordings is sorted by the attribute in ascending order. Below you can find the possible attributes you can sort by:
SortBy Attributes
Parameter | Description |
---|---|
DateCreated |
Sort by date at which the recording was created |
Duration |
Sort by the duration of the recording |
CallSid |
Sort by the CallSid of the recording, which points to the call to which the recording is related to |
Example
The command below will return recordings sorted by the creation date in ascending order using SortBy parameter:
curl -X GET https://mycompany.restcomm.com/restcomm/2012-04-24/"Accounts/ACCOUNT_SID/Recordings.json?SortBy=DateCreated:asc' \
-u 'YourAccountSid:YourAuthToken'
The result of the SortBy parameter:
{ "page": 0, "num_pages": 12, "page_size": 50, "total": 641, "start": "0", "end": "49", "uri": "/restcomm/2012-04-24/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings", "first_page_uri": "/restcomm/2012-04-24/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings?Page=0&PageSize=50", "previous_page_uri": "null", "next_page_uri": "/restcomm/2012-04-24/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings?Page=1&PageSize=50&AfterSid=REb4c4c07b59c646cab9d3869c469657bf", "last_page_uri": "/restcomm/2012-04-24/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings?Page=12&PageSize=50", "recordings": [ { "sid": "RE054a9790bcc0474fb8f79b5766d86888", "date_created": "Fri, 25 Mar 2016 14:32:14 +0000", "date_updated": "Tue, 16 Jan 2018 10:34:48 +0000", "account_sid": "AC61148eb9d61281750ccc0e13c6094fe1", "call_sid": "CAa1e8f6d62dd444139bfe26614ba3908b", "duration": "6.06275", "api_version": "2012-04-24", "uri": "/2012-04-24/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings/RE054a9790bcc0474fb8f79b5766d86888.json", "file_uri": "/restcomm/2012-04-24/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings/RE054a9790bcc0474fb8f79b5766d86888.wav" }, { "sid": "RE3be0e3b429194b90a488c38e0c2d5f24", "date_created": "Fri, 25 Mar 2016 15:40:39 +0000", "date_updated": "Tue, 16 Jan 2018 10:34:48 +0000", "account_sid": "AC61148eb9d61281750ccc0e13c6094fe1", "call_sid": "CA018f5d608c814c278bac005edd171085", "duration": "5.74275", "api_version": "2012-04-24", "uri": "/2012-04-24/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings/RE3be0e3b429194b90a488c38e0c2d5f24.json", "file_uri": "/restcomm/2012-04-24/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings/RE3be0e3b429194b90a488c38e0c2d5f24.wav" }, { "sid": "REXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "date_created": "Mon, 27 Jun 2016 14:42:12 +0000", "date_updated": "Tue, 16 Jan 2018 10:34:48 +0000", "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "call_sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "duration": "5.36275", "api_version": "2012-04-24", "uri": "/2012-04-24/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings/REa793b3dc65e14d95b4ad238fb38bed0a.json", "file_uri": "/restcomm/2012-04-24/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings/REa793b3dc65e14d95b4ad238fb38bed0a.wav" } ] }