Onlinesim will send a request to your URL

↓ GEThttps:///newSms

Webhook get-v2-profile-api

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.

Security

OAuth2Scopes: sms-scope, rent-scope
sms-scope
grants access to manage numbers for the SMS receiving service from Onlinesim
rent-scope
grants access to renting phone numbers from Onlinesim

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 of the number, that has received SMS

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 time for the operation

operation_idstring

Operation ID

webhook_typeobject

Type of service (single service activations or rent)

Enum:receiving_smsrent_sms
codestring

SMS ID

Examples

Example 1

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