CTRLK

Shared components

Receive mobile app users' responses over API

|

View as Markdown

Infobip supports receiving incoming push notifications from mobile app users. When it comes to receiving incoming messages, you can choose between two basic methods:

  • HTTP forward method - Allows you to receive incoming messages from your mobile app users in real time.
  • Pull method - Allows you to fetch new messages from the Infobip server over API whenever you want.

Before you can start receiving messages, you need to configure the application for incoming messages. You can find instructions on how to set up each scenario in the Configuration section below. It’s up to you to decide which method to use, depending on your use case.

HTTP Forward Method

Use this method to receive incoming messages in real time. Every message received from a mobile app user will be forwarded to an arbitrary URL provided in the Action Setup. The arbitrary URL should be able to receive POST requests.

Pull Method

All messages received from your mobile app users will be received on the Infobip platform and will be there until you decide to access them over API call which will return the received messages.

NOTE

All received messages can be pulled only once. Once a certain message has been pulled by this method, it will not be available in the next API call. This means that you will only see the messages received since the last API request you made.

Configuration

The Configuration is a logical container for actions. You can choose a method of incoming message delivery through the Action setup, but before you do that, you must create the configuration.

List All Configurations [#list-all-configurations-configuration]

Each application within the Infobip platform is uniquely identified with the APPLICATION CODE.

Use the list all configurations method to get all configurations of your application. If successful, you will receive a list of configurationKeys.

Get Single Configuration [#get-single-configuration-configuration]

Use the APPLICATION CODE and Configuration Key to get single configuration.

Path parameters

ParameterTypeDescription
applicationCodestringApplication code
configurationKeystringConfiguration key

Create New Configuration [#create-new-configuration-configuration]

Each application within the Infobip platform is uniquely identified with the APPLICATION CODE. Use this method to create a new configuration within the application. If successful, you will receive a configurationKey. Attempting to create a new configuration when another configuration already exists will result in the 409 CONFLICT status.

Delete configuration [#delete-configuration-configuration]

To delete the configuration, use this method with the configurationKey you want to delete and APPLICATION CODE you want to delete the configuration from.

Path parameters

ParameterTypeDescription
applicationCodestringApplication code
configurationKeystringConfiguration key

Setup Action

Action Models [#action-models-setup-action]

Different actions have different models depending on the logic that the action triggers. These models are used as a request and response bodies for GET and POST methods.

HTTP FORWARD Action [#http-forwardaction-setup-action]

Property nameTypeDescription
keystringThe action's key.
typestringConstant value - HTTP_FORWARD
forwardUrlstringURL to which the received message will be forwarded to.
callbackDatastringOptional. The string that will be forwarded alongside the usual fields posted to forwardUrl.

Pull Action

Property nameTypeDescription
keystringAction key.
typestringConstant value - PULL.
callbackDatastringOptional. The string that will be forwarded alongside the usual fields posted to forwardUrl.

List All Actions [#list-all-actions-setup-action]

Use the list all actions method to return actions for a given application configuration, if any. If successful, response will contain all actions for the given configuration.

ParameterTypeDescription
actionsstringList or actions.
keystringApplication code.
typestringAction type.
forwardUrlstringForward URL.

Create New Action [#create-new-action-setup-action]

To create a new action for configuration within application use the create a new action method.

Path parameters

ParameterTypeDescription
applicationCodestringApplication code
configurationKeystringConfiguration key

Request example

HTTP FORWARD

json
1 
2 {
3
4     "type": "HTTP_FORWARD",
5
6     "forwardUrl": "https://www.myDomain.com/messageReceiver",
7
8     "callbackData": "callbackData"
9
10

Request example

Pull

json
1 
2 {
3 "type": "PULL",
4 "callbackData": "callbackData"
5 }

Delete Action [#delete-action-setup-action]

To delete an action use the delete method.

Path parameters

ParameterTypeDescription
applicationCodestringApplication code
configurationKeystringConfiguration key
actionKeystringAction key