Theme
The Theme is the type of notification that the Push API is prepared to send.
Foreach Theme it is set a name in order to identify the notification and also contains the range of notification. There are 3 ranges of notifications: unicast, multicast and broadcast.
By default, all users will receive all notifications.
If users doesn't want to receive notifications, they can set its preferences in order to receive the notifications that they are interested in.
Routes
/theme
Creates a new theme or retrives the theme if it was created before.
| Params | Type | Required? | Description |
|---|---|---|---|
| name | string | true | Theme name. |
| range | string (unicast, multicast or broadcast) | true | Range of the notification. |
Response
{
"result": {
"id": 1,
"name": "user_follow",
"range": "broadcast"
}
}
/theme/:id
Gets the theme :id information.
No params expected.
Response
{
"result": {
"id": 1,
"name": "user_follow",
"range": "broadcast"
}
}
/theme/:id
Updates the theme :id information with the given one.
| Params | Type | Required? | Description |
|---|---|---|---|
| name | string | false | Name of the theme. |
| range | string | false | Range of the notification. |
Response
Update theme name user_follow to follow and unicast to broadcast.
{
"result": {
"id": 1,
"name": "follow",
"range": "broadcast"
}
}
/theme/:id
Deletes the given theme :id.
Response
{
"result": true
}
/themes
Retrives all the stored themes of the database.
No params expected.
Response
{
"result": [
{
"id": 1,
"name": "user_follow",
"range": "unicast"
},
{
"id": 2,
"name": "user_comment",
"range": "unicast"
},
{
"id": 3,
"name": "user_recommend",
"range": "unicast"
}
]
}
/themes/range/:range
Retrives all the themes registered with the given :range.
No params expected.
Response
Search by range *broadcast.
{
"result": [
{
"id": 5,
"name": "newsletter",
"range": "broadcast"
},
{
"id": 8,
"name": "global_updates",
"range": "broadcast"
}
]
}
/theme_name
Get the given theme information by name.
| Params | Type | Required? | Description |
|---|---|---|---|
| name | string | true | Theme name. |
Response
{
"result": {
"id": 4,
"name": "user_action",
"range": "broadcast"
}
}
Updated less than a minute ago
