Callback
The source of the requests
The Callbacks will come from the IP address 168.119.144.144, which must be included in the ACL on the client’s web server side to ensure correct interaction.
Interaction format
Callbacks are performed over the HTTP protocol. Depending on the version of the callback, data is transmitted either in the request headers or in its body in JSON format.
The configuration and selection of the callback are performed in the HTTP service.
V1
It is used in applications.
Method: any.
The parameters ate passed in the request header:
https://XXXXX/api/1/nvp/public/3602/XXXX?type=endCallback&reference=XXX&state=5&error=19&duration=0&text=1+9+5+1+&appKey=XXXXXX
Parameters | Description |
---|---|
type | Type of callback request (startCallback/endCallback) |
reference | The user parameter with which the callback will be called based on the results of the application execution |
state | The result of the application execution |
error | Error code, or 0 — in case of successful execution |
duration | Duration of the call |
text | Variables from the scenario |
appKey | The API key of the application |
V2
It is used only for FlashCall.
Method: any other than GET.
The data is transmitted in the request body.
{
"requestId":"ХХХХХ",
"appKey":"ХХХХХ",
"sourceAddr":"",
"number":"7ХХХХХХХХХХ",
"vars":"text=3+7+1+4+0+1+",
"status":"REJECTED",
"timestamp":"1722314308954"
}
Parameters | Description |
---|---|
requestId | The unique identifier of the request on the partner’s side |
appKey | The API key of the application |
sourseAddr | Sender’s name |
number | Phone number |
vars | Variables in the scenario |
status | Statuses that are assigned in accordance with “Statuses comparison“ |
timestamp | The time of the status change in unixtime format |
V4
It is used in applications.
Method: regardless of the settings in the interface, always POST.
Scenario parameters and variables are passed in the request body in JSON format.
{
"reference": "123",
"type": "endCallback",
"state": "2",
"error": "0",
"duration": "4",
"appKey":"ХХХХХ",
"sourceAddr":"ХХХХХ",
"destAddr": "ХХХХХ",
"a": "1111",
"c": "444",
"b+": "2222",
"timestamp":"1722314308954"
}
Parameters | Description |
---|---|
reference | The user parameter with which the callback will be called based on the results of the application execution |
type | Type of callback request (startCallback/endCallback) |
state | The result of the application execution |
error | Error code, or 0 — in case of successful execution |
duration | Duration of the call |
appKey | The API key of the application |
sourceAddr | Outgoing number |
destAddr | Recipient’s phone number |
a, c, b+ | Variables from the scenario |
timestamp | The time of the status change in unixtime format |
Description of the state
State | Description |
---|---|
state=0 | Initial state |
state=1 | Submitted for processing |
state=2 | Successfully |
state=5 | Unsuccessfully |
state=6 | At work |
state=8 | Internal error |
state=10 | Postponed |
Error description
Error | Description |
---|---|
error=0 | Successful completion |
error=16 | Normal completion |
error=17 | The user is busy |
error=18 | There is no response from the user |
error=19 | The user was notified, but did not respond |
error=21 | The call was rejected |
error=22 | The number has been changed |
error=27 | The call is not being serviced |
error=28 | Invalid number format |
error=34 | Circuit/channel overload |
error=38 | The network is not working |