Create topic groups, subscribe and unsubscribe indie ids, and send a push to a group.
Required
Register your users with indie push registration before using these APIs.
appId and appToken are in your Native Notify dashboard. Send POST and PUT bodies as JSON with Content-Type: application/json, or the server answers 401.
Create a topic group
POST https://app.nativenotify.com/api/post/follow/master
{
"masterSubID": "weekly-specials",
"appId": 12345,
"appToken": "yourAppToken",
"isTopicGroup": true
}
Answers 201 with Follower Master Indie ID posted!, or 400 with Master ID already exists. Topic group names share one namespace with follow-master IDs (registerFollowMasterID), so a name used by either is taken. You can create as many topic groups as you want.
Subscribe a user to a topic group
POST https://app.nativenotify.com/api/post/follower
{
"masterSubID": "weekly-specials",
"followerSubID": "user_8241",
"appId": 12345,
"appToken": "yourAppToken"
}
masterSubID is the group's name and followerSubID is the indie id you registered. Answers 201 with Follower Indie ID posted! (or Follower sub id already exists when already subscribed), and 404 with an empty body when the group doesn't exist.
Send a push to a topic group
POST https://app.nativenotify.com/api/follow/notification
{
"masterSubID": "weekly-specials",
"appId": 12345,
"appToken": "yourAppToken",
"title": "Fresh bread at 7am",
"message": "The bakery opens early today."
}
The body also accepts pushData, bigPictureURL and Expo's message fields. See Rich notifications.
| Status | Meaning |
|---|---|
201 with Success! | Sent to the topic group's subscribers. It currently also answers Success! when the free trial has ended, sending is paused, or the membership doesn't include group pushes, although nothing is delivered then. |
201 with The ID does not exist or the ID has no followers/subscribers. | Nobody is subscribed yet. Nothing was sent. |
404 with an empty body | No topic group with that name. |
400 | A missing title or message, or an invalid rich field. |
500 | A payload over Expo's 4 KiB limit. |
Get all topic group names
GET https://app.nativenotify.com/api/all/app/topic/group/names/:appId/:appToken
Answers 201 with [{ "topic_group_names": "<name>" }, …], sorted by name. Only groups created with isTopicGroup: true are listed.
Unsubscribe a user from a topic group
PUT https://app.nativenotify.com/api/unfollow/master
{
"masterSubID": "weekly-specials",
"followerSubID": "user_8241",
"appId": 12345,
"appToken": "yourAppToken"
}
Answers 201 with Follower ID unfollowed Master ID!, also when the id wasn't subscribed, and 404 when the topic group doesn't exist.
List the ids subscribed to a topic group
GET https://app.nativenotify.com/api/topic/group/:topicGroupName/:appId/:appToken
Answers 201 with { "topic_group_sub_ids": [...], "topic_group_sub_count": N }, or 400 with There are no Topic Groups with that name. URL-encode the group name, for example with encodeURIComponent, when it contains spaces.
Delete a topic group
DELETE https://app.nativenotify.com/api/follow/master/:appId/:appToken/:topicGroupName
Answers 201 with Delete Follow Master successful!, also when no group had that name. URL-encode the group name.
Can't be undone
Deleting a topic group can't be undone.