v2

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
NameTypeDescription
Authorization*string

see more here

Request Body

Content-Typeapplication/json
Schema
schemaobject
All Of
[0]objectAn SMS received by one of your numbers.
[1]object

Examples

sms

An SMS from VK

{
  "number": "+234112233445",
  "from": "VKcom",
  "message": "VKcom 111111"
}

Responses

200The SMS is accepted
Content-Typeapplication/json
Schema
schemaobject
responsestringRequired
Enum:1Example:1

Examples

success

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.
Content-Typeapplication/json
Schema
schemaobjectError answer: response and message hold the same error code.
responsestringRequired
Error code
messagestringRequired
The same error code

Examples

ERROR_PARAMS

Missing or invalid parameters

{
  "response": "ERROR_PARAMS",
  "message": "ERROR_PARAMS"
}
ERROR_MESSAGE

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.
Content-Typetext/html
Schema
schemastring
Enum:Unauthorized.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).
Content-Typeapplication/json
Schema
schemaobject
responsestringRequired
Error codeEnum:ERROR_DISABLEDERROR_BANNEDERROR_IPERROR_RENT
messagestringRequired
The same error code

Examples

ERROR_IP

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
Content-Typeapplication/json
Schema
schemaobjectError answer: response and message hold the same error code.
responsestringRequired
Error code
messagestringRequired
The same error code

Examples

NO_OPERATION

No matching operation

{
  "response": "NO_OPERATION",
  "message": "NO_OPERATION"
}

Code Samples

Generating examples...