Send SMS to OnlineSIM for rent operation

POSThttps://{ourserver.com}/v1/PUSH_SMS_RENT

The same webhook as PUSH_SMS, sent to the same URL: a service value starting with rent routes the SMS to the rent operation on phone. Rent support depends on the integration.

The first SMS confirms the rent. An SMS from a blocked sender (banks, payment systems, etc.) is shown to the client as a notice instead of the text and does not confirm the rent.

If you get {"status": "SUCCESS"}, the SMS can be marked in your database as delivered (don't send it again).

Business errors are answered with HTTP 200 and {"status": "ERROR", "error": "<code>"}; they are final, do not repeat such requests. If the request fails at the network level or is answered with HTTP 500 (INTERNAL_ERROR), repeat it after a pause (for example, 10 seconds).

Possible errors (the set depends on the integration):

  • NO_OP - there is no active rent operation on the number;
  • SERVICE_BAN / BANNED - the sender is blocked (the SMS may still be shown to the client as a notice);
  • INTERNAL_ERROR (HTTP 500) - the request could not be processed.

Request Body

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

Content-Typeapplication/json
Schema
schemaobject
smsIdinteger
Operation ID (the activationId you returned in GET_NUMBER)≥ 1Example:355
phoneFromstringRequired
Name or phone number of the sender (anything after @ is cut off)Example:Instagram
phonestringRequired
Rented phone number that has received the SMS, in international format with the country code, digits only (as returned in GET_NUMBER)Example:79088081050
textstringRequired
Message textExample:Your verification code is 800142
actionstring
Method name, in this case PUSH_SMSEnum:PUSH_SMSExample:PUSH_SMS
keystring
API key of your OnlineSIM partner profile. The integration is identified by the webhook URL; whether the key is checked depends on the integrationExample:apikey
servicestringRequired
Marks the SMS as a rent SMS: any value starting with rent, e.g. rentExample:rent

Examples

request

PUSH_SMS request from your server (for a rented number)

{
  "smsId": 124980,
  "phoneFrom": "instagram",
  "phone": "4605028040",
  "text": "784958 is your secret code",
  "action": "PUSH_SMS",
  "key": "apikey",
  "service": "rent"
}

Responses

200OnlineSIM server response: the SMS is accepted or rejected with an error code
Content-Typeapplication/json
Schema
schemaobject
statusstringRequired
Response statusEnum:SUCCESSERRORExample:SUCCESS
errorstring
Error code (with status: ERROR)Enum:NO_OPSERVICE_BANBANNEDExample:NO_OP

Examples

success

The SMS is accepted

{
  "status": "SUCCESS"
}
NO_OP

No active rent operation for this number

{
  "status": "ERROR",
  "error": "NO_OP"
}
SERVICE_BAN

The sender is blocked

{
  "status": "ERROR",
  "error": "SERVICE_BAN"
}
500The request could not be processed: repeat it later
Content-Typeapplication/json
Schema
schemaobject
statusstring
Enum:ERRORExample:ERROR
errorstring
Enum:INTERNAL_ERRORExample:INTERNAL_ERROR

Code Samples

Generating examples...