Notifications
Notifications
A Notification resource represents a single log entry made by Restcomm 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 Restcomm 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 Restcomm 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
JSON GET Response
curl -X GET https://mycompany.restcomm.com/restcomm/2012-04-24/Accounts/ACCOUNT_SID/Notifications.json \
-u 'YourAccountSid:YourAuthToken'
{"page":0,"num_pages":0,"page_size":50,"total":34,"start":"0","end":"34","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":0,
"more_info":"http://restcomm.com/docs/rvd-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 |
MessageText |
Only show notifications that contain this MessageText. |
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
PParameter | Description |
---|---|
Page |
The current page number. Zero-indexed, so the first page is 0. |
PageSize |
How many items are in each page |
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":34,"page_size":1,"total":34,"start":"0","end":"0","uri":"/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Notifications.json","first_page_uri":"/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Notifications.json?Page=0&PageSize=1","previous_page_uri":"null","next_page_uri":"/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Notifications.json?Page=1&PageSize=1&AfterSid=RF10000000000000000000000000000001","last_page_uri":"/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Notifications.json?Page=34&PageSize=1","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,
"more_info":"http://restcomm.com/docs/rvd-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"}
}
]
}
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. |
NumPages |
The total number of pages. |
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. |
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 |