logo
logo

Notification Resource

Each notification in the system is represented by a Notification Resource. This resource can be used to retrieve and update the notifications.

The following methods are supported: GET, HEAD, PUT.

GET /api/notifications

Returns a Notifications Array that contains the notifications that apply for this user.

Example Request:

GET http://<hostname>/api/notifications
Host: hostname
Accept: application/json

Example Response:

HTTP/1.1 200 OK
Content-Length: content length
Content-Type: application/json; charset=utf-8
ETag: "hash string"

{
    "items": [
        {
            "id": 16,
            "notificationtype": "SearchChanged",
            "notificationtypelabel": "Saved search results changed",
            "is_user_owned": false,
            "created_on": "2017-04-11T01:11:12.149588Z",
            "created_by": {
                "href": "https://stylelabs_example.com/api/entities/6",
                "title": "The user who created the entity"
            },
            "modified_on": "2017-04-11T01:11:12.149588Z",
            "modified_by": {
                "href": "https://stylelabs_example.com/api/entities/6",
                "title": "The user who last modified the entity"
            },
            "channels": [
                {
                    "channelname": "EmailNotification",
                    "is_checked": true
                },
                {
                    "channelname": "RealTimeNotification",
                    "is_checked": false
                }
            ],
            "UserId": 0,
            "self": {
                "href": "https://stylelabs_example.com/api/notifications",
                "title": "This Notification."
            }
        },
        {
            "id": 17,
            "notificationtype": "OrderCompleted",
            "notificationtypelabel": "Order completed",
            "is_user_owned": true,
            "created_on": "2017-04-11T01:11:12.2121017Z",
            "created_by": {
                "href": "https://stylelabs_example.com/api/entities/6",
                "title": "The user who created the entity"
            },
            "modified_on": "2017-04-11T01:11:12.2121017Z",
            "modified_by": {
                "href": "https://stylelabs_example.com/api/entities/6",
                "title": "The user who last modified the entity"
            },
            "channels": [
                {
                    "channelname": "EmailNotification",
                    "is_checked": true
                },
                {
                    "channelname": "RealTimeNotification",
                    "is_checked": true
                }
            ],
            "UserId": 0,
            "self": {
                "href": "https://stylelabs_example.com/api/notifications",
                "title": "This Notification."
            }
        },

        ...

    ],
    "total_items": 9
}

Can we improve this article ? Provide feedback