Push Notifications
The MOTAR API can be used to send mobile push notifications. Make sure you have enabled and configured push notifications in MOTAR Studio for your app before using these endpoints. You also must be able to generate an iOS device token or Android registration ID to register a user to receive notifications in your app.
Reminder: if you are using an app/client ID in sandbox, you must use sandbox.playportal.io
as the endpoint for your requests. Requests to api.playportal.io
with a sandbox client ID will fail!
Create Notification
PUT
https://api.motar.io/notifications/v1
Sends a Push Notification to a user.
Headers
Authorization
string
Auth token generated by user login.
Request Body
path
string
Can be specified to direct the app to open a specific view when the notification is open.
textParameters
string
Inserts dynamic strings into a notification's text.
persist
string
Determines whether the resulting notification is saved on the AFCreate servers to be returned in a user's notification list.
receiver
string
User ID of the notification recipient.
text
string
Text of the notification.
Register for Notifications
PUT
https://api.motar.io/notifications/v1/register
Register's a user's session for receiving notifications. Note that this route must be called every time a user logs in to ensure they will receive notifications from other users.
Headers
Authorization
string
Auth token generated by user login.
Request Body
deviceToken
string
IOS or Android device token.
refreshToken
string
Refresh token of the session the user wishes to register for push notifications.
Get List of Notifications
GET
https://api.motar.io/notifications/v1
Register's a user's session for receiving notifications. Note that this route must be called every time a user logs in to ensure they will receive notifications from other users.
Query Parameters
acknowledge
boolean
Whether or not to return acknowledge notifications.
limit
integer
Page size to return.
page
integer
Page number to return.
since
string
Date string, return all notifications created after this date.
Headers
Authorization
string
Auth token generated by user login.
Acknowledge a Notification
POST
https://api.motar.io/notifications/v1/acknowledge
Sets a notifications acknowledge flag to true.
Headers
Authorization
string
Auth token generated by user login.
Request Body
notificationId
string
ID of the notification to acknowledge.
Last updated