Notification Resource

Current version: 3.3

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, and POST.

GET /api/notifications

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

Example Request:

RequestResponse
GET http://hostname/api/notifications
Host: hostname
Accept: application/json

Example Response:

RequestResponse
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
}

POST /api/entities

Creates a custom notification entity. The superuser can then fill the properties of the custom template through the user interface within the instance.

Example Request:

The following example creates a custom email template.

RequestResponse
POST https://hostname/api/entities
{
    "identifier": "M.Mailing.Template.DY.CRFCreated",
    "cultures": [
        "en-US"
    ],
    "properties": {
        "M.Mailing.TemplateName": "DYCRFCreated",
        "M.Mailing.TemplateLabel": {
            "en-US": "CRF Created"
        },
        "M.Mailing.TemplateDescription": {
            "en-US": "Notifies the manager about the creation of a new CRF"
        }
    },
    "entitydefinition": {
        "href": "https://hostname/api/entitydefinitions/M.Mailing.Template",
        "title": "The entity definition for this entity"
    }
}

Do you have some feedback for us?

If you have suggestions for improving this article,