Topic Push Notification APIs
Subscribe registered Indie Push subscribers to custom topic groups. Then send push notifications only to individuals subscribed to those topic groups. Send notifications based on topics.
Required:
You must follow the Indie Registration Guide instructions before using the APIs listed on this page. Topic Push APIs will not work without first following the Indie Registration Guide
Prerequisites
Create a free Native Notify account
Create a free NativeNotify.com account to get your Native Notify App ID and App Token.
Create a Topic Group API
Use this API to create a Topic Group that Indie Push subscribers will be able to follow. You can create as many Topic Groups as you want.
Post to this URL:
https://app.nativenotify.com/api/post/follow/master
Use this POST body:
{
masterSubID: "your Topic Group name",
appId: app-id-number,
appToken: "app-token-string",
isTopicGroup: true
}
Subscribe a user to a Topic Group API
API Notes:
- Use this API to subscribe an Indie Push subscriber to a topic group.
- Put the name of the Topic Group in the masterSubID key value you want to subscribe an Indie Push subscriber to.
- Put the Indie Push unique user ID you registered with Native Notify in the followerSubID that you want to subscribe to this Topic Group.
Post to this URL:
https://app.nativenotify.com/api/post/follower
Use this POST body:
{
masterSubID: "your Topic Group name",
followerSubID: "the Indie Push unique user ID you want to subscribe to this Topic Group",
appId: app-id-number,
appToken: "app-token-string",
}
Send a Push Notification to Topic Group Subscribers API
Use this API to send a push notifications to all Indie Push unique user IDs subscribed to a Topic Group.
Post to this URL:
https://app.nativenotify.com/api/follow/notification
Use this POST body:
{
masterSubID: "your registered Topic Group name",
appId: app-id-number,
appToken: "app-token-string",
title: "push notification title",
message: "push notification message"
}
Get names of all Topic Groups API
Use this API to get all the names of Topic Groups that have been successfully registered with Native Notify.
Run a GET request to this URL:
https://app.nativenotify.com/api/all/app/topic/group/names/${app-id}/${app-token}
Notes:
- Replace "app-id" with your Native Notify App ID.
- Replace "app-token" with your Native Notify App Token.
Unsubscribe a User from a Topic Group API
Use this API to unsubscribe an Indie Push unique user ID from an existing Topic Group.
Run a PUT request to this URL:
https://app.nativenotify.com/api/unfollow/master
Use this PUT body:
{
masterSubID: "your Topic Group name",
followerSubID: "the Indie Push unique user ID you want to unsubscribe from this Topic Group",
appId: app-id-number,
appToken: "app-token-string",
}
Show what Indie Push Ids are subscribed to a Topic Group API
Use this API to get all the Indie Push unique user IDs subscribed to a specific Topic Group.
Run a GET request to this URL:
https://app.nativenotify.com/api/topic/group/${topic-group-name}/${app-id}/${app-token}
Notes:
- Replace "topic-group-name" with your the currently registered Topic Group name.
- Replace "app-id" with your Native Notify App ID.
- Replace "app-token" with your Native Notify App Token.
Delete a Topic Group API
Use this API to delete a Topic Group. (Be careful! This cannot be undone!)
Run a DELETE request to this URL:
https://app.nativenotify.com/api/follow/master/${app-id}/${app-token}/${topic-group-name}
Notes:
- Replace "topic-group-name" with your the currently registered Topic Group name.
- Replace "app-id" with your Native Notify App ID.
- Replace "app-token" with your Native Notify App Token.