Receiving Callback
The callbackUrl value must comply with RFC 3986, which specifically allows:
use of both https and http secure zone
transmission of a login:password pair for Basic authorization. Example:"callbackUrl": "https://login:password@example.com/callback"
explicit transmission of ip-address and port. Example: "callbackUrl": "http://12.34.567.89:8080/callback"
Outbound Messages Callback
If the callbackUrl
parameter (and optionally callbackEvents
) was transmitted in the message object when requesting to send POST /v1/message, then when one of the specified events (or the default event) occurs, a callback will be sent to the specified callbackUrl
.
delivered
Getting one of the message statuses:
delivered – the message was delivered
undelivered – the message was not delivered in lifetime (default 25 hours)
unsent – the message was not sent
Is the default event, if there is a callbackUrl and no callbackEvents in the query.
sent
Getting the message status “sent”
read
Getting one of the message statuses:
read – the message was read
unread – the message was not read in lifetime (default 25 hours)
price
Changing the message price
click
Clicking on a shortened link in the text of the message
Message status change
When any of the delivered
, sent
, read
events specified in the message sending request occurs, the following query will be sent to the specified callbackUrl
:
message_uuid
string
required
Message uuid
channel_type
string
required
cascade_message_uuid
string
optional
Identifier of the first message in the cascade. This is sent for cascading messages only
cascade_step
integer
optional
The sequence number of the message in the cascade. This is sent for cascading messages only
callback_event
string
required
status
string
required
status_time
string
required
Message status time
error_code
integer
optional
Message price change
When the price event occurs, if it was specified in the message sending request, the following query will be sent to the specified callbackUrl
:
message_uuid
string
required
Message uuid
channel_type
string
required
cascade_message_uuid
string
optional
Identifier of the first message in the cascade. This is sent for cascading messages only
cascade_step
integer
optional
The sequence number of the message in the cascade. This is sent for cascading messages only
callback_event
string
required
Callback event. In this case: price
parts
integer
required
Number of parts in the message
price
number
required
Price of the message
currency
string
required
price_time
string required
Message price setting time
Click through
When the click
event occurs, if it was specified in the request to send a message, the following query will be sent to the specified callbackUrl
:
message_uuid
string
required
Message uuid
channel_type
string
required
cascade_message_uuid
string
optional
Identifier of the first message in the cascade. This is sent for cascading messages only
cascade_step
integer
optional
The sequence number of the message in the cascade. This is sent for cascading messages only
callback_event
string
required
Callback event. In this case: click
url
string
required
Initial link
short_url
string
required
Shortened link
click_time
string required
Click time
Inbound Messages Callback
Contact your manager to enable the option to get inbounds (currently only possible for the WhatsApp channel)
Go to the PA page Settings / Inbounds
Click Add and fill out the form
In the field Traffic Partitioning Center, specify the traffic partitioning center to which incoming messages should be assigned
In the field Callback URL, specify the address to which the callback will be sent when an inbound is got
If Include sender names is specified, you can select the names for inbounds of which the selected TPC and CallbackUrl will be assigned (if you do not take into account names, then the assignment of TPC and CallbackUrl will be valid for all inbounds via the channel)
Inbounds for which no matching rule is found will be assigned to the default TPC (specified on the Settings/Traffic Partitioning Centers page).
Receiving inbound message
When an inbound is got for which a suitable rule with CallbackUrl
was found, the following query will be sent to the specified address:
message_uuid
string required
Message uuid
callback_event
string required
Callback event. In this case: inbound_sent
channel_type
string required
status
string required
Message status. In this case: inbound_sent
status_time
string requied
Time of sending
item
object required
Expected response
In response to a callback of any type, HTTP code 2** is expected. If there is no response within 24 hours, resending will be performed every 5 minutes.
Last updated