Manage device registrations (v1)

List/Add/Remove registrations for device.

Returns array with two elements:

  • Array Element 0 - Integer – 1 or 0, where 1 is success, and 0 is error.
  • Array Element 1 - String – Description of the success or error, if available. e.g "Modified Channels"

You can mix the addition and removal operations. They will be executed in the following order:

  1. Channels passed in the remove will be removed from the registrations list for the device.
  2. Channels passed in the add will be added to the registrations list for the device.
Path Parameters
sub_key string REQUIRED

Your app's subscribe key from Admin Portal.

push_token string REQUIRED

Push token of the device.

Example: A332C23D

Query Parameters
add string REQUIRED

List of channels for the device's inclusion in push registration. By using comma delimiters, multiple channels can be added e.g. (ch1, ch2, ch3), resulting in the addition of three channels.

Example: myChannel

remove string REQUIRED

Name of the channel for which the device will no longer recieve push notifications. By using comma delimiters, multiple channels can be added e.g. (ch1, ch2, ch3), resulting in the removal of three channels.

Example: myChannel

type string REQUIRED

Possible values: [apns, fcm]

Backend indicator (apns for Apple, fcm for Google)

Example: apns

start string

Starting channel for pagination. Use the last channel from the previous page request.

count integer

Number of channels to return for pagination. Max of 1000 tokens at a time. Defaults to 500.

uuid string REQUIRED

A UTF-8 encoded string of up to 92 characters used to identify the client.

Example: myUniqueUserId

signature string

Signature used to verify that the request was signed with the secret key associated with the subscriber key.

If Access Manager is enabled, either a valid authorization token or a signature are required.

See Access Manager documentation for details on how to compute the signature.

timestamp integer

Unix epoch timestamp used as a nonce for signature computation. Must have no more than ± 60 seconds offset from NTP.

Required if signature parameter is supplied.

Responses
200

OK

Schema OPTIONAL
undefined[]
400

Bad Request

Schema OPTIONAL
undefined
403

Not Enabled

Schema OPTIONAL
error string OPTIONAL
500

Server Error

Schema OPTIONAL
error string OPTIONAL
503

Service Unavailable

Schema OPTIONAL
error string OPTIONAL
* required
sub_key*
Type: string
Your app's subscribe key from Admin Portal.
push_token*
Type: string
Push token of the device.
* required
add*
Type: string
List of channels for the device's inclusion in push registration. By using comma delimiters, multiple channels can be added e.g. (ch1, ch2, ch3), resulting in the addition of three channels.
remove*
Type: string
Name of the channel for which the device will no longer recieve push notifications. By using comma delimiters, multiple channels can be added e.g. (ch1, ch2, ch3), resulting in the removal of three channels.
type*
Type: string
Backend indicator (apns for Apple, fcm for Google)
start
Type: string
Starting channel for pagination. Use the last channel from the previous page request.
count
Type: integer
Number of channels to return for pagination. Max of 1000 tokens at a time. Defaults to 500.
uuid*
Type: string
A UTF-8 encoded string of up to 92 characters used to identify the client.
signature
Type: string
Signature used to verify that the request was signed with the secret key associated with the subscriber key.

If Access Manager is enabled, either a valid authorization token or a signature are required.

See Access Manager documentation for details on how to compute the signature.
timestamp
Type: integer
Unix epoch timestamp used as a nonce for signature computation. Must have no more than ± 60 seconds offset from NTP.

Required if signature parameter is supplied.
message
Type: string
Example: "Invalid Subscribe Key"
error
Type: boolean
Example: true
service
Type: string
Example: "Access Manager"
status
Type: integer
Example: 400
error
Type: string
Example: "Use of the mobile push notifications API requires Push Notifications which is not enabled for this subscribe key. Login to your PubNub Dashboard Account and enable Push Notifications. Contact support@pubnub.com if you require further assistance."
error
Type: string
Example: "Internal Server Error"
error
Type: string
Example: "Failed to retrieve account configuration"