Send notifications via our API
Owners of decentralized apps (dApps) want to send notifications to their users, to be displayed in the FE of their respective dApps.
CNS will be used as a platform for dApps to send notifications and CNS will be responsible for streaming these notifications to the FE of their dApps.
A REST API endpoint will be exposed by CNS for dApps to send notifications to our platform.
Design & Implementation
We would have separate endpoints for different media platforms, for example, POST /channel/{channelId}/message
for in-app notifications and POST /channel/{channelId}/message/telegram
for telegram notifications. Most of the fields in the request body are identical for both endpoints, except platform-specific fields, such as parse_mode
for telegram notifications.
REST API endpoint design
POST /channel/{channelId}/message
- Send in-app notification
Note:
Infra setup will be in place to restrict API access to selected dApps using the API (Kaching would be our first dApp partner). API Authentication using mechanisms like API keys might be considered in the future but not supported in MVP.
Example Request:
Copy
Copy
Response Body:
No JSON response body needed to be returned
Successful response will return status code 204
POST /channel/{channelId}/message/telegram
- Send telegram notification
Example Request:
Copy
Copy
Response Body:
No JSON response body needed to be returned
A successful response will return status code 204
Last updated