SMS API

Sending SMS messages

For information about the authentication and authorization procedures that associate API calls with the required applications in your account, see Authorization.

Request:

Parameters can be passed in the request headers:

POST/GET https://api.unibell.ru/v2/sms?X-Authorization=AccessKey d8ac9959r12b43545XXXXX&destAddr=7XXXXXXXXXX&sourceAddr=MySender&shortMessage=Message text

As well as in the request body:

{
    "sourceAddr": "MySender",
    "destAddr": "7XXXXXXXXXX",
    "shortMessage": "Message text"
}

Example request using CURL:

curl --location --request POST 'https://api.unibell.ru/v2/sms?X-Authorization=AccessKey%20d8ac9959r12b43545XXXXX&destAddr=7XXXXXXXXXX&sourceAddr=MySender&shortMessage=Message text'
curl --location 'https://api.unibell.ru/v2/sms?=' \
--header 'X-Authorization: AccessKey d8ac9959r12b43545XXXXX' \
--header 'Content-Type: application/json' \
--data '{
    "sourceAddr": "MySender",
    "destAddr": "7XXXXXXXXXX",
    "shortMessage": "Message text"
}'
ParameterTypeDescription
sourceAddrstringSender name (Latin letters only or phone number)
The field must not contain Cyrillic characters
destAddrstringPhone number to which the SMS is sent, in e.164 format, for example, for the Russian Federation: 7XXXXXXXXXX
7XXXXXXXXXX
shortMessagestringMessage text

Response upon successful request execution:

{
    "status": "Created",
    "requestId": "11273"
}

Response in case destAddr is missing:

{
    "status": "Rejected",
    "error": "Missing destAddr param"
}
ParameterTypeDescription
statusstringRequest status:
Created – Message created in the system but not yet sent
Rejected – Message was not accepted for sending, see error for details
prohibitedForServiceError – Key does not belong to the SMS service
invalidAccessKeyError – Authorization key error
requestIdstringUnique request identifier
errorstringError description:
Missing destAddr param – destAddr is missing in the request
Missing sourceAddr param – sourceAddr is missing in the request
Missing shortMessage param – shortMessage is missing in the request
Field sourceAddr must not contain Cyrillic – sourceAddr contains Cyrillic characters

Bulk SMS message sending

Request:

POST/GET https://api.unibell.ru/v2/sms_bulk?X-Authorization=AccessKey d8ac9959r12b43545XXXXX

Request body:

{
    "sourceAddr": "MySender",
    "destAddrs": [
        "79123213232",
        "2вауц",
        "71233212323"
    ],
    "shortMessage": "Message text"
}

Example request using CURL:

curl --location 'https://api.unibell.ru/v2/sms_bulk' \
--header 'X-Authorization: AccessKey d8ac9959r12b43545XXXXX' \
--header 'Content-Type: application/json' \
--data '{
    "sourceAddr": "MySender",
    "destAddrs": [
        "79123213232",
        "2вауц",
        "71233212323"
    ],
    "shortMessage": "Message text"
}'
ParameterTypeDescription
sourceAddrstringSender name
The field must not contain Cyrillic characters
destAddrsstringList of phone numbers to which SMS messages are sent, in e.164 format, for example, for the Russian Federation: 7XXXXXXXXXX
shortMessagestringMessage text

Response body upon request execution:

{
    "status": "ok",
    "results": [
        {
            "status": "Created",
            "requestId": "11276",
            "destAddr": "79123213232"
        },
        {
            "status": "Rejected",
            "error": "Not valid destAddr",
            "destAddr": "2test"
        },
        {
            "status": "Created",
            "requestId": "11277",
            "destAddr": "71233212323"
        }
    ]
}
ParameterTypeDescription
statusstringRequest status:
Created – Message created in the system but not yet sent
Enroute – Message routed and awaiting sending
Delivered – Message delivered, delivery status received from operator
Expired – Message lifetime expired
Deleted – Message was canceled
Undeliverable – Message not delivered due to reasons such as: number does not exist, no space for new SMS on the phone
Accepted – Message sent, delivery status from operator not yet received
Unknown – Unknown error
Rejected – Message was not accepted for sending, see error for details
prohibitedForServiceError – Key does not belong to the SMS service
invalidAccessKeyError – Authorization key error
resultsstringResults for each recipient
errorstringError description:
Missing destAddr param – destAddr is missing in the request
Missing sourceAddr param – sourceAddr is missing in the request
Missing shortMessage param – shortMessage is missing in the request
Field sourceAddr must not contain Cyrillic – sourceAddr contains Cyrillic characters
Not valid destAddr – destAddr is invalid
requestIdstringUnique request identifier
destAddrstringPhone number to which the SMS is sent, in e.164 format, for example, for the Russian Federation: 7XXXXXXXXXX

Retrieving status

Request:

Parameters can be passed in the request headers:

GET https://api.unibell.ru/v2/sms_status?X-Authorization=AccessKey d8ac9959r12b43545XXXXX&requestId=11273

As well as in the request body:

{
    "requestId": "11273"
}

Example requests using CURL:

curl --location 'https://api.unibell.ru/v2/sms_status' \
--header 'X-Authorization: AccessKey d8ac9959r12b43545XXXXX' \
--header 'requestId: 11273'
curl --location --request GET 'https://api.unibell.ru/v2/sms_status' \
--header 'X-Authorization: AccessKey d8ac9959r12b43545XXXXX' \
--header 'Content-Type: application/json' \
--data '{
    "requestId": "11273"
}'

Response body upon successful request execution:

{
    "id": 9654,
    "destAddr": "7XXXXXXXXXX",
    "requestId": "11273",
    "status": "Rejected",
    "networkErrCode": 34,
    "mcc": 0,
    "mnc": 0,
    "ported": 0
}

Response in case the requestId parameter is missing:

{
    "status": "Rejected",
    "error": "Missing requestId param"
}
ParameterTypeDescription
idintegerUnique SMS message identifier
destAddrstringPhone number to which the SMS was sent, in e.164 format, for example, for the Russian Federation: 7XXXXXXXXXX
requestIdstringUnique request identifier
statusstringSMS sending request status:
Created – Message created in the system but not yet sent
Enroute – Message routed and awaiting sending
Delivered – Message delivered, delivery status received from the operator
Expired – Message lifetime expired
Deleted – Message was canceled
Undeliverable – Message not delivered due to reasons such as: number does not exist, no space for new SMS on the phone
Accepted – Message sent, delivery status from operator not yet received
Unknown – Unknown error
Rejected – Mobile network rejected the message, likely due to a filter or other restriction
notFound – Record for the requested requestId does not exist/not found
networkErrCodestringSS7 errors, see below
mccintegerMobile Country Code
mncintegerMobile Network Code – mobile operator code
portedintegerIndicates whether the number has been ported:
1 – if the number was ported
0 – if not ported
errorstringif not ported
Missing requestId param – requestId is missing in the request

Retrieving message statuses via Webhook

Request source:

Webhooks will be sent from the IP addresses 185.175.44.211 and 46.148.235.62, which must be added to the ACL on the client’s web server to ensure proper interaction.

Interaction format:

Callbacks are performed over the HTTP protocol.

Data is transmitted in JSON format.

Webhook setup is performed by submitting a request to technical support.

Sending a request:

The request is sent in JSON format, which has the following structure:

{
  "ported": 0,
  "mnc": 0,
  "requestId": "35714061",
  "destAddr": "7XXXXXXXXXX",
  "id": 639073386,
  "networkErrCode": 0,
  "mcc": 0,
  "status": "Delivered"
}
ParameterTypeDescription
portedintegerIndicates whether the number has been ported:
1 – if the number was ported
0 – if not ported
mncintegerMobile Network Code – mobile operator code
requestIdstringUnique request identifier
destAddrstringPhone number to which the SMS is sent, in e.164 format, for example, for the Russian Federation: 7XXXXXXXXXX
idintegerУникальный идентификатор SMS-сообщения
networkErrCodestringSS7 errors, see below
mccintegerMobile Country Code
statusstringSMS sending request status:
Created – Message created in the system but not yet sent
Enroute – Message routed and awaiting sending
Delivered – Message delivered, delivery status received from the operator
Expired – Message lifetime expired
Deleted – Message was canceled
Undeliverable – Message not delivered due to reasons such as: number does not exist, no space for new SMS on the phone
Accepted – Message sent, delivery status from operator not yet received
Unknown – Unknown error
Rejected – Message was not accepted for sending, see error for details

Error codes in the status

Possible error codes in SMS status (networkErrCode).

All unspecified codes are considered vendor-dependent and are not handled separately.

CodeDescription KeyDescription
1unknownSubscriberUnknown subscriber
The subscriber is not registered in the network
5unidentifiedSubscriberUnidentified subscriber
Subscriber is registered, but information about them is missing or unavailable
9illegalSubscriberIllegal subscriber
Access denied due to rule violation
11teleserviceNotProvisionedTelecommunication service not provisioned
Subscriber is not subscribed to the requested service
13callBarredCall barred
Calls are prohibited for this subscriber (e.g., due to blocking or tariff restrictions)
21facilityNotSupportedFacility not supported
Requested service is unavailable for the subscriber or network
27adsentSubscriberAddress absent
Message not delivered due to missing sender information
31subscriberBusyForMT-SMSSubscriber busy for MT-SMS
Subscriber cannot receive SMS due to device being busy
32sm-DeliverFailureSMS delivery failure
General error related to SMS transmission
33messageWaitingListFullMessage waiting list full
Subscriber device memory has no space for new messages
34systemFailureSystem failure
General network-side error
35dataMissingData missing
Insufficient information to complete the operation
36unexpectedDataValueUnexpected data value
Incorrect or unexpected data provided
On this page