Push Action
Actions allow you to configure the delivery method for inbound messages.
Sending messages to your users over an API is quite simple. When it comes to receiving incoming messages from your users, you can choose between two methods:
- HTTP forward method - allows you to receive messages from your subscribers in real-time
- Pull method - allows you to fetch new messages from Infobip’s server over API at your convenience
You can choose your preferred method by configuring Action.
Important
The Configuration container must be created before the Action since Actions can exist only inside of the Configuration container.
Available methods
Action models
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
Property name | Type | Description |
key | String | The action's key. |
type | String | Constant value - "HTTP_FORWARD" |
forwardUrl | String | URL that the received message will be forwarded to. |
callbackData | String | Optional. String that will be forwarded alongside the usual fields posted to forwardUrl. |
Pull action
Property name | Type | Description |
key | String | Key of the action. |
type | String | Constant value - "PULL" |
callbackData | String | Optional. String that will be forwarded alongside the usual fields posted to forwardUrl. |
List all actions
Returns actions for a given application configuration, if any.
https://api.infobip.com/push/1/applications/{applicationCode}/configurations/{configurationKey}/actions
Path params
Parameter | Type | Default value | Description |
---|---|---|---|
applicationCode | string | - | Application code |
configurationKey | string | - | Configuration key |
Request example
GET /push/1/applications/{applicationCode}/configurations/{configurationKey}/actions HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Response
{
"actions": [
{
"key": "{actionKey}",
"type": "HTTP_FORWARD",
"forwardUrl": "http://www.example.com/webhook?param=param"
}
]
}
If successful, the response header HTTP status code will be 200 OK
.
Parameter | Type | Description |
---|---|---|
actions | String | List or actions. |
key | String | Application code. |
type | String | Action type. |
forwardUrl | String | Forward URL. |
Create new action
Creates an action.
https://api.infobip.com/push/1/applications/{applicationCode}/configurations/{configurationKey}/actions
Path params
Parameter | Type | Default value | Description |
---|---|---|---|
applicationCode | string | - | Application code. |
configurationKey | string | - | Configuration key. |
Request example: HTTP forward
POST /push/1/applications/{applicationCode}/configurations/{configurationKey}/actions HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
{
"type": "HTTP_FORWARD",
"forwardUrl": "https://www.myDomain.com/messageReceiver",
"callbackData": "callbackData"
}
Response
{
"key": "{actionKey}",
"type": "HTTP_FORWARD",
"forwardUrl": "https://www.myDomain.com/messageReceiver",
"callbackData": "callbackData"
}
Successful response is represented by the HTTP status code 200 OK
.
See action models for request and response bodies.
Attempting to create a new action when another action is already defined for a configuration will result in a 409 Conflict
status.
Request example: Pull
POST /push/1/applications/{applicationCode}/configurations/{configurationKey}/actions HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
{
"type": "PULL",
"callbackData": "callbackData"
}
Response:
{
"key": "{actionKey}",
"type": "PULL",
"callbackData": "callbackData"
}
Successful response is represented by the HTTP status code 200 OK
.
See action models for request and response bodies.
Attempting to create a new action when another action is already defined for a configuration will result in a 409 Conflict
atatus.
Delete action
Deletes an action.
https://api.infobip.com/push/1/applications/{applicationCode}/configurations/{configurationKey}/actions/{actionKey}
Path params
Parameter | Type | Default value | Description |
---|---|---|---|
applicationCode | string | - | Application code. |
configurationKey | string | - | Configuration key. |
actionKey | string | - | Action key. |
Request example
DELETE /push/1/applications/{applicationCode}/configurations/{configurationKey}/actions/{actionKey} HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Successful response is represented by the HTTP status code 204 No Content
. There is no response body.