Links

REST API Inbox

Parameters Sent in the Body and Their Meanings

  1. 1.
    extId: This parameter represents the unique ID assigned to the user. It is a mandatory field and expects a string value.
  2. 2.
    status: Indicates the status of messages in the user's inbox. It can take one of three values: 1 (read), 2 (unread), 3 (read - unread but not deleted), 4 (deleted) and 7 (all). This field is mandatory and expects an integer value.
  3. 3.
    numberOfNotification: Specifies the number of notifications/messages the client wants to see on a single page. It is not mandatory and expects an integer value. If not used, the default is to display the last 20 messages.
  4. 4.
    prms: Contains the index parameter. The index value expects the pushInstanceId. This field is not mandatory and expects a long value.
  5. 5.
    startDate: Specifies the start date of the inbox messages to be retrieved. It expects an epoch timestamp in milliseconds. This field is not mandatory and expects a long value.
  6. 6.
    endDate: Specifies the end date of the inbox messages to be retrieved. It expects an epoch timestamp in milliseconds. This field is not mandatory and expects a long value.
  7. 7.
    category: Indicates the message category. It is not mandatory and expects an integer array.
  8. 8.
    piids: Expects the pushInstanceIds of the messages for which the status is to be changed. This field is mandatory and expects an integer array.

REST/3.0/inbox/getAllInbox

This endpoint is used to get all of the user inbox.
curl -X POST \
-H "X-netmera-api-key: your_rest_api_key" \
-H "Content-Type: application/json" \
-d '{
"extId":"your_xid",
"status": 2,
"startDate":1681635178000,
"endDate":1684227178000,
"numberOfNotification":3,
"prms": {
"index": 2582035
}
}' \
https://restapi.netmera.com/rest/3.0/inbox/getAllInbox

REST/3.0/inbox/getAllInbox | Sample Response

msgs": [
{
"msgId": 25965,
"pushInstanceId": 3101819,
"title": "test",
"message": "Test",
"deeplink": null,
"androidMediaUrl": null,
"iosMediaUrl": null,
"personalizedMsg": null,
"personalizedTitle": null,
"subText": "test",
"status": "UNREAD",
"customParams": {},
"personalizedSubText": null
}
],
"cnts": {
"2": 1
}
}

REST/3.0/inbox/get?piid=

curl --location --request GET 'https://restapi.netmera.com/rest/3.0/inbox/get?piid=3103726' \
--header 'X-netmera-api-key: your_rest_api_key' \
--header 'Content-Type: application/json' \
--data-raw ''

REST/3.0/inbox/statusChange

This endpoint is used for changing status of messages in the user inbox.
curl --location --request POST 'https://restapi.netmera.com/rest/3.0/inbox/statusChange' \
--header 'X-netmera-api-key: your_rest_api_key' \
--header 'Content-Type: application/json' \
--data-raw '{
"extId": "your_xid",
"piids": [
2584151
],
"st": 4
}'

Using the Index Parameter

Let's assume a user has 5 messages in their inbox. To view the latest 3 messages (by specifying the desired number of messages in numberOfNotification), an API request is made.
As a result of this request, if the total number of messages in the inbox is greater than the desired number of messages to be displayed, the prms object will contain an index value. The index value will be equal to the pushInstanceId of the last message displayed on that page. This allows you to navigate through the messages in a paginated manner.
Request Sent
curl -X POST \
-H "X-netmera-api-key: your_rest_api_key" \
-H "Content-Type: application/json" \
-d '{
    "extId": "your extID"
}' \
https://restapi.netmera.com/rest/3.0/inbox/getAllInbox