API Reference
Before you interact with the API you need to have an account to create your first notifications channel and get the channel api key.
The most important endpoints are the Subscriptions code and the Send notification, those are the minimum necessary to work with API.
We recommend sending a notification to a user that already has subscribed to the notification channel, otherwise, the API returns 404 (subscription not found).
Subscriptions code
Return the subscription code to display to your clients to subscribe the notifications channel. It returns the code plus the QR-Code image in base64.
/channels/{channelId}/subscriptions/{iuid}/code
- Name
- Description
X-CHANNEL-API-KEY
string
required
- Channel api key, you can get it from the channel view in our system.
- Code
- Description
200
application/json
Subscription QR code to display to your clients on your frontend. Note that some extra information has also been sent. We also provide the plan code and the deep link (universal link), which can be useful if you prefer to send the code by email.
{ "code": "ds88cax...", "qrcode": "data:image/gif;base64,R0...", "deepLink": "https://bnotify.io/qrcode/ds88cax...", "appUrl": "https://bnotify.io/mobile" }
400
application/json
If the channel Id not valid
{ "statusCode": 400, "message": "Channel id not valid", "error": "Bad Request" }
401
application/json
Channel api key is not valid, make sure the key "X-CHANNEL-API-KEY" is present in the headers request.
{ "statusCode": 401, "message": "Channel api key is no valid.", "error": "Unauthorized" }
404
application/json
Channel or subscription not found.
{ "statusCode": 404, "message": "Channel not found", "error": "Not Found" }
429
application/json
Too many requests, 200 per minute.
{ "statusCode": 429, "message": "ThrottlerException: Too Many Requests" }
Subscriptions list
Return the list of all subscriptions for a specific notifications channel
/channels/{channelId}/subscriptions
- Name
- Description
X-CHANNEL-API-KEY
string
required
- Channel api key
- Code
- Description
200
application/json
Return an array with list of all subscriptions for a specific notifications channel.
[ { "channel": "...59f5326c1", "subscriber": "...a59f5326c8", "iuid": "your-internal-user-id", "mute": false, "createdAt": 1673889812, "updatedAt": 1673984274, "id": "...9423bb3841" } ]
400
application/json
Channel id not valid
{ "statusCode": 400, "message": "Channel id not valid", "error": "Bad Request" }
401
application/json
Channel api key is not valid, make sure the key "X-CHANNEL-API-KEY" is present in the headers request.
{ "statusCode": 401, "message": "Channel api key is no valid.", "error": "Unauthorized" }
404
application/json
Channel not found | Subscription not found
{ "statusCode": 404, "message": "Channel not found", "error": "Not Found" }
429
application/json
Too many requests, 200 per minute.
{ "statusCode": 429, "message": "ThrottlerException: Too Many Requests" }
Subscriptions details
Return the details about specific subscription.
/channels/{channelId}/subscriptions/{iuid}
- Name
- Description
X-CHANNEL-API-KEY
string
required
- Channel api key
- Code
- Description
200
application/json
Return the information about a specific subscription.
{ "channel": "...59f5326c1", "subscriber": "...a59f5326c8", "iuid": "your-internal-user-id", "mute": false, "createdAt": 1673889812, "updatedAt": 1673984274, "id": "...9423bb3841" }
400
application/json
Channel id not valid
{ "statusCode": 400, "message": "Channel id not valid", "error": "Bad Request" }
401
application/json
Channel api key is not valid, make sure the key "X-CHANNEL-API-KEY" is present in the headers request.
{ "statusCode": 401, "message": "Channel api key is no valid.", "error": "Unauthorized" }
429
application/json
Too many requests, 200 per minute.
{ "statusCode": 429, "message": "ThrottlerException: Too Many Requests" }
404
application/json
Channel not found | Subscription not found
{ "statusCode": 404, "message": "Channel not found", "error": "Not Found" }
Send notification
Send a notification to your client.
/channels/{channelId}/notifications/{iuid}
- Name
- Description
X-CHANNEL-API-KEY
string
required
- Channel api key
- Property
- Description
title
string
minLength 3
maxLength 30
required
Title of the notification
text
string
minLength 3
maxLength 200
required
Text of the notification
{
"title": "Notification Title",
"text": "This is notification text, I can write anything!"
}
- Code
- Description
200
application/json
Return the sent notification.
{ "subscription": "...9423bb3841", "title": "Notification Title", "text": "This is notification text, I can write anything!", "readedAt": 0, "createdAt": 1674561843, "id": "...4e9184675d" }
400
application/json
Channel id not valid
{ "statusCode": 400, "message": "Channel id not valid", "error": "Bad Request" }
401
application/json
Channel api key is not valid, make sure the key "X-CHANNEL-API-KEY" is present in the headers request.
{ "statusCode": 401, "message": "Channel api key is no valid.", "error": "Unauthorized" }
404
application/json
Channel not found | Subscription not found
{ "statusCode": 404, "message": "Channel not found", "error": "Not Found" }
429
application/json
Too many requests, 600 per minute.
{ "statusCode": 429, "message": "ThrottlerException: Too Many Requests" }
Our API can notify your system about the subscriptions made by your clients, to integrate that check the next calbacks section.