Register a push notification device
POST
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
- Get the device's FCM registration token from Firebase in your app after the user signs in.
- Send the token, the platform and optionally your app version; send it again whenever the token changes.
- 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.
BearerAuthheader
AuthorizationBearer <JWT>application/json- body
token*stringFirebase Cloud Messaging (FCM) registration token issued to the app on this device. Required.
platform*stringDevice platform: ANDROID, IOS or WEB. Required.
Value in
"ANDROID""IOS""WEB"appVersion?|Version of your app on the device. Optional, stored for reference.
OK
*/*- response
status*stringOutcome of the call: SUCCESS when the request worked, ERROR when it did not.
message*stringShort 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" }}