Skip to content

Device Registration

Once a user has opt'ed in to recieve push notifications, you can receive a device token via the Firebase sdk. Once you have the device token, you can submit it, along with the customerId (ENID) to the devices endpoint.

1
2
3
4
POST /customers/{customerId}/device-tokens
{
  "token": "cBD2VkZtVxnTnhcnFWnn5j:APA91bEycVJ0yk5JpD9u93zg04d2iOypW82sPmb....."
}

This will return an Id for the token added

1
2
3
4
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "token": "cBD2VkZtVxnTnhcnFWnn5j:APA91bEycVJ0yk5JpD9u93zg04d2iOypW82sPmb....."
}

If a user disables push notifications on the device, then you would need to delete the token so that system doesn't attempt to send a notification to the user.

DELETE /customers/{customerId}/device-tokens/{deviceTokenId}

Other calls are available to look up a customer's tokens:

GET /customers/{customerId}/device-tokens

if you know the device token id, you can use:

GET /customers/{customerId}/device-tokens/{deviceTokenId}