Skip to main content
Version: v0.16

Push Notifications API Reference

API reference for the Push Notifications module.

Device Management​

Register Token​

POST /pushNotifications/token
Authorization: Bearer {userToken}

Request Body:

{
"token": "FCM_DEVICE_TOKEN",
"platform": "android"
}

Unregister Token​

DELETE /pushNotifications/token
Authorization: Bearer {userToken}

Topic Subscriptions​

Subscribe to Topic​

POST /pushNotifications/subscribe
Authorization: Bearer {userToken}

Request Body:

{
"topic": "news"
}

Unsubscribe from Topic​

POST /pushNotifications/unsubscribe
Authorization: Bearer {userToken}

Request Body:

{
"topic": "news"
}

Sending Notifications​

Send to User​

POST /admin/pushNotifications/send
masterkey: {masterKey}

Request Body:

{
"userId": "...",
"title": "Notification Title",
"body": "Notification message",
"data": {
"customKey": "customValue"
}
}

Send to Topic​

POST /admin/pushNotifications/sendToTopic
masterkey: {masterKey}

Request Body:

{
"topic": "news",
"title": "Breaking News",
"body": "Check out the latest update"
}

Send to Multiple Users​

POST /admin/pushNotifications/sendMany
masterkey: {masterKey}

Request Body:

{
"userIds": ["userId1", "userId2"],
"title": "Announcement",
"body": "New feature available"
}

Configuration​

Get Config​

GET /admin/pushNotifications/config
masterkey: {masterKey}

Update Config​

PUT /admin/pushNotifications/config
masterkey: {masterKey}