iotoms Docs

Register a push notification device

POST
/api/v1/notifications/tokens

Registers or refreshes a device's push notification (FCM) token for the signed-in user so the device can receive notifications.

How to use it

  1. Get the device's FCM registration token from Firebase in your app after the user signs in.
  2. Send the token, the platform and optionally your app version; send it again whenever the token changes.
  3. The token is linked to the signed-in user; re-sending a known token re-links it to the current user instead of creating a duplicate.

Authorization

BearerAuth
headerAuthorizationBearer <JWT>

Header Parameters

Request Body

application/json
  1. body
token*string

Firebase Cloud Messaging (FCM) registration token issued to the app on this device. Required.

platform*string

Device platform: ANDROID, IOS or WEB. Required.

Value in"ANDROID""IOS""WEB"
appVersion?|

Version of your app on the device. Optional, stored for reference.

Response Body

OK

*/*
  1. response
status*string

Outcome of the call: SUCCESS when the request worked, ERROR when it did not.

message*string

Short human-readable message describing the result, for logs or display; do not parse it.

data?

The stored device registration (its ID).

Example Request
curl -X POST 'https://beta.iotoms.com/api/v1/notifications/tokens' \  -H 'Content-Type: application/json' \  -d '{  "token": "string",  "platform": "ANDROID"}'
Example Response
{  "status": "string",  "message": "string",  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"  }}