Configuring App Inbox for Mobile Apps

<a href="https://docs-ua.esputnik.com/docs/nalashtuvannya-app-inbox-dlya-mobilnih-zastosunkiv" style={"color":"grey","textDecoration":"none"}>
Read this article in Ukrainian ⮕

App Inbox is another option to communicate with your customers provided by our CDP. It allows the delivery of automatic and manual notifications to their accounts in the mobile app.

General description of App Inbox, its application, advantages as compared with other communication channels you may find in thisĀ article.

Configuring App Inbox for Mobile Apps

To configure the app inbox, you need to send the requests to

  • get an authentication token;
  • get the number of unread app inbox messages;
  • get the number of pages with messages;
  • get the list of all app inbox messages in the mobile app;
  • get the changed status of app inbox messages.
Diagram showing data flow between the customer client application, customer backend, and Our CDP for App Inbox queries and authentication using the ES-TOKEN header

Getting Authentication Token

Send the request from your server to eSputnik API to receive the user authentication token (authToken). Authenticate the request using one of the methods specified in the API instructions, for example, using an API key.

The request has to contain the known contact fields: email, phone, externalCustomerId (at least one field is required). Those fields are used for searching contacts in eSputnik.

Request methodPOST
Request URLhttps://esputnik.com/v1/auth/contact/token
Request headerContent-Type: application/json
Request body{<br />"email": string,<br />"phone": string,<br />"externalCustomerId": string<br />}
Response{<br />"token": string<br />}

Afterward, authToken is used for authentication of all app inbox requests. Pass it in the header of the ES-TOKEN request. The current token becomes invalidated after each request, and the ES-TOKEN response header passes the new one used in the following request.

If you receive status code 401 as a response to any app inbox request, resubmit the request to get the token.

Getting the Number of Unread App Inbox Messages

The request permits you to get information about unread messages in the client’s mobile app. You can send this request on a regular basis.

Request methodGET
Request URLhttps://esputnik.com/appinbox/v1/messages/count
Request headerES-TOKEN: authToken
Response headerES-TOKEN: newAuthToken
Response{<br />"count": int<br />}

If count > 0, you shall see the indicator of unread messages.

Mobile app screens showing a notification bell with an unread count and the opened News list with App Inbox messages

Getting the List of All App Inbox Messages

The request permits to get in the response the list of messages in the mobile app, including the following data:

  • message ID;
  • date of creation;
  • header;
  • message text content;
  • image URL;
  • link URL;
  • message status (opened or unopened);
  • category;
  • custom data.
Request methodGET
Request URLhttps://api-reteno.com/appinbox/v1/messages?page={pageNumber}&pageSize={pageSize}&status={status}
Request headerES-TOKEN: authToken
Response headerES-TOKEN: newAuthToken
pageminimum value 0
pageSizeminimum value 1
statusOPENED/UNOPENED
Response

Read this article in Ukrainian ⮕

If page , status or pageSize is not set, then return all actual messages.

šŸ“˜

Note

The link URL field returned for each message is eSputnik's tracked link. Open this URL as-is in your app when the user taps the message — eSputnik tracks the click automatically when this link is opened. If you substitute your own untracked URL instead, click statistics for App Inbox campaigns won't include that interaction.

Getting the Changed Status of App Inbox Messages

The request transfers the read message event. It is required to pass only the message IDs having newMessage=true.

Using this request, you also can change the status of all messages from "unread" to "read".

Request method `appinbox/v1/messages/status`
Request header ES-TOKEN: authToken
Response header ES-TOKEN: newAuthToken
Request body {
"status" : "OPENED",
"ids": ="right
} {
"status": "OPENED",
"ids": null //or leave empty
}
Response none

Creating Segment With Contacts Available for App InboxĀ 

All contacts that enter eSputnik through the SDK have Device IDs. This means you can send them App Inbox messages.

To select all contacts with Device IDs in your database, create a dynamic segment and include the All contacts with device condition.

Dynamic segment Conditions tab with the Channels category expanded and the All contacts with device condition highlighted.

Creating App Inbox Messages

See this article to learn more about creating the messages and campaigns.

šŸ“˜

Note

Plain Mobile Push has no built-in notification history — once a push is delivered (or dismissed), the app doesn't store it anywhere by default. You can build your own in-app notification center: use the Get mobile push message API method to retrieve a push's content and store or display it on your side (note this returns the message's general content, not the exact personalized values sent to a specific contact). For a ready-made notification history without custom development, connect App Inbox instead.


Did this page help you?