VK#
VK Message Sending Request#
To generate a test request with your parameters, please
open the request generator.
1 {
2 "login":"YOUR_LOGIN",
3 "password":"YOUR_PASSWORD",
4 "useTimeDiff":true,
5 "id":"8770630",
6 "scheduleInfo":{
7 "timeBegin":"10:00",
8 "timeEnd":"12:00",
9 "weekdaysSchedule":"123"
10 },
11 "destAddr":"Subscriber's_Number",
12 "message":{
13 "type":"VK",
14 "data":{
15 "text":"Message text",
16 "serviceNumber":"SENDER'S_NAME",
17 "ttl":10
18 }
19 }
20 }
Request Parameters#
Parameter |
Required |
Data type |
Description |
|---|---|---|---|
login |
yes |
string |
Partner’s name in the system. |
password |
yes |
string |
Partner’s password in the system. |
useTimeDiff |
no |
boolean |
Taking into account the time zone when starting messaging. More details
If
If
Default value: |
id |
no |
string |
Partner’s side unique ID. More detailsThis parameter is required to control re-sending and duplication (the control service is enabled separately). The Partner may recall the Service Provider (the request to send a message) with the same ID several times. In this case the message will be sent to the subscriber only once (upon the first request). In response to requests, the Service Provider will return the same message ID in the Service Provider's system to the Partner (the same as for the first request). The Service Provider optionally returns this ID to the Partner, if available in the message delivery report. |
shortenLinks |
no |
boolean |
Parameter controls the automatic shortening of long links in a message. More detailsPossible values are:
If the service is available to the Partner, the URL strings will be shorted by default if the parameter is not received in the request. The ability to use this service is pre-negotiated and configured by the Service Provider. For more details: Link Shortening Service. |
scheduleInfo |
no |
object |
Messaging schedule. More detailsIf it is not specified, it is sent immediately upon receipt of the request. |
scheduleInfo/
timeBegin
|
no |
string |
Start time. More details
Example: |
scheduleInfo/
timeEnd
|
no |
string |
End time. More details
Example: |
scheduleInfo/
weekdaysSchedule
|
no |
string |
Messaging days. More details
Specified by numbers from If there are no restrictions on days of the week, this parameter can be empty or not delivered in the request. |
scheduleInfo/
deadline
|
no |
string |
End date of the messaging. More details
Example: |
destAddr |
yes |
string |
Subscriber’s phone number. More detailsIt contains the country code, operator code and phone number.
For the Russian Federation, the code can be
Examples: |
message |
yes |
object |
Parameters of a message being sent. |
message/type |
yes |
enum |
Message type. More details
The value of |
message/data |
yes |
object |
Parameters of the data being sent. |
message/data/
text
|
yes |
string |
Text of a message being sent. More detailsNumber of characters: no more than 2000. |
message/data/
serviceNumber
|
yes |
string |
Sender’s name from which the message is being sent. |
message/data/ttl |
yes |
integer |
Message lifetime. More detailsAcceptable range in seconds: from 60 to 86400. Note When |
message/data/ttlUnit |
no |
enum |
Unit of measurement of the message delivery period. More details
It is transmitted only with
Possible values are: |
registeredDelivery |
no |
integer |
Requirement of delivery reports. More detailsPossible values are:
|
notifyUrl |
no |
string |
Hostname of the incoming API to receive the delivery report. More detailsThis parameter is optional in the request, but if sent, you should consider the following: if the parameter is specified, it cannot be empty.
The If any of the specified conditions are not met, an error will be generated and the request will not be executed. |
extraParam |
no |
string |
Additional parameters passed as More details
The comma character cannot be included in the parameter name,
but it can be included in its value — in this case it must be doubled
Example: the string
|
cascadeChainLink |
no |
object |
Cascading message parameters. More details |
Response to the Request#
After sending a message the Service Provider returns a response synchronously. In case of successful sending Service Provider returns HTTP-code 200 OK.
Successful sending#
1 {
2 "mtNum": "7390612217"
3 "id": "8770599"
4 }
Parameter |
Data type |
Description |
|---|---|---|
mtNum |
string |
Sending chain identifier assigned by the Service Provider platform. |
id |
string |
Partner-side unique ID. Available, if it was included when sending. |
Sending Errors#
For results with errors, a response HTTP code will differ from 200 (see Error Codes).
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 |
VK message Delivery Statuses#
To receive VK message statuses, you need to set up the Delivery Status Service.
Delivery Error Codes#
Delivery error codes for each message type are provided in the corresponding tab of the Description of Error Codes (parameter status=5) section.