Reference Turnkey Applications Tutorials Visual Designer
Reference Turnkey Applications Tutorials Visual Designer
    • REST API
      • Overview
      • API Endpoint
      • Authentication
      • Requests
      • Responses
      • Paging
      • Reason Codes Dictionary
    • Management APIs
      • Accounts
      • Identity Access Management BETA
        • Identity Access Management Overview
        • Identity Access Management API
          • User Management
            • Create a User
            • Update a User
            • Retrieve a User
            • Delete a User
          • API Keys Management
            • Create an API Key
            • Update an API Key
            • Retrieve an API Key
            • Delete an API Key
      • Applications
      • Clients
        • Create a Client
        • Delete a Client
        • Change Client’s Password
        • Get a List of Available Clients
      • Incoming Phone Numbers
        • IncomingPhoneNumber Instance Resource
        • IncomingPhoneNumbers List Resource
        • Local IncomingPhoneNumber Factory Resource
        • Toll-Free IncomingPhoneNumber Factory Resource
        • Mobile IncomingPhoneNumber Factory Resource
        • Attach a phone number to an application
        • Enable Incoming MMS for an Application
        • Delete a phone number
        • List of Phone Numbers
        • Incoming Phone Number Regex Support
      • Notifications
      • Usage Records
      • Trace Records
    • Voice
      • Calls
        • Call List Resource URI
        • Making a Call
        • Modifying Live Calls
        • Examples
        • List Filter
        • Paging Information
      • Conference Management
        • Supported Operations
        • Conference List Resource URI
      • Conference Participants Management
        • Participants List Resource URI
      • Gather DTMF
      • Gather Speech
      • Say
      • Play
      • Hold
      • Recordings
      • Refers
        • Resource Properties
        • Supported Operations
        • Paging Information
      • Resume
      • SIP Refer Support
    • Messages API - BETA
      • Overview
      • Channel Identities
      • Send Message
      • Status Callback Parameters
      • Status Callback Events
      • Receive Message
        • Incoming Message Request Parameters
      • Get Message List
      • Get Single Message
      • Message Attributes
      • Status Description
    • SMS
      • Messages
        • Send SMS
        • Get SMS List
        • Get single SMS Information
        • SMS Attributes
      • Error Codes
    • Email
    • RCML
      • Overview
        • Interacting with Your Application
        • RCML Verbs
      • Dial
        • Client
        • Conference
        • Number
        • SIP
      • Email
      • Gather
      • Say
      • Play
      • SMS
      • Message - Beta
      • Hold
      • Resume
      • Hangup
      • Pause
      • Redirect
      • Record
      • Reject
      • Refer
    • Visual Designer API
      • List Application Templates
      • :List a Specific Application Template
      • Create a Visual Designer Application
      • Get Application Details
      • Save Application Changes
      • Create Application Parameters
      • List Application Parameters
      • Delete Application Parameters
      • Upload Application Media Files
      • List Application Media Files
      • Play Application Media Files
      • Delete Application Media Files
      • Get Application Logs
      • Delete Application Logs
      • Get Application Settings
      • Modify Application Settings
      • Rename an Application
      • Delete an Application
      • Get Visual Designer Configuration
    • Turnkey Apps APIs
      • Smart 2FA
        • Sending One-Time Passwords
        • Verifying One-Time Passwords
        • Cancel One-Time Passwords
        • Session Detail Record (SDR)
        • Get list of One-Time Passwords
        • Get a Single One-Time Password
        • Usage Record One-Time Passwords
        • Common Response Error Code
        • Limit
          • Create Limit
          • Update Limit
          • Delete Limit
          • Get List of Limits
      • Call Queuing
      • Auto Attendant
        • Users
        • Announcement
        • Auto Attendant System
        • Menu
        • Schedule
        • Phone Number
        • Usage Records
        • Third Party Integration
      • Number Masking
        • Application
        • Mask Number Pool
        • Context
        • Participants
        • Interactions
        • Usage Records
      • Task Router
docs 1.0
  • docs
    • 1.0
  • docs
  • Enterprise:Voice
  • Enterprise:Recordings

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 \https://$DOMAIN/api/2012-04-24/.

FileUri

The File URI for this recording, relative to \https://$DOMAIN/api/2012-04-24/. 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

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

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

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'
const request = require('request');

// Provide your Account Sid and Auth Token from your Console Account page
const ACCOUNT_SID = 'my_ACCOUNT_SID';
const AUTH_TOKEN = 'my_AUTH_TOKEN';

request({
      method: 'GET',
      url: 'https://mycompany.restcomm.com/restcomm/2012-04-24/Accounts/' + ACCOUNT_SID + '/Recordings.json',
      auth: { 'user': ACCOUNT_SID, 'pass': AUTH_TOKEN }
   },
   function (error, response, body) {
      // Add your business logic below; status can be found at 'response.statusCode' and response body at 'body'
      ...
   }
);
from http.client import HTTPSConnection
from base64 import b64encode

# Provide your Account Sid and Auth Token from your Console Account page
ACCOUNT_SID = 'my_ACCOUNT_SID'
AUTH_TOKEN = 'my_AUTH_TOKEN'

userAndPass = b64encode(bytes(ACCOUNT_SID + ':' + AUTH_TOKEN, 'utf-8')).decode("ascii")
headers = { 'Authorization' : 'Basic %s' %  userAndPass }

conn = HTTPSConnection('mycompany.restcomm.com')
conn.request("GET", '/restcomm/2012-04-24/Accounts/' + ACCOUNT_SID + '/Recordings.json',
      headers=headers)
res = conn.getresponse()

# Add your business logic below; status can be found at 'res.status', reason at 'res.reason' and response body can be retrieved with res.read()
...
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
import java.io.*;
import java.util.Base64;

public class JavaSampleClass {
   // Provide your Account Sid and Auth Token from your Console Account page
   public static final String ACCOUNT_SID = "my_ACCOUNT_SID";
   public static final String AUTH_TOKEN = "my_AUTH_TOKEN";


   public static void main(String[] args) throws Exception {
      String userAndPass = ACCOUNT_SID + ':' + AUTH_TOKEN;
      String encoded = Base64.getEncoder().encodeToString(userAndPass.getBytes());

      URL url = new URL("https://mycompany.restcomm.com/restcomm/2012-04-24/Accounts/" + ACCOUNT_SID + "/Recordings.json");
      HttpsURLConnection conn = (HttpsURLConnection)url.openConnection();
      conn.setRequestProperty("Authorization", "Basic " + encoded);
      conn.setRequestMethod("GET");

      // Add your business logic below; response code can be obtained from 'conn.getResponseCode()' and input stream from 'conn.getInputStream()'
      ...
  }
}

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 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://mycompany.restcomm.com/restcomm/2012-04-24/Accounts/ACCOUNT_SID/Recordings.json?CallSid=CAfe9ce46f104f5beeb10c83a5dad2be66  \
   -u 'YourAccountSid:YourAuthToken'
const request = require('request');

// Provide your Account Sid and Auth Token from your Console Account page
const ACCOUNT_SID = 'my_ACCOUNT_SID';
const AUTH_TOKEN = 'my_AUTH_TOKEN';

request({
      method: 'GET',
      url: 'https://mycompany.restcomm.com/restcomm/2012-04-24/Accounts/' + ACCOUNT_SID + '/Recordings.json?CallSid=CAfe9ce46f104f5beeb10c83a5dad2be66',
      auth: { 'user': ACCOUNT_SID, 'pass': AUTH_TOKEN }
   },
   function (error, response, body) {
      // Add your business logic below; status can be found at 'response.statusCode' and response body at 'body'
      ...
   }
);
from http.client import HTTPSConnection
from base64 import b64encode

# Provide your Account Sid and Auth Token from your Console Account page
ACCOUNT_SID = 'my_ACCOUNT_SID'
AUTH_TOKEN = 'my_AUTH_TOKEN'

userAndPass = b64encode(bytes(ACCOUNT_SID + ':' + AUTH_TOKEN, 'utf-8')).decode("ascii")
headers = { 'Authorization' : 'Basic %s' %  userAndPass }

conn = HTTPSConnection('mycompany.restcomm.com')
conn.request("GET", '/restcomm/2012-04-24/Accounts/' + ACCOUNT_SID + '/Recordings.json?CallSid=CAfe9ce46f104f5beeb10c83a5dad2be66',
      headers=headers)
res = conn.getresponse()

# Add your business logic below; status can be found at 'res.status', reason at 'res.reason' and response body can be retrieved with res.read()
...
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
import java.io.*;
import java.util.Base64;

public class JavaSampleClass {
   // Provide your Account Sid and Auth Token from your Console Account page
   public static final String ACCOUNT_SID = "my_ACCOUNT_SID";
   public static final String AUTH_TOKEN = "my_AUTH_TOKEN";


   public static void main(String[] args) throws Exception {
      String userAndPass = ACCOUNT_SID + ':' + AUTH_TOKEN;
      String encoded = Base64.getEncoder().encodeToString(userAndPass.getBytes());

      URL url = new URL("https://mycompany.restcomm.com/restcomm/2012-04-24/Accounts/" + ACCOUNT_SID + "/Recordings.json?CallSid=CAfe9ce46f104f5beeb10c83a5dad2be66");
      HttpsURLConnection conn = (HttpsURLConnection)url.openConnection();
      conn.setRequestProperty("Authorization", "Basic " + encoded);
      conn.setRequestMethod("GET");

      // Add your business logic below; response code can be obtained from 'conn.getResponseCode()' and input stream from 'conn.getInputStream()'
      ...
  }
}

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'
const request = require('request');

// Provide your Account Sid and Auth Token from your Console Account page
const ACCOUNT_SID = 'my_ACCOUNT_SID';
const AUTH_TOKEN = 'my_AUTH_TOKEN';

request({
      method: 'GET',
      url: 'https://mycompany.restcomm.com/restcomm/2012-04-24/Accounts/' + ACCOUNT_SID + '/Recordings.json?PageSize=1',
      auth: { 'user': ACCOUNT_SID, 'pass': AUTH_TOKEN }
   },
   function (error, response, body) {
      // Add your business logic below; status can be found at 'response.statusCode' and response body at 'body'
      ...
   }
);
from http.client import HTTPSConnection
from base64 import b64encode

# Provide your Account Sid and Auth Token from your Console Account page
ACCOUNT_SID = 'my_ACCOUNT_SID'
AUTH_TOKEN = 'my_AUTH_TOKEN'

userAndPass = b64encode(bytes(ACCOUNT_SID + ':' + AUTH_TOKEN, 'utf-8')).decode("ascii")
headers = { 'Authorization' : 'Basic %s' %  userAndPass }

conn = HTTPSConnection('mycompany.restcomm.com')
conn.request("GET", '/restcomm/2012-04-24/Accounts/' + ACCOUNT_SID + '/Recordings.json?PageSize=1',
      headers=headers)
res = conn.getresponse()

# Add your business logic below; status can be found at 'res.status', reason at 'res.reason' and response body can be retrieved with res.read()
...
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
import java.io.*;
import java.util.Base64;

public class JavaSampleClass {
   // Provide your Account Sid and Auth Token from your Console Account page
   public static final String ACCOUNT_SID = "my_ACCOUNT_SID";
   public static final String AUTH_TOKEN = "my_AUTH_TOKEN";


   public static void main(String[] args) throws Exception {
      String userAndPass = ACCOUNT_SID + ':' + AUTH_TOKEN;
      String encoded = Base64.getEncoder().encodeToString(userAndPass.getBytes());

      URL url = new URL("https://mycompany.restcomm.com/restcomm/2012-04-24/Accounts/" + ACCOUNT_SID + "/Recordings.json?PageSize=1");
      HttpsURLConnection conn = (HttpsURLConnection)url.openConnection();
      conn.setRequestProperty("Authorization", "Basic " + encoded);
      conn.setRequestMethod("GET");

      // Add your business logic below; response code can be obtained from 'conn.getResponseCode()' and input stream from 'conn.getInputStream()'
      ...
  }
}

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'
const request = require('request');

// Provide your Account Sid and Auth Token from your Console Account page
const ACCOUNT_SID = 'my_ACCOUNT_SID';
const AUTH_TOKEN = 'my_AUTH_TOKEN';

request({
      method: 'GET',
      url: 'https://mycompany.restcomm.com/restcomm/2012-04-24/Accounts/' + ACCOUNT_SID + '/Recordings.json?PageSize=1&Limit=500',
      auth: { 'user': ACCOUNT_SID, 'pass': AUTH_TOKEN }
   },
   function (error, response, body) {
      // Add your business logic below; status can be found at 'response.statusCode' and response body at 'body'
      ...
   }
);
from http.client import HTTPSConnection
from base64 import b64encode

# Provide your Account Sid and Auth Token from your Console Account page
ACCOUNT_SID = 'my_ACCOUNT_SID'
AUTH_TOKEN = 'my_AUTH_TOKEN'

userAndPass = b64encode(bytes(ACCOUNT_SID + ':' + AUTH_TOKEN, 'utf-8')).decode("ascii")
headers = { 'Authorization' : 'Basic %s' %  userAndPass }

conn = HTTPSConnection('mycompany.restcomm.com')
conn.request("GET", '/restcomm/2012-04-24/Accounts/' + ACCOUNT_SID + '/Recordings.json?PageSize=1&Limit=500',
      headers=headers)
res = conn.getresponse()

# Add your business logic below; status can be found at 'res.status', reason at 'res.reason' and response body can be retrieved with res.read()
...
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
import java.io.*;
import java.util.Base64;

public class JavaSampleClass {
   // Provide your Account Sid and Auth Token from your Console Account page
   public static final String ACCOUNT_SID = "my_ACCOUNT_SID";
   public static final String AUTH_TOKEN = "my_AUTH_TOKEN";


   public static void main(String[] args) throws Exception {
      String userAndPass = ACCOUNT_SID + ':' + AUTH_TOKEN;
      String encoded = Base64.getEncoder().encodeToString(userAndPass.getBytes());

      URL url = new URL("https://mycompany.restcomm.com/restcomm/2012-04-24/Accounts/" + ACCOUNT_SID + "/Recordings.json?PageSize=1&Limit=500");
      HttpsURLConnection conn = (HttpsURLConnection)url.openConnection();
      conn.setRequestProperty("Authorization", "Basic " + encoded);
      conn.setRequestMethod("GET");

      // Add your business logic below; response code can be obtained from 'conn.getResponseCode()' and input stream from 'conn.getInputStream()'
      ...
  }
}

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:

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://mycompany.restcomm.com/restcomm/2012-04-24/"Accounts/ACCOUNT_SID/Recordings.json?SortBy=DateCreated:asc'  \
   -u 'YourAccountSid:YourAuthToken'
const request = require('request');

// Provide your Account Sid and Auth Token from your Console Account page
const ACCOUNT_SID = 'my_ACCOUNT_SID';
const AUTH_TOKEN = 'my_AUTH_TOKEN';

request({
      method: 'GET',
      url: 'https://mycompany.restcomm.com/restcomm/2012-04-24/"Accounts/' + ACCOUNT_SID + '/Recordings.json?SortBy=DateCreated:asc'',
      auth: { 'user': ACCOUNT_SID, 'pass': AUTH_TOKEN }
   },
   function (error, response, body) {
      // Add your business logic below; status can be found at 'response.statusCode' and response body at 'body'
      ...
   }
);
from http.client import HTTPSConnection
from base64 import b64encode

# Provide your Account Sid and Auth Token from your Console Account page
ACCOUNT_SID = 'my_ACCOUNT_SID'
AUTH_TOKEN = 'my_AUTH_TOKEN'

userAndPass = b64encode(bytes(ACCOUNT_SID + ':' + AUTH_TOKEN, 'utf-8')).decode("ascii")
headers = { 'Authorization' : 'Basic %s' %  userAndPass }

conn = HTTPSConnection('mycompany.restcomm.com')
conn.request("GET", '/restcomm/2012-04-24/"Accounts/' + ACCOUNT_SID + '/Recordings.json?SortBy=DateCreated:asc'',
      headers=headers)
res = conn.getresponse()

# Add your business logic below; status can be found at 'res.status', reason at 'res.reason' and response body can be retrieved with res.read()
...
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
import java.io.*;
import java.util.Base64;

public class JavaSampleClass {
   // Provide your Account Sid and Auth Token from your Console Account page
   public static final String ACCOUNT_SID = "my_ACCOUNT_SID";
   public static final String AUTH_TOKEN = "my_AUTH_TOKEN";


   public static void main(String[] args) throws Exception {
      String userAndPass = ACCOUNT_SID + ':' + AUTH_TOKEN;
      String encoded = Base64.getEncoder().encodeToString(userAndPass.getBytes());

      URL url = new URL("https://mycompany.restcomm.com/restcomm/2012-04-24/"Accounts/" + ACCOUNT_SID + "/Recordings.json?SortBy=DateCreated:asc'");
      HttpsURLConnection conn = (HttpsURLConnection)url.openConnection();
      conn.setRequestProperty("Authorization", "Basic " + encoded);
      conn.setRequestMethod("GET");

      // Add your business logic below; response code can be obtained from 'conn.getResponseCode()' and input stream from 'conn.getInputStream()'
      ...
  }
}

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"
    }
  ]
}

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://mycompany.restcomm.com/restcomm/2012-04-24/"Accounts/ACCOUNT_SID/Recordings/RECORDING_SID'  \
   -u 'YourAccountSid:YourAuthToken'
const request = require('request');

// Provide your Account Sid and Auth Token from your Console Account page
const ACCOUNT_SID = 'my_ACCOUNT_SID';
const AUTH_TOKEN = 'my_AUTH_TOKEN';
// Provide additional path parameters if applicable
const RECORDING_SID = 'my_RECORDING_SID'

request({
      method: 'DELETE',
      url: 'https://mycompany.restcomm.com/restcomm/2012-04-24/"Accounts/' + ACCOUNT_SID + '/Recordings/' + RECORDING_SID + ''',
      auth: { 'user': ACCOUNT_SID, 'pass': AUTH_TOKEN }
   },
   function (error, response, body) {
      // Add your business logic below; status can be found at 'response.statusCode' and response body at 'body'
      ...
   }
);
from http.client import HTTPSConnection
from base64 import b64encode

# Provide your Account Sid and Auth Token from your Console Account page
ACCOUNT_SID = 'my_ACCOUNT_SID'
AUTH_TOKEN = 'my_AUTH_TOKEN'
// Provide additional path parameters if applicable
RECORDING_SID = 'my_RECORDING_SID'

userAndPass = b64encode(bytes(ACCOUNT_SID + ':' + AUTH_TOKEN, 'utf-8')).decode("ascii")
headers = { 'Authorization' : 'Basic %s' %  userAndPass }

conn = HTTPSConnection('mycompany.restcomm.com')
conn.request("DELETE", '/restcomm/2012-04-24/"Accounts/' + ACCOUNT_SID + '/Recordings/' + RECORDING_SID + ''',
      headers=headers)
res = conn.getresponse()

# Add your business logic below; status can be found at 'res.status', reason at 'res.reason' and response body can be retrieved with res.read()
...
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
import java.io.*;
import java.util.Base64;

public class JavaSampleClass {
   // Provide your Account Sid and Auth Token from your Console Account page
   public static final String ACCOUNT_SID = "my_ACCOUNT_SID";
   public static final String AUTH_TOKEN = "my_AUTH_TOKEN";
   // Provide additional path parameters if applicable
   public static final String RECORDING_SID = "my_RECORDING_SID"

   public static void main(String[] args) throws Exception {
      String userAndPass = ACCOUNT_SID + ':' + AUTH_TOKEN;
      String encoded = Base64.getEncoder().encodeToString(userAndPass.getBytes());

      URL url = new URL("https://mycompany.restcomm.com/restcomm/2012-04-24/"Accounts/" + ACCOUNT_SID + "/Recordings/" + RECORDING_SID + "'");
      HttpsURLConnection conn = (HttpsURLConnection)url.openConnection();
      conn.setRequestProperty("Authorization", "Basic " + encoded);
      conn.setRequestMethod("DELETE");

      // Add your business logic below; response code can be obtained from 'conn.getResponseCode()' and input stream from 'conn.getInputStream()'
      ...
  }
}
Platform

Programmable Voice

Programmable SMS

Turnkey Applications

Smart 2FA

Call Queue

Auto Attendant

Number Masking

Task Router

Campaign Manager

Learn

Terms And Conditions

About

ABOUT

CONTACT US

© 2020, All rights reserved.