v1

Order a virtual number for the specified service

POST{yourserver}/getNumber

Request for ordering a number for SMS receiving from a specified service.

This request is sent to your server when a client orders a number to receive SMS from one service for a short period (15 minutes by default; the period depends on the service).

The operation can be closed prematurely (see FINISH_ACTIVATION).

Request Body

Request payload from the OnlineSIM server

Content-Typeapplication/json
Schema
schemaobject
actionstringRequired
Method name, in this case GET_NUMBEREnum:GET_NUMBERExample:GET_NUMBER
countrystringRequired
Country name from the country listExample:germany
operatorstringRequired
Operator name: any if your GET_SERVICES answer has the any operator, otherwise one of the operators you listed for the countryExample:any
servicestringRequired
Service name from the service list (a value of services, e.g. fb)Example:fb
sumnumberRequired
Your income for the operation, in RUB: credited to your OnlineSIM account when the operation is closed with an SMS receivedExample:40
keystringRequired
API key of your OnlineSIM partner profileExample:apikey

Examples

request

GET_NUMBER request from the OnlineSIM server

{
  "action": "GET_NUMBER",
  "country": "russia",
  "operator": "any",
  "service": "vk",
  "sum": 40,
  "key": "apikey"
}

Responses

200The answer of your server to GET_NUMBER
Content-Typeapplication/json
Schema
schemaobject
numberinteger | string
Required with SUCCESS. Issued phone number in international format with the country code, digits only (a JSON number or a string of digits)Example:79088081050
activationIdinteger
Required with SUCCESS. Operation ID assigned by your server; OnlineSIM reads it as an integer and sends it back in FINISH_ACTIVATION≥ 1Example:355
statusstringRequired
Request status:
  • SUCCESS - the number is issued;
  • NO_NUMBERS - no available numbers;
  • any other value (e.g. ERROR) - an error.
On anything but SUCCESS OnlineSIM tries the next partner.
Enum:SUCCESSNO_NUMBERSERRORExample:SUCCESS

Examples

success

The number is issued

{
  "number": 79281234567,
  "activationId": 355,
  "status": "SUCCESS"
}
noNumbers

No available numbers

{
  "status": "NO_NUMBERS"
}
error

Any other error

{
  "status": "ERROR"
}

Code Samples

Generating examples...