Перейти к основному содержимому

Send Notification To All API

POST /sendNotificationToAll

Description

This API endpoint allows sending a notification to all devices. The notification includes a subject and content.

Request Body

The request utilizes GraphQL to perform the sendNotificationToAll mutation.

Mutation:

mutation sendNotificationToAll ($notification: NotificationInput!) {
sendNotificationToAll (notification: $notification) {
status
message
}
}

Variables:

{
"notification": {
"subject": "<Notification_Subject>",
"content": "<Notification_Content>"
}
}
  • notification (NotificationInput):
    • subject (String): The subject of the notification.
    • content (String): The content or message of the notification.

Response:

  • Success (200 OK):

    • The response indicates the status of the notification sending operation to all devices, along with a message.
    {
    "data": {
    "sendNotificationToAll": {
    "status": "<Status>",
    "message": "<Message>"
    }
    }
    }
  • Error (4XX/5XX):

    • If there is an issue with sending the notification, such as an issue with the notification content or server errors, the response will include an appropriate error message and status code.

Note:

Ensure that the notification content is correctly formatted. The response will confirm whether the notification was successfully sent to all devices.