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.

ParamsTypeRequired?Description
namestringtrueTheme name.
rangestring (unicast, multicast or broadcast)trueRange of the notification.

Response

{
    "result": {
        "id": 1,
        "name": "user_follow",
        "range": "broadcast"
    }
}

Back to Index

/theme/:id

πŸ“˜

Gets the theme :id information.

No params expected.

Response

{
    "result": {
        "id": 1,
        "name": "user_follow",
        "range": "broadcast"
    }
}

Back to Index

/theme/:id

πŸ“˜

Updates the theme :id information with the given one.

ParamsTypeRequired?Description
namestringfalseName of the theme.
rangestringfalseRange of the notification.

Response

πŸ‘

Update theme name user_follow to follow and unicast to broadcast.

{
    "result": {
        "id": 1,
        "name": "follow",
        "range": "broadcast"
    }
}

Back to Index

/theme/:id

πŸ“˜

Deletes the given theme :id.

Response

{
    "result": true
}

Back to Index

/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"
        }
    ]
}

Back to Index

/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"
        }
    ]
}

Back to Index

/theme_name

πŸ“˜

Get the given theme information by name.

ParamsTypeRequired?Description
namestringtrueTheme name.

Response

{
    "result": {
        "id": 4,
        "name": "user_action",
        "range": "broadcast"
    }
}

Back to Index