Send Notification By Device ID API
POST /sendNotificationByDeviceId
Description
This API endpoint allows sending a notification to a specific device using its unique device ID. The notification includes a subject and content.
Request Body
The request utilizes GraphQL to perform the sendNotificationByDeviceId
mutation.
Mutation:
mutation sendNotificationByDeviceId ($deviceId: String!, $notification: NotificationInput!) {
sendNotificationByDeviceId (deviceId: $deviceId, notification: $notification) {
status
message
}
}
Variables:
{
"deviceId": "<Device_ID>",
"notification": {
"subject": "<Notification_Subject>",
"content": "<Notification_Content>"
}
}
- deviceId (String): The unique identifier for the device where the notification will be sent.
- 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, along with a message.
{
"data": {
"sendNotificationByDeviceId": {
"status": "<Status>",
"message": "<Message>"
}
}
} -
Error (4XX/5XX):
- If there is an issue with sending the notification, such as an invalid device ID or notification content, the response will include an appropriate error message and status code.
Note:
Ensure that the deviceId
is correct and the notification content is properly formatted. The response will confirm whether the notification was successfully sent.