Messages
Listing
Endpoint |
|
Request Type |
GET |
Content-Type |
application/json |
Rate Limiting |
5 requests per second |
Description: The v2/messages
endpoint allows for querying all notification groups for a given game.
Optional Parameters
|
The number of notification groups to return. Will be clamped to [1, 1000]. Defaults to 1,000 |
|
A pagination token from a previous call to v2/messages |
Success Response
Status Code |
200 |
||||||
Response Body |
JSON dictionary with
|
||||||
Example |
|
Error Responses
Rate Limit Response
Status Code |
429 |
Response Body |
JSON dictionary with 'status' and 'errors' keys. 'status' will be 'rate_limit'. 'errors' will contain the key 'rate_limit' |
Example |
|
Creating
Endpoint |
|
Request Type |
POST |
Content-Type |
application/json |
Rate Limiting |
5 requests per second |
Description: The v2/messages
endpoint allows for creating a notification group for a given game.
Required Parameters
|
Your Teak App ID |
|
Your Teak Server Secret |
|
A unique identifier for the |
|
The unique identifier of the opt-out category the |
|
A dictionary whose keys are |
Success Response
Status Code |
200 |
||||
Response Body |
JSON dictionary …
|
||||
Example |
|
Error Responses
Not Found
Status Code |
404 |
Response Body |
JSON dictionary with 'status' and 'errors' keys. 'status' will be 'error'. 'errors' will be a dictionary in which the keys are the parameter which could not be found, and the values will be an array of human readable messages indicating what could not be found. |
Example |
|
Invalid Parameter
Status Code |
422 |
Response Body |
JSON dictionary with 'status' and 'errors' keys. 'status' will be 'error'. 'errors' will be a dictionary containing keys indicating which parameters were invalid, with values being an array of human readable error messages. |
Example |
|
Rate Limit Response
Status Code |
429 |
Response Body |
JSON dictionary with 'status' and 'errors' keys. 'status' will be 'rate_limit'. 'errors' will contain the key 'rate_limit' |
Example |
|
Updating
Endpoint |
|
Request Type |
PUT |
Content-Type |
application/json |
Rate Limiting |
5 requests per second |
Description: The v2/messages
endpoint allows for updating the Message
with the identifier identifier
in the request path.
Note: For the time being, only a Message
in which no ChannelGroup
contains more than one MessageInstance
.
Required Parameters
|
Your Teak App ID |
|
Your Teak Server Secret |
|
A unique identifier for the |
|
The unique identifier of the opt-out category the |
|
A dictionary whose keys are |
Success Response
Status Code |
200 |
||||
Response Body |
JSON dictionary …
|
||||
Example |
|
Error Responses
Not Found
Status Code |
404 |
Response Body |
JSON dictionary with 'status' and 'errors' keys. 'status' will be 'error'. 'errors' will be a dictionary in which the keys are the parameter which could not be found, and the values will be an array of human readable messages indicating what could not be found. |
Example |
|
Invalid Parameter
Status Code |
422 |
Response Body |
JSON dictionary with 'status' and 'errors' keys. 'status' will be 'error'. 'errors' will be a dictionary containing keys indicating which parameters were invalid, with values being an array of human readable error messages. |
Example |
|
Rate Limit Response
Status Code |
429 |
Response Body |
JSON dictionary with 'status' and 'errors' keys. 'status' will be 'rate_limit'. 'errors' will contain the key 'rate_limit' |
Example |
|
Types
This section outlines the shape of the various types of entity you will encounter when using this API.
AndroidContentMode
AndroidContentMode
controls the layout of content for Android notifications. It is an enum comprised of one of the following values:
|
Use the default layout behavior. See Default Android Layout |
|
Use the iOS Style layout. See See Android iOS Style Layout. If this mode is selected, |
AndroidIconMode
AndroidIconMode
controls what icon is selected for notifications on Android. It is an enum comprised of one of the following values:
|
Use the application icon. |
|
Use a custom icon. |
|
Do not show an icon. |
BadgeState
BadgeState
controls how badges are displayed. It is an enum comprised of one of the following values:
|
Badging behavior will be inherited from the Opt-Out Category. |
|
No Badge will be shown. |
|
Badge will be shown. After the player launches the game following a notification that sets the badge, all notifications in the player’s Notification Center will be cleared. |
DurationUnit
DurationUnit
controls how maximum_age
is interpreted. It is an enum comprised of one of the following values:
|
|
|
|
|
|
EmailContentMode
EmailContentMode
controls how message
is interpreted, when channel is email
. It is an enum comprised of one of the following values:
|
No email template will be used, the body of the email will be comprised of |
|
Teak’s default email template will be used. |
LinkType
LinkType
controls how links will behave. It is an enum comprised of one of the following values:
|
A deep link into the game, using the SDK’s router. |
|
Link to the game. |
|
A link that goes to something other than the game. E.G. A web page. |
Message
Message
is a container for message content across all App-to-Player channels. It is a dictionary containing the following keys:
|
|
The unique identifier of this |
|
|
The unique identifier of the opt-out category to which this |
|
|
A dictionary whose keys are |
|
|
The ISO8601 timestamp indicating when this |
|
|
The ISO8601 timestamp indicating when this |
(Note: A '?' at the end of a type indicates that this field may be ommitted.)
MessageInstance
MessageInstance
represents the configuration of a notification, for a given channel. If an A/B test is running, there may be multiple MessageInstance
records for a single channel, representing the variations under test. It is a dictionary containing the following keys:
|
Controls badge display behavior. |
|
|
|
Deprecated. Superseded by |
|
What kind of link this |
|
|
|
If true, the notification will be shown even if the game is running in the foreground.+ Note: Teak SDK version 3.1.1 or later required. |
|
|
Skip game open. Disables rewarding. |
|
|
The relative weight of this |
|
|
The unique identifier of the reward bundle, if any, to give the player. |
|
When the reward associated with the notification expires, if a reward bundle is associated with this |
|
|
The notification content to use, based on player locale. |
|
|
|
The ISO8601 timestamp indicating when this |
|
|
The ISO8601 timestamp indicating when this |
(Note: A '?' at the end of a type indicates that this field may be ommitted.)
Channel
Channel
represents the avenue by which the player receives a notification. It is an enum comprised of one of the following values:
|
The ChannelGroup represents notifications for Android. |
|
The ChannelGroup represents notifications for email. |
|
The ChannelGroup represents notifications for Facebook. |
|
The ChannelGroup represents notifications for iOS / iPadOS. |
|
The ChannelGroup represents notifications for Web Push. |
ChannelGroup
ChannelGroup
is a container for the set of MessageInstances associated with a particular channel, and controls any relevant A/B test. It is a dictionary containing the following keys:
|
|
The unique identifier of the |
|
|
Whether or not this |
|
|
The ISO8601 timestamp indicating when the A/B test began, if one is running. |
|
An array of MessageInstance dictionaries. There will be exactly one record, unless there is an A/B test configured. |
|
|
|
The ISO8601 timestamp indicating when this |
|
|
The ISO8601 timestamp indicating when this |
(Note: A '?' at the end of a type indicates that this field may be ommitted.)
RewardExpiration
RewardExpiration
controls how long a player has to collect a reward bundle from a notification before it expires. It is a dictionary containing the following keys:
|
|
The amount of time after which the reward expires. |
|
Controls how |
(Note: A '?' at the end of a type indicates that this field may be ommitted.)
SoundState
SoundState
controls what sound is played for an iOS/iPadOS notification. It is an enum comprised of one of the following values:
|
The default sound will be played. This is chosen by the OS, or by the user. |
|
Use the sound from the default translation group. (This value is only allowed if the |
|
No sound will be played. |
|
Use the value from |
|
Use the sound associated with the opt-out category of the |
Translation
Translation
represents the content of a notification, for one or more locales. It is a dictionary containing the following keys:
|
|
Whether or not to loop video content in the notification. |
|
|
The filename of the sound in your application bundle that should be played when this translation is used for the notification. Only relevant to iOS/iPadOS, as opt-out category determines notification sound on Android. |
|
Determines which sound will be played on iOS/iPadOS. |
|
|
|
The unique identifier of the translation group to which this |
|
|
|
|
|
|
|
|
|
|
|
A list of language tags for which this |
|
Whether or not to use Teak’s email template. (Only available when channel is |
|
|
What notification layout to use on Android. (Only available when channel is |
|
|
What notification icon to use on Android. (Only available when channel is |
|
|
|
Displays the android banner above the expanded view image when the notification is expanded. (Only available when channel is |
|
|
The ISO8601 timestamp indicating when this |
|
|
The ISO8601 timestamp indicating when this |
(Note: A '?' at the end of a type indicates that this field may be ommitted.)