Content server integration
To trigger dispatch of a push notification to all subscribers, there needs to be some code running when the content authors publish a new article or other content item. This can typically be implemented using a webhook, but will vary between CMS-es and depend the availablity of development resources and server code access.
Step 1
To initiate a dispatch of a push notification, you will notify the Subrite API. If you specify the optional field topic
, only subscribers to that specific topic will receive a notification. If you don't supply a topic, all subscribers will be notified, no matter what topics they have subscribed to.
- Method:
POST
- Route:
{baseUrl}/api/v1/app-push/pushcontent
- Authorization: Bearer token (using the M2M generated in Basic setup, step 5)
- Body: See example below
Example of body :
{
"title": "Subrite",
"body": "Breaking! Subrite has won the Platform of the year Award",
"data": {
// insert the data you need to open the app in the preferred state here
// it will be delivered as part of the payload
},
"topic": "subrite"
}
And you're done, good luck!