To control how long a message is kept in the Message Inbox using a duration (for example 7 days) instead of a fixed expiration date, use the inbox_days parameter in your /createMessage API request.
This parameter specifies the number of days the message stays available in the inbox, counted from the moment it is sent. After that period the message is removed automatically.
The maximum value for inbox_days is 30.
Note: inbox_days is an alternative to inbox_date, which sets a specific expiration date. A message reaches the inbox only if the request includes at least one inbox parameter (inbox_days, inbox_date or inbox_image); otherwise it is delivered as a regular push and never appears in the inbox feed.
Deprecation notice: /createMessage is deprecated. It still works, but new integrations should use Messaging API v2 — see the migration guide for a field-by-field mapping.
Example API request
Here is how to use inbox_days inside the notifications array of your payload. In this case the message is stored in the inbox for 7 days.
{
"request": {
"application": "YOUR_APP_CODE",
"auth": "YOUR_API_TOKEN",
"notifications": [
{
"send_date": "now",
"content": "Your message content",
"inbox_days": 7
}
]
}
}
Comments
0 comments
Please sign in to leave a comment.