Add/Update Notification Token

Endpoint

POST /notifications - add/update a notification token

Parameters

Parameter Parameter Type Data Type
api-key header string Required
Authorization header string Required
device_type query string allowed values: web, android, huawei, ios required
token query string required

Error messages

  • invalid HTTP_API_KEY
  • Not authenticated

HTTP response codes:

  • 200 - Success
  • 401 - Unauthorized action

Example request

curl --request POST \
  --url https://api-dev.radiozu.ro/v1/notifications \
  --header 'Authorization: Bearer AUTH_TOKEN' \
  --header 'api-key: API_KEY' \
  --data token=tjkdadh1jasdccmnzxhadadshgj \
  --data device_type=android

Response fields

A notification token object

  • id - integer
  • token - string
  • user_id - integer, user_id will be 0 for generic accounts
  • device_type - the device type for the token

Example response

{
    "data": {
        "id": 1,
        "token": "tjkdadh1jasdccmnzxhadadshgj",
        "user_id": 4,
        "device_type": "android"
    }
}