Previous Topic: URI https://localhost:8443/apwebsvc/notificationsNext Topic: OPTIONS notifications


GET notifications

Get a list of AP notifications. Notification IDs are returned in order from the oldest notification to the latest notification, unless the request is altered by one or more query options.

Query Options

These HTTP query strings can be added to the URI to control the volume and order of returned URIs. Most query options represent properties of the object that are returned in the reply document. To see the definitions of those properties, you can read the schema documentation for the reply document.

AnswerableBy=

An NM Contact name that is allowed to answer the notification.

IssuedBy=

Name of the NM login that issued the notification.

Status=

Can specify one of these statuses for notification: Initializing, Sending, Sent, AwaitingResponse, NoResponse, Responded, LateResponse, or Failed.

FromTime=

A timestamp specifying the time in seconds elapsed since midnight Coordinated Universal Time (UTC), January 1, 1970. Only notifications that occurred at the specified time or later are returned. An error occurs when specifying a value that is larger than the value of the ToTime query option, when FromTime and ToTime are specified.

ToTime=

A timestamp specifying the time in seconds elapsed since midnight Coordinated Universal Time (UTC), January 1, 1970. Only notifications that occurred at the specified time or sooner are returned. An error occurs when specifying a value that is smaller than the value of the FromTime query option, when FromTime and ToTime are specified.

AfterId=

Specifies a notification ID after which you want to retrieve notifications. Only notifications that occurred after AfterId are returned. The last notification ID returned in a previous GET request can be used as the AfterId in your next GET request.

If the special value 0 is specified for AfterId, the GET method returns the last (most recent) notification ID. Since only one notification ID can be returned in this case, a Count option specified in the same request is ignored.

 Count=

Maximum number of notification IDs to be returned in this request. The highest value that can be set for this option is 100000. When this option is not specified, a default value of 10000 is used. When fewer notifications than Count are available, the Count value returned in the reply document specifies the actual number of notifications returned.

Example1:

This pseudo code continuously retrieves notifications that arrive after your first GET operation. This code also limits the number of notifications that are retrieved to 10 at a time.

LastIdOfOurPreviousGet = 0
while ( YouWantToContinue )
{
    GET .../notifications?AfterId=LastIdOfOurPreviousGet&Count=10
    If  ( our reply contains notification IDs )
    {
        Do something with the retrieved notification IDs
        LastIdOfOurPreviousGet = last ID from our reply
    }
    Sleep a little while
}  
Example2:

This pseudo code gets all notifications that occurred starting at 9:00 AM this morning and stop when the last notification is reached.

GET .../notifications?FromTime=TimeFor9:00AMToday&Count=10
While ( the number retrieved > 0 )
{
    Do something with the retrieved notification IDs
    LastIdOfOurPreviousGet = last ID from our reply
    If ( number retrieved < 10 )
        break
    GET .../notifications?AfterId=LastIdOfOurPreviousGet&Count=10
}
Request Document

None

HTTP Request Headers
Authorization

Supply a user ID and password in the HTTP Basic Authentication format. The user ID must be an NM Login.

HTTP Response Headers
Status

Successful result = 200 = Ok

Successful Reply Document

NotificationList in schema NotificationList.xsd

The reply contains a list of identifiers for existing notification requests. This reply includes the URIs used to access those notifications, for example:

http://localhost:8080/apwebsvc/notifications/notificationId1,
http://localhost:8080/apwebsvc/notifications/notificationId2,
and so on.

When the user has the View All Notifications privilege, the list contains every notification. Otherwise the user retrieves only those notifications for which the user was directly involved with the notification. Specifically, the user sent the notification, the user was the intended recipient, or the user was notified during the escalation process.