GET /api/users/{UserID}/notifications

Returns unarchived notifications for the specified user.

Authorization Roles/Permissions: Must be logged in. Self (logged in) or Site Admin (for any user).

This topic includes the following sections:

HTTP Method

GET

Back to top

URL

https://{hostname}/api/users/{UserID}/notifications

Back to top

Sample Request

The example below requests the notifications for user10057.

Request URL

https://{hostname}/api/users/2d0bc425-49ec-4c04-b272-cc8f6f20e52b.acmepaymentscorp/notifications

Sample request headers

GET /api/users/2d0bc425-49ec-4c04-b272-cc8f6f20e52b.acmepaymentscorp/notifications?_=1368713248785 HTTP/1.1
Host: {hostname}
Accept: application/json, text/javascript, */*; q=0.01

Sample request body

Not applicable.

Back to top

Request Headers

For general information on request header values, refer to HTTP Request Headers.

Header Description
Accept

application/json, text/xml

application/vnd.soa.v71+json, application/vnd.soa.v71+xml

application/vnd.soa.v72+json, application/vnd.soa.v72+xml

application/vnd.soa.v80+json, application/vnd.soa.v80+xml

application/vnd.soa.v81+json, application/vnd.soa.v81+xml

X-Csrf-Token_{fedmemberID} The CSRF prevention header; may or may not be required, depending on platform settings. See CSRF Prevention on the Platform. By default, the CSRF header is not required for GET operations and is required for all others, with a few exceptions relating to user login.

Back to top

Request Parameters

Parameter Parm Type Data Type Required Description
UserID Path string Required The unique ID for a specific user.
start Query integer Optional An index number indicating the starting point for the results to be returned. If not specified, results start at position 0, the first result.
count Query integer Optional The number of results to be returned, from the specified starting point. If not specified, all matching results are returned.

Back to top

Response

If successful, this operation returns HTTP status code 200, with information about the user's notifications in an RSS channel formatted as JSON or XML.

Back to top

Sample Response

The sample response below shows six notifications returned.

Sample response headers

HTTP/1.1 200 OK
Content-Type: application/json
Date: Thu, 16 May 2013 14:07:29 GMT

Sample response body: application/json

{
  "channel" : {
    "title" : "User Notifications",
    "description" : "",
    "startIndex" : 0,
    "totalResults" : 9,
    "itemsPerPage" : 9,
    "item" : [ {
      "title" : "ACME Payments API UG",
      "description" : "JonathanSwift has accepted the group membership invitation.",
      "category" : [ {
        "value" : "com.soa.notification.type.group.membership.accepted",
        "domain" : "uddi:soa.com:resourcetype"
      } ],
      "guid" : {
        "value" : "notification29192.acmepaymentscorp"
      },
      "pubDate" : "Thu, 21 Feb 2013 22:03:27 +0000",
      "EntityReferences" : {
        "EntityReference" : [ {
          "Title" : "group_member_req19795.acmepaymentscorp",
          "Guid" : "group_member_req19795.acmepaymentscorp",
          "Category" : [ {
            "value" : "board-item",
            "domain" : "uddi:soa.com:resourcetype"
          } ]
        } ]
      }
    }, {
      "title" : "Test API",
      "description" : "Production access requested for PaaStime",
      "category" : [ {
        "value" : "com.soa.notification.type.api.access.requested.production.appteam",
        "domain" : "uddi:soa.com:resourcetype"
      } ],
      "guid" : {
        "value" : "notification28420.acmepaymentscorp"
      },
      "pubDate" : "Mon, 31 Dec 2012 19:34:21 +0000",
      "EntityReferences" : {
        "EntityReference" : [ {
          "Title" : "contract_request18676.acmepaymentscorp",
          "Guid" : "contract_request18676.acmepaymentscorp",
          "Category" : [ {
            "value" : "board-item",
            "domain" : "uddi:soa.com:resourcetype"
          } ]
        } ]
      }
    }, {
      "title" : "PaaStime",
      "description" : "App Team invitation accepted by PhilipPirrip",
      "category" : [ {
        "value" : "com.soa.notification.type.appteam.membership.accepted",
        "domain" : "uddi:soa.com:resourcetype"
      } ],
      "guid" : {
        "value" : "notification28149.acmepaymentscorp"
      },
      "pubDate" : "Fri, 14 Dec 2012 21:03:10 +0000",
      "EntityReferences" : {
        "EntityReference" : [ {
          "Title" : "group_member_req17577.acmepaymentscorp",
          "Guid" : "group_member_req17577.acmepaymentscorp",
          "Category" : [ {
            "value" : "board-item",
            "domain" : "uddi:soa.com:resourcetype"
          } ]
        } ]
      }
    }, {
      "title" : "PaaStime",
      "description" : "JaneSaoirse has invited you to join an App Team",
      "category" : [ {
        "value" : "com.soa.notification.type.appteam.member.invited.invitee",
        "domain" : "uddi:soa.com:resourcetype"
      } ],
      "guid" : {
        "value" : "notification17578.acmepaymentscorp"
      },
      "pubDate" : "Mon, 26 Nov 2012 15:20:32 +0000",
      "EntityReferences" : {
        "EntityReference" : [ {
          "Title" : "group_member_req17577.acmepaymentscorp",
          "Guid" : "group_member_req17577.acmepaymentscorp",
          "Category" : [ {
            "value" : "board-item",
            "domain" : "uddi:soa.com:resourcetype"
          } ]
        } ]
      }
    }, {
      "title" : "Crosfhocal01",
      "description" : "App deleted",
      "category" : [ {
        "value" : "com.soa.notification.type.app.deleted",
        "domain" : "uddi:soa.com:resourcetype"
      } ],
      "guid" : {
        "value" : "notification14009.acmepaymentscorp"
      },
      "pubDate" : "Thu, 27 Sep 2012 21:30:36 +0000"
    }, {
      "title" : "Welcome to acmepaymentscorp",
      "description" : "Notification panel will show you the latest posts, alerts, requests and ticket updates since your last login.",
      "category" : [ {
        "value" : "com.soa.notification.type.welcome",
        "domain" : "uddi:soa.com:resourcetype"
      } ],
      "guid" : {
        "value" : "notification13999.acmepaymentscorp"
      },
      "pubDate" : "Thu, 27 Sep 2012 21:19:34 +0000",
      "EntityReferences" : {
        "EntityReference" : [ {
          "Title" : "2d0bc425-49ec-4c04-b272-cc8f6f20e52b.acmepaymentscorp",
          "Guid" : "2d0bc425-49ec-4c04-b272-cc8f6f20e52b.acmepaymentscorp",
          "Category" : [ {
            "value" : "board-item",
            "domain" : "uddi:soa.com:resourcetype"
          } ]
        } ]
      }
    } ]
  },
  "version" : "1.0"
}

Back to top

Response Headers

For general information on response header values, refer to HTTP Response Headers.

Header Description
Content-Type

application/json, text/xml

application/vnd.soa.v71+json, application/vnd.soa.v71+xml

application/vnd.soa.v72+json, application/vnd.soa.v72+xml

application/vnd.soa.v80+json, application/vnd.soa.v80+xml

application/vnd.soa.v81+json, application/vnd.soa.v81+xml

Back to top

Response Body

The response body is in the form of an RSS channel, and includes the items listed below. The RSS version is 1.0. The title of the RSS Channel is User Notifications, and the channel includes a description and paging values: StartIndex, TotalResults, and ItemsPerPage. Each item in the RSS channel represents a notification, and includes the information below.

Name Description
title The text title of the notification.
description Descriptive text for the notification.
category[ ]

An array of sets of two name/value pairs, each including Value and Domain, with a value for each. For example:

"value" : "com.soa.notification.type.group.membership.accepted",
"domain" : "uddi:soa.com:resourcetype";

The example above indicates the notification type.

GUID GUID for the notification.
pubdate The date/timestamp when the information was generated.
Entity reference

An array of one or more entity references for the Board item. Each includes:

  • Title
  • GUID
  • Category[ ]: an array of sets of two name/value pairs, each including Value and Domain, with a value for each.

Back to top

Error Codes/Messages

If the call is unsuccessful an error code/message is returned. One or more examples of possible errors for this operation are shown below.

Item Value
401

Unauthorized. For example, you would get this response if you didn't include the custom X-Csrf-Token_{fedmemberID} header in the request, when it was required by the platform settings; or if you included an invalid or expired value for this header. You would also get this response for any operation that requires login (almost all) if the login cookie was missing.

You would also get this response if you hadn't completed login before running the operation, or if you had the wrong UserID.

500 An error occurred processing the call.

More information about Akana API Platform API error messages.

Back to top

Related Topics