Recordings

Recordings are generated when you use the <Record> verb. Those recordings are hosted with RestComm 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 Restcomm. 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 https://cloud.restcomm.com/restcomm.

FileUri

The File URI for this recording, relative to https://cloud.restcomm.com/restcomm. It can be used to access the WAV file

S3Uri

The S3 URI for this recording - Exists ONLY IF Amazon S3 integration is enabled and security level is NONE-

Supported Operations

HTTP GET. Returns the representation of a Recording resource, including the properties above.

HTTP DELETE. Removes the recording from the account.

Recording List Resource

Recording List Resource URI

  • /2012-04-24/Accounts/{AccountSid}/Recordings

  • /2012-04-24/Accounts/{AccountSid}/Calls/{CallSid}/Recordings

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.*

Supported Operations

HTTP GET

Returns the list representation of all the Recording resources for this Account, including the properties above.

HTTP DELETE

Deletes a recording that belongs to this Account.

How to Record a Message

Go to the RCML section to learn how to record a message.

Get List of Recordings

The list of recorded wav files can be found in the directory $RESTCOMM_HOME/standalone/deployments/restcomm.war/recordings/

From the bash terminal, you can run the command below:

curl -X GET  https://<accountSid>:<authToken>@cloud.restcomm.com/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings.json

The response will be similar to the one below.

{"page":0,"num_pages":0,"page_size":50,"total":34,"start":"0","end":"34","uri":"/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings.json","first_page_uri":"/restcomm/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":"RF50675909d9c94acda36f0e119b6cb431",
            "date_created":"Mon, 6 Jan 2014 08:51:07 +0900",
            "date_updated":"Mon, 6 Jan 2014 08:51:07 +0900",
            "account_sid":"ACae6e420f425248d6a26948c17a9e2acf",
            "call_sid":"CAfe9ce46f104f4beeb10c83a5ddd2be66",
            "duration":"14.70275",
            "api_version":"2012-04-24",
            "uri":"/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings/RE50675909d9c94acda36f0e119b6cb431.json",
            "file_uri":"https://cloud.restcomm.com/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 Restcomm 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://cloud.restcomm.com/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 YYYY-MM-DDTHH:MM:SS (for example 2018-10-05T22:45:32) or, if you want to omit the time, YYYY-MM-DD (for example 2018-10-05). When only a date is provided the time is assumed to be at midnight of the given date. Note that the given date/time is inclusive and is assumed to be in UTC timezone.

EndTime

Only show recordings that were made on this date/time or earlier, given as an ISO-8601 date/time string, like YYYY-MM-DDTHH:MM:SS (for example 2018-10-06T02:10:03) or, if you want to omit the time, YYYY-MM-DD (for example 2018-10-06). When only a date is provided the time is assumed to be at midnight of the given date. Note that the given date/time is inclusive and is assumed to be in UTC timezone.

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://<accountSid>:<authToken>@cloud.restcomm.com/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings.json?CallSid=CAfe9ce46f104f5beeb10c83a5dad2be66

The result will be similar to the one below

{"page":0,"num_pages":0,"page_size":50,"total":17,"start":"0","end":"17","uri":"/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings.json","first_page_uri":"/restcomm/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":"RF50675909d9c94acda36f0e119b6cb431",
            "date_created":"Mon, 6 Jan 2014 08:51:07 +0900",
            "date_updated":"Mon, 6 Jan 2014 08:51:07 +0900",
            "account_sid":"ACae6e420f425248d6a26948c17a9e2acf",
            "call_sid":"CAfe9ce46f104f5beeb10c83a5dad2be66",
            "duration":"14.70275",
            "api_version":"2012-04-24",
            "uri":"/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings/RE50675909d9c94acda36f0e119b6cb431.json",
            "file_uri":"https://cloud.restcomm.com/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

PParameter Description

Page

The current page number. Zero-indexed, so the first page is 0.

NumPages

The total number of pages.

PageSize

How many items are in each page

Total

The total number of items in the list.

Start

The position in the overall list of the first item in this page.

End

The position in the overall list of the last item in this page.

 

Example.

The command below will return a single item from the list of recordings using the PageSize parameter

curl -X GET  https://<accountSid>:<authToken>@cloud.restcomm.com/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings.json?PageSize=1

The result of the PageSize parameter

{"page":0,"num_pages":34,"page_size":1,"total":34,"start":"0","end":"0","uri":"/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings.json","first_page_uri":"/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings.json?Page=0&PageSize=1","previous_page_uri":"null","next_page_uri":"/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings.json?Page=1&PageSize=1&AfterSid=RF50675909d9c94acda36f0e119b6cb431","last_page_uri":"/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings.json?Page=34&PageSize=1","recordings":
    [
        {
            "sid":"RF50675909d9c94acda36f0e119b6cb431",
            "date_created":"Mon, 6 Jan 2014 08:51:07 +0900",
            "date_updated":"Mon, 6 Jan 2014 08:51:07 +0900",
            "account_sid":"ACae6e420f425248d6a26948c17a9e2acf",
            "call_sid":"CAfe9ce46f104f5beeb10c83a5dad2be66",
            "duration":"14.70275",
            "api_version":"2012-04-24",
            "uri":"/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings/RE50675909d9c94acda36f0e119b6cb431.json",
            "file_uri":"https://cloud.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:

Request Parameters

Parameter Description

Uri

The URI of the current page.

Firstpageuri

The URI for the first page of this list.

Nextpageuri

The URI for the next page of this list.

Previouspageuri

The URI for the previous page of this list.

Lastpageuri

The URI for the last page of this list.

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://<accountSid>:<authToken>@cloud.restcomm.com/restcomm/2012-04-24/Accounts/<accountSid>/Recordings?SortBy=DateCreated:asc

The result of the SortBy parameter:

<RestcommResponse>
    <Recordings>
        <Recording>
            <Sid>REb3d71735549e4f91b3431305652e7309</Sid>
            <DateCreated>Tue, 10 Jul 2018 10:58:25 +0300</DateCreated>
            <DateUpdated>Tue, 10 Jul 2018 10:58:25 +0300</DateUpdated>
            <CallSid>ID8555f97abe0441e0a07ca2da3a081871-CA9f2360fc21e848d291dfaf5f3d32d95b</CallSid>
            <Duration>2</Duration>
            ...
        </Recording>
        <Recording>
            <Sid>RE4960cab74a984f85ba1c656485c981ea</Sid>
            <DateCreated>Tue, 10 Jul 2018 10:58:33 +0300</DateCreated>
            <DateUpdated>Tue, 10 Jul 2018 10:58:33 +0300</DateUpdated>
            <CallSid>ID8555f97abe0441e0a07ca2da3a081871-CAfd5703072846456b9093a00c32e8b3f1</CallSid>
            <Duration>2</Duration>
            ...
        </Recording>
        <Recording>
            <Sid>RE63d742b8b0f44e7a819302ae97775e26</Sid>
            <DateCreated>Tue, 10 Jul 2018 11:00:19 +0300</DateCreated>
            <DateUpdated>Tue, 10 Jul 2018 11:00:19 +0300</DateUpdated>
            <CallSid>ID8555f97abe0441e0a07ca2da3a081871-CA79f2c079f1d145a1970118012554b154</CallSid>
            <Duration>4</Duration>
            ...
        </Recording>
    </Recordings>
</RestcommResponse>

Delete a Recording

Recording Delete Resource URI

  • /2012-04-24/Accounts/{AccountSid}/Recordings/{RecordingSid}

From the bash terminal, you can run the command below:

curl -X DELETE  https://<accountSid>:<authToken>@cloud.restcomm.com/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings/RE10000000000000000000000000000032