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:Management APIs
  • Enterprise:Notifications

Notifications

Notifications

A Notification resource represents a single log entry made by CPaaS while handling your calls or your use of the restful APIs. It is very useful for debugging purposes. The Notifications list resource represents the set of notifications generated for an account.

Notification Resource URI

/2012-04-24/Accounts/{AccountSid}/Notifications/{NotificationSid}

Resource Properties

Property Description

Sid

A string that uniquely identifies this transcription.

DateCreated

The date that this transcription was created.

DateUpdated

The date that this transcription was last updated.

AccountSid

The unique id of the Account that created this transcription.

CallSid

CallSid is the unique id of the call during which the notification was generated. Empty if the notification was generated by the Restful APIs without regard to a specific phone call.

ApiVersion

The CPaaS API version in use when this notification was generated. May be empty for events that don’t have a specific API version.

Log

An integer log level corresponding to the type of notification: 0 is ERROR, 1 is WARNING.

ErrorCode

A unique error code for the error condition. You can lookup errors, in our Error Dictionary.

MoreInfo

A URL for more information about the error condition. The URL is a page in our Error Dictionary.

MessageText

The text for the notification.

MessageDate

The date the notification was actually generated

RequestUrl

The URL of the resource that caused the notification to be generated.

RequestMethod

The HTTP method in use for the request that caused the notification to be generated.

RequestVariables

The HTTP GET or POST variables that CPaaS generated and sent to your server. Also, if the notification was generated by the Restful APIs, this field will include any HTTP POST or PUT variables you sent.

ResponseHeaders

The HTTP headers returned by your server.

ResponseBody

The HTTP body returned by your server.

Uri

The URI for this account, relative to \https://$DOMAIN/api/2012-04-24/.

Supported Operations

HTTP GET. Returns the representation of a Notification resource, including the properties above.Notification List Resource

Notification List Resource URI

/2012-04-24/Accounts/{AccountSid}/Notifications

Supported Operations

HTTP GET. Returns the list representation of all the Notification resources for this Account, including the properties above.

Get list of Notifications

To retrieve a list of notification run the following command from a bash terminal:

curl -X GET https://mycompany.restcomm.com/restcomm/2012-04-24/Accounts/ACCOUNT_SID/Notifications.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 + '/Notifications.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 + '/Notifications.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 + "/Notifications.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()'
      ...
  }
}

Example GET Response

{"page":0,"num_pages":0,"page_size":50,"total":34,"start":"0","end":"34","uri":"/api/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Notifications.json","first_page_uri":"/api/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Notifications.json?Page=0&PageSize=50","previous_page_uri":"null","next_page_uri":"null","last_page_uri":"/api/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Notifications.json?Page=0&PageSize=50","notifications":
    [
      {
        "sid":"RF10000000000000000000000000000001",
        "date_created":"Fri, 30 Aug 2013 16:28:33 +0900",
        "date_updated":"Fri, 30 Aug 2013 16:28:33 +0900",
        "account_sid":"ACae6e420f425248d6a26948c17a9e2acf",
        "call_sid":"CA5EB00000000000000000000000000002",
        "api_version":"2012-04-24",
        "log":1,
        "error_code":0,
        "more_info":"wlparam:replace[text=“https://your_custom_domain.com/docs/visual-designer-workspace-upgrade”]",
        "message_text":"Workspace migration skipped in 2016-12-28 21:12:25.758",
        "message_date":"2013-08-30T16:28:33.403+09:00",
        "request_url":"/recordings/RE50675909d9c94acda36f0e119b6cb431.wav",
        "request_method":"request method",
        "request_variables":"request variable",
        "uri":"/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Notifications/NOb88ccff6c9e04f989de9415a555ad84d.json.json"}
      },
      ...
    ]
}

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 notifications that were issued 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 notifications that were issued 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.

ErrorCode

Only show notifications that returned this Error Code

RequestUrl

Only show notifications that have this RequestUrl

CallSid

Only show notifications that have been triggered from this CallSid

Filter using the CallSid parameter

The example below will only return Notifications triggered from a given call sid.

curl -X GET https://mycompany.restcomm.com/restcomm/2012-04-24/Accounts/ACCOUNT_SID/Notifications.json?CallSid=CA5EB00000000000000000000000000002  \
   -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 + '/Notifications.json?CallSid=CA5EB00000000000000000000000000002',
      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 + '/Notifications.json?CallSid=CA5EB00000000000000000000000000002',
      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 + "/Notifications.json?CallSid=CA5EB00000000000000000000000000002");
      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":19,"start":"0","end":"19","uri":"/api/2012-04-24/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications.json","first_page_uri":"/restcomm/2012-04-24/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications.json?Page=0&PageSize=50","previous_page_uri":"null","next_page_uri":"null","last_page_uri":"/restcomm/2012-04-24/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications.json?Page=0&PageSize=50","notifications":
    [
      {
        "sid":"RF10000000000000000000000000000001",
        "date_created":"Fri, 30 Aug 2013 16:28:33 +0900",
        "date_updated":"Fri, 30 Aug 2013 16:28:33 +0900",
        "account_sid":"ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        "call_sid":"CA5EB00000000000000000000000000002",
        "api_version":"2012-04-24",
        "log":1,
        "error_code":1,
        "message_text":"Workspace migration skipped in 2016-12-28 21:12:25.758",
        "message_date":"2013-08-30T16:28:33.403+09:00",
        "request_url":"/recordings/RE50675909d9c94acda36f0e119b6cb431.wav",
        "request_method":"request method",
        "request_variables":"request variable",
        "uri":"/2012-04-24/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications/NOb88ccff6c9e04f989de9415a555ad84d.json"}
      },
      ...
    ]
}

Filter using the ErrorCode parameter

The example below will only return Messages sent from client Alice.

curl -X GET https://mycompany.restcomm.com/restcomm/2012-04-24/Accounts/ACCOUNT_SID/Notifications.json?ErrorCode=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 + '/Notifications.json?ErrorCode=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 + '/Notifications.json?ErrorCode=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 + "/Notifications.json?ErrorCode=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 will be similar to the one below

{"page":0,"num_pages":0,"page_size":50,"total":19,"start":"0","end":"19","uri":"/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Notifications.json","first_page_uri":"/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Notifications.json?Page=0&PageSize=50","previous_page_uri":"null","next_page_uri":"null","last_page_uri":"/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Notifications.json?Page=0&PageSize=50","notifications":
    [
      {
        "sid":"RF10000000000000000000000000000001",
        "date_created":"Fri, 30 Aug 2013 16:28:33 +0900",
        "date_updated":"Fri, 30 Aug 2013 16:28:33 +0900",
        "account_sid":"ACae6e420f425248d6a26948c17a9e2acf",
        "call_sid":"CA5EB00000000000000000000000000002",
        "api_version":"2012-04-24",
        "log":1,
        "error_code":1,
        "message_text":"Workspace migration skipped in 2016-12-28 21:12:25.758",
        "message_date":"2013-08-30T16:28:33.403+09:00",
        "request_url":"/recordings/RE50675909d9c94acda36f0e119b6cb431.wav",
        "request_method":"request method",
        "request_variables":"request variable",
        "uri":"/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Notifications/NOb88ccff6c9e04f989de9415a555ad84d.json.json"}
      },
      ...
    ]
}

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 notifications using the PageSize parameter

curl -X GET https://mycompany.restcomm.com/restcomm/2012-04-24/Accounts/ACCOUNT_SID/Notifications.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 + '/Notifications.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 + '/Notifications.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 + "/Notifications.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/Notifications",
    "first_page_uri": "/restcomm/2012-04-24/Accounts/ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/Notifications?Page=0&PageSize=1&Limit=10000",
    "previous_page_uri": "null",
    "next_page_uri": "null",
    "last_page_uri": "/restcomm/2012-04-24/Accounts/ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/Notifications?Page=0&PageSize=1&Limit=10000",
    "notifications": [{
        "sid": "NO10000000000000000000000000000024",
        "date_created": "Wed, 30 Oct 2013 16:28:33 +0200",
        "date_updated": "Wed, 30 Oct 2013 16:28:33 +0200",
        "account_sid": "ACae6e420f425248d6a26948c17a9e2acf",
        "call_sid": "CA5EB00000000000000000000000000002",
        "api_version": "2012-04-24",
        "log": 1,
        "error_code": 1,
        "more_info": "http://yourdomain.com/rvd-workspace-upgrade",
        "message_text": "Welcome",
        "message_date": "2013-08-30T16:28:33.403+03:00",
        "request_url": "http://instance1.restcomm.com:8080/restcomm/recordings/RE50675909d9c94acda36f0e119b6cb432.wav",
        "request_method": "request method",
        "request_variables": "request variable",
        "uri": "/2012-04-24/Accounts/ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/Notifications/NOb88ccff6c9e04f989de9415a555ad84d.json.json"
    }]
}

The command below, uses Limit parameter to return a list of 500 records in total.

curl -X GET https://mycompany.restcomm.com/restcomm/2012-04-24/Accounts/ACCOUNT_SID/Notifications.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 + '/Notifications.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 + '/Notifications.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 + "/Notifications.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/Notifications",
    "first_page_uri": "/restcomm/2012-04-24/Accounts/ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/Notifications?Page=0&PageSize=1&Limit=500",
    "previous_page_uri": "null",
    "next_page_uri": "null",
    "last_page_uri": "/restcomm/2012-04-24/Accounts/ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/Notifications?Page=0&PageSize=1&Limit=500",
    "notifications": [{
        "sid": "NO10000000000000000000000000000024",
        "date_created": "Wed, 30 Oct 2013 16:28:33 +0200",
        "date_updated": "Wed, 30 Oct 2013 16:28:33 +0200",
        "account_sid": "ACae6e420f425248d6a26948c17a9e2acf",
        "call_sid": "CA5EB00000000000000000000000000002",
        "api_version": "2012-04-24",
        "log": 1,
        "error_code": 1,
        "more_info": "http://yourdomain.com/rvd-workspace-upgrade",
        "message_text": "Welcome",
        "message_date": "2013-08-30T16:28:33.403+03:00",
        "request_url": "http://instance1.restcomm.com:8080/restcomm/recordings/RE50675909d9c94acda36f0e119b6cb432.wav",
        "request_method": "request method",
        "request_variables": "request variable",
        "uri": "/2012-04-24/Accounts/ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/Notifications/NOb88ccff6c9e04f989de9415a555ad84d.json.json"
    }]
}

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 notifications 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 the date the notification was created

Log

Sort by the severity level of the notification

ErrorCode

Sort by the error code of the notification

CallSid

Sort by the CallSid of the notification, if related to a call

MessageText

Sort by the message text of the notification

Example

The command below will return notifications 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/Notifications.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 + '/Notifications.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 + '/Notifications.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 + "/Notifications.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": 637,
  "start": "0",
  "end": "49",
  "uri": "/restcomm/2012-04-24/Accounts/AC61148eb9d61281750ccc0e13c6094fe1/Notifications",
  "first_page_uri": "/restcomm/2012-04-24/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications?Page=0&PageSize=50",
  "previous_page_uri": "null",
  "next_page_uri": "/restcomm/2012-04-24/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications?Page=1&PageSize=50&AfterSid=NOcc9ee681130b49a6b21d45b61a599372",
  "last_page_uri": "/restcomm/2012-04-24/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications?Page=12&PageSize=50",
  "notifications": [
    {
      "sid": "NO93222c00d9db49349e9ebbd3d5b0f8a6",
      "date_created": "Wed, 30 Mar 2016 08:51:58 +0000",
      "date_updated": "Wed, 30 Mar 2016 08:51:58 +0000",
      "account_sid": "AC61148eb9d61281750ccc0e13c6094fe1",
      "api_version": "2012-04-24",
      "log": 0,
      "error_code": 11005,
      "more_info": "/restcomm/errors/11005.html",
      "message_text": "The system cannot process this call because the destination number 441143597623 cannot be found or there is application attached to that",
      "message_date": "2016-03-30T08:51:58.000Z",
      "request_url": "",
      "request_method": "",
      "request_variables": "",
      "uri": "/2012-04-24/Accounts/AC61148eb9d61281750ccc0e13c6094fe1/Notifications/NO93222c00d9db49349e9ebbd3d5b0f8a6.json"
    },
    {
      "sid": "NOfbfadc468f204d7c821460f47786c05e",
      "date_created": "Wed, 30 Mar 2016 09:10:18 +0000",
      "date_updated": "Wed, 30 Mar 2016 09:10:18 +0000",
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "api_version": "2012-04-24",
      "log": 0,
      "error_code": 11005,
      "more_info": "/restcomm/errors/11005.html",
      "message_text": "The system cannot process this call because the destination number +17125255552 cannot be found or there is application attached to that",
      "message_date": "2016-03-30T09:10:18.000Z",
      "request_url": "",
      "request_method": "",
      "request_variables": "",
      "uri": "/2012-04-24/Accounts/AC61148eb9d61281750ccc0e13c6094fe1/Notifications/NOfbfadc468f204d7c821460f47786c05e.json"
    },
    {
      "sid": "NOace4dc522a1745b6a98801fee5ae2901",
      "date_created": "Wed, 30 Mar 2016 09:14:43 +0000",
      "date_updated": "Wed, 30 Mar 2016 09:14:43 +0000",
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "api_version": "2012-04-24",
      "log": 0,
      "error_code": 11005,
      "more_info": "/restcomm/errors/11005.html",
      "message_text": "The system cannot process this call because the destination number +1221 cannot be found or there is application attached to that",
      "message_date": "2016-03-30T09:14:43.000Z",
      "request_url": "",
      "request_method": "",
      "request_variables": "",
      "uri": "/2012-04-24/Accounts/AC61148eb9d61281750ccc0e13c6094fe1/Notifications/NOace4dc522a1745b6a98801fee5ae2901.json"
    }
  ]
}
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.