2Way Documentation


 

2Way allows you to receive push messages from mobile app directly on your own server through a HTTP GET / POST call.

You can setup the endpoint url and the call method for each app in the Receive Push 2Way section inside your panel:

 

catapush-setup-2way.png

  1. choose your app from the side menu to expand all sections;
  2. select the Receive Push 2Way section;
  3. click "New Inbox" to add a new endpoint (multiple endpoints are supported).

You can choose between GET and POST method. Depending on this choice parameters will be sent as an HTTP Get Query or in the Raw Request Body.

Catapush will send following parameters:

  • sender:  the user identifier (used to login, eg. the mobile number);
  • text: the message sent by the user;
  • applicationId: application id;
  • timestamp: send date and time, in ISO 8601 UTC format;
  • messageId: internal message id (UUID);
  • type: "IncomingMessage" in case you want to use the same endpoint for different scopes;
  • channel: optional if a channel was specified during the message sending process, and a response is made within that channel, this parameter carries the information about that channel;
  • inReplyToMessageId: (optional) if a user performs a 'reply to' action from the app on a received message, this parameter includes the ID of the original message that the client replied to from the app.

An example of the parameters received is:

sender: 12345678910
text: Hi
applicationId: 318
timestamp: 2016-05-24T13:57:07Z
messageId: 16d01e1c-aac6-4f4d-8786-fa94fd7cc78e
type: IncomingMessage

Incoming messages with attachment will always be sent as an HTTP POST with a multipart/form-data body, that includes the attachment’s binary content and meta information, together with the set of key-value pairs described above.

 

We provide an easy way to test the call request you will receive. Simply compile the following form to get a CURL Example: