iotoms Docs

Send a broadcast notification

POST
/api/v1/notifications/broadcast

Pushes a notification with a title, body and optional deep link to chosen users (by username), every active user in a role, or every active user of the merchant. Recipients cannot opt out of these broadcasts. Returns how many users it was sent to.

How to use it

  1. Choose the target: type USERS with usernames from List users, ROLE with a role from List roles, or TENANT for everyone.
  2. Send a title, body and optional deepLink.
  3. The notification is delivered straight away and the response gives the recipient count.

Authorization

BearerAuth
headerAuthorizationBearer <JWT>

Request Body

application/json
  1. body
title*string

Notification headline. Required, must not be blank.

body*string

Notification message text. Required, must not be blank.

target*

Who receives it: specific users, everyone in a role, or every active user of the merchant.

deepLink?|

Optional in-app link opened when the recipient taps the notification.

Response Body

OK

*/*
  1. response
status*string

Outcome of the call: SUCCESS when the request was processed; otherwise an error status.

message*string

Short human-readable message describing the outcome, e.g. which record was saved or why the call failed.

data?

How many users the broadcast was sent to.

Example Request
curl -X POST 'https://beta.iotoms.com/api/v1/notifications/broadcast' \  -H 'Content-Type: application/json' \  -d '{  "title": "string",  "body": "string",  "target": {    "type": "USERS"  }}'
Example Response
{  "status": "string",  "message": "string",  "data": {    "recipientCount": 0  }}