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 https://localhost/restcomm.

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://ACae6e420f425248d6a26948c17a9e2acf:77f8c12cc7b8f8423e5c38b035249166@127.0.0.1:8080/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Notifications

Example GET Response

JSON GET Response

curl -X GET https://ACae6e420f425248d6a26948c17a9e2acf:77f8c12cc7b8f8423e5c38b035249166@127.0.0.1:8080/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Notifications.json
{"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://docs.telestax.com/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":"http://instance1.restcomm.com:8080/restcomm/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 started on this date, given as YYYY-MM-DD. Also supports inequalities, such as StartTime=YYYY-MM-DD for notifications that started at or before midnight on a date, and StartTime=YYYY-MM-DD for notifications that started at or after midnight on a date.

EndTime

Only show notifications that ended on this date, given as YYYY-MM-DD. Also supports inequalities, such as StartTime=YYYY-MM-DD for notifications that started at or before midnight on a date, and StartTime=YYYY-MM-DD for notifications that started at or after midnight on a date.

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  http://ACae6e420f425248d6a26948c17a9e2acf:77f8c12cc7b8f8423e5c38b035249166@127.0.0.1:8080/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Notifications.json?ErrorCode=1

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,
        "more_info":"http://docs.telestax.com/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":"http://instance1.restcomm.com:8080/restcomm/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.

NumPages

The total number of pages.

PageSize

How many items are in each page

Total

The total number of items in the list.

Start

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

End

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

 

Example.

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

curl -X GET  http://ACae6e420f425248d6a26948c17a9e2acf:77f8c12cc7b8f8423e5c38b035249166@127.0.0.1:8080/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Notifications.json?PageSize=1

The result of the PageSize parameter

{"page":0,"num_pages":34,"page_size":1,"total":34,"start":"0","end":"0","uri":"/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/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://docs.telestax.com/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":"http://instance1.restcomm.com:8080/restcomm/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.