App Inbox for mobile applications

App Inbox is another option to communicate with your customers provided by eSputnik. 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 the article “App Inbox: Why You Will Love This Channel and How to Use It Effectively.”

Configuring App Inbox for Mobile Apps

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

  • get an authentication token;

  • get the number of unread app inbox messages;

  • get the list of all app inbox messages in the mobile app;

  • get the changed status of app inbox messages.

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 (at least one field is required). Those fields are used for searching contacts in eSputnik.

Request method

POST 

Request URL

https://esputnik.com/v1/auth/contact/token

Request header

Content-Type: application/json

Request body

{

"email": string,

"phone": string

}

 

Response

{

“token”: string

}

 

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 method

GET

Request URL

https://esputnik.com/appinbox/v1/messages/count

Request header

ES-TOKEN: authToken

Response header

ES-TOKEN: newAuthToken

Response

{

“count”: int

}

 

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

Indicator of unread 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 (read or unread).

Request method

GET 

Request  URL 

https://esputnik.com/appinbox/v1/messages

Request header

ES-TOKEN: authToken

Response header

ES-TOKEN: newAuthToken

Response

{

“list”: [{

“id” : string, // UUID

“createdDate” : long, //timestamp in milliseconds

“title”: text,

“content”: text,

“image”: string, // URL

“link”: string, // URL

“newMessage” : boolean // true for unread message

}]

}

 

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.

Request method

POST

Request  URL 

https://esputnik.com/appinbox/v1/messages/status

Request header

ES-TOKEN: authToken

Response header

ES-TOKEN: newAuthToken

Request body

{

“status” : “OPENED”,

“ids”: [string]

}

 

Response

none

Creating App Inbox Messages

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

Any Questions?
We’re always happy to help!
Request a Callback
Fill in the form, and our specialists will call you back as soon as possible.
Request a Callback
Chat Support
We’re waiting for your questions!
Send a Chat Message
Email
Contact the eSputnik support team
Send an Email