Skip to content

POST /v1/PUSH_SMS

Send SMS to Onlinesim

WARNING

URL of Onlinesim server is provided by Onlinesim partner support specialists. Please note, that the URL in the example is just a placeholder.

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.

WARNING

Request header should have utf-8 encode scheme placed in 'Content-Type'

('Content-Type': 'application/json; charset=utf-8').

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

No parameters

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-Type:application/json
Bodyobject
smsIdintegerRequired

Operation ID (assigned by your server)

≥ 1
Example:355
phoneFromstringRequired

Name or phone number of a sender

Example:Instagram
phonestringRequired

Phone number with active operation, that has received the SMS

Example:79088081050
textstringRequired

Message text

Example:Your verification code is 800142
actionstringRequired

Method name, in this case PUSH_SMS

Enum:PUSH_SMS
Default:PUSH_SMS
Example:PUSH_SMS
keystringRequired

API key of your Onlinesim partner’s profile

Responses

200

Onlinesim server response

404

NO_OPERATION / NO_OP

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

429

TOO_MANY_ATTEMPTS

This error occurs when you send too many request in a short period
of time

Code Samples