Forward a received SMS
POSThttps://{ourserver.com}/api/resellers/addMessage
Forwards an SMS received by one of your numbers. Send it as soon as the SMS arrives.
The SMS is passed to every active operation on this number whose service it matches (for a rental, any
SMS matches). If there is no such operation, the answer is 404 NO_OPERATION. SMS from senders and with
texts on our stop list are never forwarded.
You can filter messages on your side (send only SMS of the ordered service) or send all of them and let us filter. Do not forward SMS with confidential data, such as credentials of your account on the operator's website.
To forward several SMS at once, use addMessages.
Parameters
header1
| Name | Type | Description |
|---|---|---|
Authorization* | string | see more here |
Request Body
application/jsonschemaobject
[0]objectAn SMS received by one of your numbers.
[1]object
Examples
An SMS from VK
{
"number": "+234112233445",
"from": "VKcom",
"message": "VKcom 111111"
}Responses
200The SMS is accepted
application/jsonschemaobject
1Example:1Examples
The SMS is accepted
{
"response": "1"
}400Invalid request:
ERROR_PARAMS — number is missing or is not a phone number, or from or message is missing;
ERROR_MESSAGE — message is empty.
ERROR_PARAMS — number is missing or is not a phone number, or from or message is missing;ERROR_MESSAGE — message is empty.application/jsonschemaobjectError answer: response and message hold the same error code.
Examples
Missing or invalid parameters
{
"response": "ERROR_PARAMS",
"message": "ERROR_PARAMS"
}Empty message text
{
"response": "ERROR_MESSAGE",
"message": "ERROR_MESSAGE"
}401No API key, or the key does not exist. The body is the plain text Unauthorized.
A request with Accept: application/json gets HTTP 200 with {"response":"ERROR_WRONG_KEY"} instead.
text/htmlUnauthorized.Example:Unauthorized.403Forbidden: the API key is valid, but the request is refused. Error codes:
ERROR_DISABLED — the partner account is not activated;
ERROR_BANNED — the partner account is blocked;
ERROR_IP — the request comes from an IP address that is not in the account's allowlist;
ERROR_RENT — rent is requested, but the account has no rent access (addNumber only).
ERROR_DISABLED — the partner account is not activated;ERROR_BANNED — the partner account is blocked;ERROR_IP — the request comes from an IP address that is not in the account's allowlist;ERROR_RENT — rent is requested, but the account has no rent access (addNumber only).application/jsonschemaobject
ERROR_DISABLEDERROR_BANNEDERROR_IPERROR_RENTExamples
Request from an IP address outside the allowlist
{
"response": "ERROR_IP",
"message": "ERROR_IP"
}404NO_OPERATION — the number has no active operation that this SMS matches; the SMS is not forwarded
application/jsonschemaobjectError answer: response and message hold the same error code.
Examples
No matching operation
{
"response": "NO_OPERATION",
"message": "NO_OPERATION"
}