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
Name | Type | Description |
---|---|---|
EID | EID | Unique entity identifier |
alertType | string | Alert type |
appData | string | Since 1.0.10 Optional string of additional data, to be provided by the app sending the alert |
category | string | Since 1.0.2 Read-only admin or user |
body | object | Localized body |
body.<locale> | string | Body text in the language of the RFC 5646/4647 <locale> |
created | datetime | Read-only Date the message was created (ISO 8601 compliant) |
numCoalesced | integer | Since 1.0.11 Read-only The number of alerts that have been coalesced into a single alert |
numGroups | integer | Since 1.0.24 Read-only The number of unique groups related to the alert |
numOriginators | integer | Since 1.0.16 Read-only The number of unique users that triggered the alert |
read | boolean | Read-only Whether the logged in user has read the alert |
type | string | “alert” |
Links
Relation | Resource | Description |
---|---|---|
app | app | The app that generated the alert (optional) |
comment | message | The new comment or follow-up comment (optional) |
group | group | The group relevant to the alert (optional) |
groups | group | Since 1.0.24 The groups relevant to the alert (optional) |
message | message | The message relevant to the alert (optional) |
originators | user | Since 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"
}