Message Inbox API

List of methods for working with Message Inbox

getInboxMessages

Returns the list of Inbox messages for a specified HWID.

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

Returns the list of Inbox messages for a specified HWID.

Request Body

NameTypeDescription

application*

string

Pushwoosh app code.

userId*

string

If no custom user ID is set, use HWID.

hwid

string

Hardware ID of a device to get the Inbox messages for.

last_code

string

Code of the last message retrieved in the previous response. If empty, the first messages are returned.

count

integer

The 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": {"rm" : "{ \"url\" : \"https:\/\/richmedia.pushwoosh.com\/C82F7-51FC1.zip\" , \"ts\" : \"1459758676\" , \"tags\" : { \"tagName\" : \"tagValue\" } }"} // payload describing the actions on push opening
                "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:
{
    "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
    }
}

Response:
{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "messages": [
    {
      "inbox_id": "6249b3be0f19a7.16973228",
       "order": "1636321268891501",  // inbox_code
       "rt": "1651330109",           // timestamp - expiry date
       "send_date": "1649008809",    // send data
       "title": "Title",
       "text": "Message",
       "action_type": 1,	     // 1 - link, 2 - rich media
       "action_params": "{}", 	// push payload as json string
       "image": "",		// image
       "status": 1,             // 1 - delivered, 2 - read, 3 - open, 4 - deleted
       "hash": "7t"		// hash for stats
    }],
    "new_inbox": 1              // number of unread messages
  }
}

For iOS, please make sure that you have added the Notification Service Extension to your project for tracking push delivery. Learn more

inboxStatus

Updates the status of a particular Inbox message.

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

Updates status of a particular Inbox message.

Request Body

NameTypeDescription

application*

string

Pushwoosh app code.

inbox_code*

string

could be obtained from Message details in Control Panel or from the "order" parameter of the /geInboxMessages request

hash

string

Hash code of Inbox message.

hwid

string

Hardware ID of the device to update Inbox status for.

time

string

Send date timestamp.

userID*

string

If no custom user ID is set, use HWID.

status*

integer

1 - delivered, 2 - read, 3 - opened, 4 - deleted by a user.

device_type

integer

See possible values below.

{
    "status_code": 200,
    "status_message": "OK",
    "response":null
}
Example
Request:
{
    "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
    }
}

Response:
{
	"status_code": 200,
	"status_message": "OK",
	"response": null
}

Last updated