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 |
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'
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 |
EndTime |
Only show notifications that were issued on this date/time or earlier, given as an ISO-8601 date/time string, like |
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'
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'
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'
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'
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:
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'
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" } ] }