MAX#
This section describes the features of sending messages to subscribers' devices with the MAX messenger installed. Partners can interact with their customers through a bot in this messenger.
Currently, the Service Provider ensures:
sending text messages;
receiving message delivery statuses;
resending messages via SMS (cascading message): in case of non-delivery to MAX.
Sending Request#
The content of the request complies with the requirements for a standard request (see Request Structure).
1 {
2 "login":"YOUR_LOGIN",
3 "password":"YOUR_PASSWORD",
4 "destAddr":"SUBSCRIBER'S_NUMBER",
5 "message":{
6 "type":"MAX",
7 "data":{
8 "text":"MESSAGE TEXT.",
9 "serviceNumber":"SENDER'S_NAME"
10 }
11 }
12 }
Parameter |
Required |
Data type |
Description |
---|---|---|---|
login |
yes |
string |
Partner’s username. |
password |
yes |
string |
Partner’s password. |
destAddr |
yes |
string |
Subscriber’s phone number. More detailsA positive integer. Maximum length: 15 digits.
Contains a country code, operator code, and phone number.
For Russia, the code can be
Examples: If the subscriber's number is not sent, or is not a valid phone number, the request will be rejected with an error (see MAX Sending Errors). |
message |
yes |
object |
Parameters of the message to be sent. More detailsContains information about the message type and its content. |
{message}
type
|
yes |
enum |
Message type. Set the value to |
{message}
data
|
yes |
object |
Parameters of the data to be sent. |
{message/data}
text
|
yes |
string |
Text of the message to be sent. More detailsThe message text can be in Cyrillic or Latin, and can contain emojis. Number of characters: no more than 4000. If the parameter is not sent, or its value is invalid, the request will be rejected with an error (see MAX Sending Errors). |
{message/data}
serviceNumber
|
yes |
string |
Service name from which the message is sent. More detailsFor cascade messaging, specify the service name in the request (in the main MAX channel). The service name must be pre-approved by the Service Provider's technical support service. If the parameter is not sent, or its value is not valid, the request will be rejected with an error (see MAX Sending Errors). |
cascadeChainLink |
no |
object |
Parameters of cascading message. See Cascading Message Sending.
|
Response#
After sending a message, the Service Provider synchronously returns a response.
Successful MAX Sending#
In case of successful sending, the HTTP code 200 OK
is returned.
1 {
2 "mtNum": "7390612217"
3 "id": "1234567"
4 }
Parameter |
Data type |
Description |
---|---|---|
mtNum |
string |
Sending chain identifier assigned by the Service Provider’s platform. |
id |
string |
Unique identifier on the Partner’s side. The parameter is included if it was present in the request. |
MAX Sending Errors#
For results with errors, a response HTTP code will differ from 200 OK
(see Error Codes).
1 {
2 "error": {
3 "code": 8,
4 "description": "destAddr is not correct"
5 },
6 "extendedDescription": "Invalid number: 7999999999999999"
7 }
Parameter |
Data type |
Description |
---|---|---|
error |
object |
Error information. |
error/code |
int |
Error code. |
error/description |
string |
Short error description. |
extendedDescription |
string |
Optional parameter. Contains a detailed error description. |
Error Codes#
Code |
Description |
HTTP-code |
---|---|---|
1 |
Service is unavailable |
503 |
2 |
Invalid IP-address |
403 |
3 |
Too many connections |
429 |
4 |
Invalid request |
400 |
5 |
Invalid login |
401 |
6 |
Invalid password |
401 |
7 |
serviceNumber is not defined |
400 |
8 |
destAddr is not correct |
406 |
9 |
Message type is not correct |
406 |
10 |
Prohibited sending duplicates |
409 |
11 |
Invalid TTL |
406 |
100 |
100 |
500 |
Message Delivery Statuses#
To receive statuses of messages, you need to set up a Delivery Status Service.