Add Token Channel Link

Endpoint

POST /notifications/channels - adds a link between a notification token and a notification channel

Parameters

Parameter Parameter Type Data Type
api-key header string Required
Authorization header string Required
token query string required
channel_id query integer 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/channels \
  --header 'Authorization: Bearer AUTH_TOKEN' \
  --header 'api-key: API_KEY' \
  --data token=tjkdadh1jasdccmnzxhadadshgj \
  --data channel_id=1 

Response fields

A notification token with associated/linked notification channels.

  • id - integer
  • token - string
  • user_id - integer, user_id will be 0 for generic accounts
  • device_type - the device type for the token
  • channels - an array of notification channels, as below

A notification channel:

  • id - integer, id of notification channel
  • name - string, name of notification channel
  • active - integer (0/1), denotes if a notification channel is active
  • link_id - integer, the id of the link between the notification channel and the notification token, to be used for deletion of the link

Example response

{
	"data": {
		"id": 1,
		"token": "tjkdadh1jasdccmnzxhadadshgj",
		"user_id": 4,
		"device_type": "android",
		"channels": [
			{
				"id": 1,
				"name": "episodes",
				"active": 1,
				"link_id": 7
			}
		]
	}
}