Alert Resource

An alert is a system to send user notification of a, for said user, relevant event. Be careful not to confuse alerts with change notifications.

Changelog

1.0.2
  • Added category property.
1.0.10
  • Added appData property.
1.0.11
  • Added authors relation.
  • Added numAuthors property.
  • Added numCoalesced property.
  • Deprecated author relation.
1.0.16
  • Renamed authors relation to originators.
  • Renamed numAuthors property to numOriginators.
1.0.24
  • Added groups relation.
  • Added numGroups property.
  • Added groups and originators endpoints.
1.3.8
  • Added XID field for recipient when creating alert

Endpoints

Representations

JSON

Properties

NameTypeDescription
EIDEIDUnique entity identifier
alertTypestringAlert type
appDatastringSince 1.0.10 Optional string of additional data, to be provided by the app sending the alert
categorystringSince 1.0.2 Read-only admin or user
bodyobjectLocalized body
body.<locale>stringBody text in the language of the RFC 5646/4647 <locale>
createddatetimeRead-only Date the message was created (ISO 8601 compliant)
numCoalescedintegerSince 1.0.11 Read-only The number of alerts that have been coalesced into a single alert
numGroupsintegerSince 1.0.24 Read-only The number of unique groups related to the alert
numOriginatorsintegerSince 1.0.16 Read-only The number of unique users that triggered the alert
readbooleanRead-only Whether the logged in user has read the alert
typestring“alert”
RelationResourceDescription
appappThe app that generated the alert (optional)
commentmessageThe new comment or follow-up comment (optional)
groupgroupThe group relevant to the alert (optional)
groupsgroupSince 1.0.24 The groups relevant to the alert (optional)
messagemessageThe message relevant to the alert (optional)
originatorsuserSince 1.0.16 Collection of users that triggered the alert. Coalesced alerts have multiple originators, regular alerts generally have one or zero. (optional)

Example

New Update on a user's profile timeline:

{
    "_links": {
        "self": {
            "href": "/networks/fedcba0987654321/alerts/1234567890abcdef/"
        },
        "message": {
            "href": "/networks/fedcba0987654321/messages/0123456789fedcba/"
        },
        "originators": [
            {
                "href": "/networks/fedcba0987654321/users/abcdef0123456789/"
            }
        ]
    },
    "EID": "1234567890abcdef",
    "alertType": "new_update_to_user",
    "category": "user",
    "created": "2013-04-12T17:10:10.123+01:00",
    "numOriginators": 1,
    "read": false,
    "type": "alert"
}

Membership request for a certain group:

{
    "_links": {
        "self": {
            "href": "/networks/fedcba0987654321/alerts/1234567890abcdef/"
        },
        "group": {
            "href": "/networks/fedcba0987654321/users/0123456789fedcba/"
        },
        "originators": [
            {
                "href": "/networks/fedcba0987654321/users/abcdef0123456789/"
            }
        ]
    },
    "EID": "1234567890abcdef",
    "alertType": "group_membership_request",
    "category": "admin",
    "created": "2013-11-04T14:14:10.123+01:00",
    "numOriginators": 1,
    "read": false,
    "type": "alert"
}