posthttps://{ourserver.com}/v1/PUSH_SMS

Webhook POST /v1/PUSH_SMS

Send SMS to Onlinesim

This is a webhook for sending messages to Onlinesim server. These requests should be sent automatically when your number with active operation has received a message to forward it to Onlinesim server.

If you get a response with 200(OK) status, SMS can be marked in your database as successfully delivered (don't send message again).

If response is different from 200, then in 10 seconds another request with the same context should be sent, unless it's NO_OPERATION or BAD_SERVICE error.

Following responses with errors are possible:

  • NO_OPERATION / NO_OP - this error occurs when you try to push SMS for a number that has no active operation;
  • BAD_SERVICE - this error occurs when you try to push SMS from a service that is banned by our server (banks, payment systems, etc.);
  • IGNORED - this error occurs when you try to push SMS from a service that is differs from the one the client has ordered (only appears when filtration is done on our side);
  • SERVICE_BAN - this error occurs when you try to push SMS from the service you've blacklisted (you can add services to the blacklist, it prevents users to order your numbers for these services)

Parameters

header2
NameTypeDescription
Authorization*string

see more here

Content-Type*string

Content type header and encoding scheme

Enum:application/json; charset=utf-8

Request Body

PUSH_SMS webhook: your server must send this request once an event is triggered (when the ordered number has received a message).

Content-Typeapplication/json
Schema
Bodyobject
smsIdintegerRequired

Operation ID (assigned by your server)

≥ 1
phoneFromstringRequired

Name or phone number of a sender

phonestringRequired

Phone number with active operation, that has received the SMS

textstringRequired

Message text

actionstringRequired

Method name, in this case PUSH_SMS

Enum:PUSH_SMSDefault:PUSH_SMS
keystringRequired

API key of your Onlinesim partner's profile

Examples

Example payload of your server PUSH_SMS request
{
  "smsId": 124971,
  "phoneFrom": "vk",
  "phone": "79104041216",
  "text": "Your OTP 46875",
  "action": "PUSH_SMS",
  "key": "apikey"
}

Responses

200

Onlinesim server response

Content-Typeapplication/json
Schema
Responseobject
statusstring

Onlinesim server response status

Enum:SUCCESSERROR

Examples

Onlinesim server response example for successfuly received SMS
{
  "status": "SUCCESS"
}
When pushing SMS to a number that has no active operation
NO_OP
When pushing SMS from a service that is banned by our server (banks, payment systems, etc.)
BAD_SERVICE
When pushing SMS from a service that is differs from the one the client has ordered (only appears when filtration is done on our side)
IGNORED
When pushing SMS from a service you've added to the blacklist
SERVICE_BAN
When rate limit for PUSH_SMS_RENT requests is exceeded
TOO_MANY_ATTEMPTS
404

NO_OPERATION / NO_OP

This error occurs when you try to push SMS for a number that has no active operation

Code Samples

Generating examples...