Register a push token
const url = 'https://work.optidata.cloud/api/notifications/mobile';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"push_notification_token":"ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://work.optidata.cloud/api/notifications/mobile \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "push_notification_token": "ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]" }'Binds a push-notification token to the calling user. Any token previously
registered by that user is deactivated first, so one user has at most one
active device token. Send either push_notification_token or the legacy
expo_token.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Required unless expo_token is sent.
Legacy alias of push_notification_token.
Responses
Section titled “ Responses ”The token is registered.
Minimal acknowledgement returned by several write operations.
object
Example
{ "success": true}Missing, malformed or expired authentication key.
Authentication failures use an error key rather than message.
object
Examples
No bearer token sent
{ "error": "JWT passport exception: Missing bearer token in request"}The request body or query string failed validation.
object
The first validation message.
Validation messages keyed by field name.
object
Examples
{ "message": "The name field is required.", "errors": { "name": [ "The name field is required." ] }}Rate limit exceeded. Retry after the window resets.
Generic error envelope used by policy, binding and framework failures.
object
Human-readable description of the failure.
Examples
{ "message": "Too Many Attempts."}