Skip to content

Message inbox API

getInboxMessages

Returns the list of Inbox messages for a specified HWID.

POST https://api.pushwoosh.com/json/1.3/getInboxMessages

Request Body

NameTypeDescription
application*stringPushwoosh app code.
userId*stringIf no custom user ID is set, use HWID.
hwidstringHardware ID of a device to get the Inbox messages for.
last_codestringCode of the last message retrieved in the previous response. If empty, the first messages are returned.
countintegerThe number of messages to be showed in a single response; used for pagination. 0 for loading all messages in Inbox.
{
"response": {
"messages": [{ // array of messages currently stored in user's Inbox
"inbox_id": "avde1c792cd",
"rt": "146078676", // date to remove the message from Inbox
"send_date": "1459758676", // date when the message was saved to Inbox
"order": "59138176", // position in Inbox presentation order
"title": "New Rich Media in inbox!",
"text": "Hi! New feature is available right now!",
"action_type": "RichMedia",
"action_params": { // payload describing the actions on push opening
"rm": "{\"url\":\"https:\/\/richmedia.pushwoosh.com\/C82F7-51FC1.zip\",\"ts\":\"1459758676\",\"tags\":{\"tagName\":\"tagValue\"}}"
},
"status": 1, // 1 - delivered, 2 - read, 3 - opened,
// 4 - deleted(by a user), 5 - deleted from Control Panel
"hash":"1C" // hash code of push notification
}, {
...
}],
"next":"afarew511", // the next Inbox code to be returned by
// the following /getInboxMessages request
"deleted": ["bbaf85ab", "a41957b"], // the list of messages deleted from Control Panel
"new_inbox": 6 // the number of delivered Inbox messages for that user (can be used for badge)
}
}
Example Request
{
"request": {
"application": "XXXXX-XXXXX", // required. Pushwoosh app code
"userId": "user_name_1", // required. User ID registered in Pushwoosh
"device_type": 1 // optional. For device types refer to /registerDevice
}
}

inboxStatus

Updates the status of a particular Inbox message.

POST https://api.pushwoosh.com/json/1.3/inboxStatus

Request Body

NameTypeDescription
application*stringPushwoosh app code.
inbox_code*string

could be obtained from Message details in Control Panel or from the β€œorder” parameter of the /geInboxMessages request

hashstringHash code of Inbox message.
hwidstringHardware ID of the device to update Inbox status for.
timestringSend date timestamp.
userID*stringIf no custom user ID is set, use HWID.
status*integer1 - delivered, 2 - read, 3 - opened, 4 - deleted by a user.
device_typeintegerSee possible values below.
{
"status_code": 200,
"status_message": "OK",
"response": null
}
Example
{
"request": {
"application": "XXXXX-XXXXX", // required. Pushwoosh application code
"inbox_code": "874393934032909", // required. "order" parameter of /getInboxMessages request
"hash": "1C", // optional.
"userId": "some_user", // required.
"status": 2, // required. status to set: 1-delivered, 2-read, 3-opened, 4-deleted (by a user)
"device_type": 3 // optional.
}
}