Sending SMS

Sending SMS

POST https://direct.revicom.ltd/api/v1/message

The method allows for sending an array of single messages (1 to 1,000)

Headers

Name
Type
Description

Authorization*

string

Basic {TOKEN_1}

Content-Type*

string

application/json

Request Body

Name
Type
Description

channelType*

string

Sending channel (SMS)

senderName*

string

Sender ID. SMS-names with the status “Approved” are allowed, with the start date not later than the request time

destination*

string

Subscriber number

content*

string

Message text; UTF-8 encoded string without Byte Order Mark

tags

array

Message tags (array of strings). Each tag must match the expression ^\w+$ (any case letters, numbers and underscore "_" are allowed)

useLocalTime

boolean

Flag responsible for the time zone in which the message will be sent: true – sending in the subscriber time zone false – sending by Moscow time By default, true

localSendTime

string

Low bound for the allowed time to send a message (subject to useLocalTime) Date in the format 'YYYY-MM-DD hh:mm:ss' in the range from (current UTC time – 12 hours) to (current UTC time + 7 days) By default the message will be sent immediately

localCompletionTime

string

Upper bound for the allowed time to send a message (subject to useLocalTime) in the range from localSendTime to (current UTC time + 70 days)

ttl

integer

Message lifetime in seconds. After the ttl expires, the final status is set to the message 60 ≤ ttl ≤ 86400

hours

array

Valid sending hours (array of numbers). Integers from 0 to 23 can be transmitted in the array, each corresponding to the hour interval allowed for sending, subject to useLocalTime; the values must be unique.

days

array

Valid sending days (array of numbers). Integers from 1 (Mon) to 7 (Sun) can be transmitted in the array, each corresponding to the week day allowed for sending; the values must be unique.

shortUrl

boolean

Flag responsible for shortening links in the message: true- links in the text of the message will be shortened By default, false

callbackUrl

string

Address to send callback

callbackEvents

array

Events to send callback (an array of strings). If there is callbackUrl and no callbackEvents in the request, a callback will be sent on the event delivered

If the request is successful, a response is returned that lists the message IDs and result codes. With errors = false, all submitted messages are guaranteed to have been successfully generated.

{
  "errors": false,
  "items": [
    {
      "messageUuid": "063474ec-a34f-4558-90c5-984395000004",
      "code": 201
    },
    {
      "messageUuid": "063564ec-a34f-4558-90c5-984395000005",
      "code": 201
    }
  ]
}

Recommended minimum timeout: 70 seconds

It is allowed to use as a sender name when sending SMS messages the names in the “Approved” status with a validity start date no later than the current one.

For creating sender ID, please contact your manager.

To set up custom domain for the link shortening functionality, please contact customer support

Enumerations:

Parameter
Allowed values

callbackEvents

Request example

POST https://direct.revicom.ltd/api/v1/message
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
[
  {
    "channelType": "SMS",
    "senderName": "SENDER",
    "destination": "14085553911",
    "content": "Message Text",
    "localSendTime": "2020-01-01 18:00:00",
    "localCompletionTime": "2020-01-02 18:00:00",
    "useLocalTime": true,
    "ttl": 43200,
    "hours": [
      12,
      13,
      14
    ],
    "days": [
      1,
      2
    ],
    "shortUrl": true,
    "callbackUrl": "https://company.com/callback",
    "callbackEvents": [
      "sent",
      "delivered",
      "click"
    ],
    "tags": [
      "tag1",
      "tag2"
    ]
  }
]

Last updated