Onlinesim will send a request to your URL

↓ POSThttps:///newSms

Webhook newSmsWebhook

Receive SMS via webhook

We've added a webhook feature for you! You can set a URL in your profile settings and as soon as we get SMS for any number that you've ordered, it will be forwarded to you.

This works for both single-service activations and long term rental!

Webhook

The schema of the incoming payload is described below in the Incoming payload section

Incoming payload

Required

SMS payload sent by Onlinesim to your webhook URL

Content-Typeapplication/json
Schema
Bodyobject
user_idstring

Your Profile's ID

country_codestring

International dialing code of the country to which the number that received the SMS belongs. Available values are in the Code column of the country list

numberstring

Phone number in international format

senderstring

Sender's name or phone number

messagestring

SMS context

time_startstring

Date and time when operation was ordered

time_leftstring

Remaining operation time depending on the operation type: for reception — in seconds, for rental — in minutes

operation_idstring

Operation ID

webhook_typeobject

Type of service (single service activations or rent)

Enum:receiving_smsrent_sms
codestring

SMS ID

Examples

Incoming SMS

Incoming SMS webhook payload

{
  "user_id": "204355",
  "country_code": "7",
  "number": "+79918397701",
  "sender": "OKru",
  "message": "текст смс",
  "time_start": "2023-04-26 12:37:55",
  "time_left": "880",
  "operation_id": "91763432",
  "webhook_type": "receiving_sms",
  "code": "612045"
}

Your server response

200

Your server should respond with HTTP 200 OK to acknowledge receipt