post{yourserver}/getNumber

POST /getNumber

Order a virtual number for the specified service

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

This request is sent to your server to order a number with specific parameters to receive SMS from a single service for short period (default is 15 minutes).

The operation can be closed prematurely (check FINISH_ACTIVATION).

Parameters

header2
NameTypeDescription
Authorization*string

see more here

Content-Type*string

Content type header and encoding scheme

Enum:application/json; charset=utf-8

Request Body

Request payload from Onlinesim server

Content-Typeapplication/json
Schema
Bodyobject
actionstringRequired

Method name, in this case GET_NUMBER

Enum:GET_NUMBERDefault:GET_NUMBER
countrystringRequired

'Country name, enum (country list)'

operatorstringRequired

'Operator name (for examples take a look at operator list)'

servicestringRequired

'Service name, enum (service list)'

sumnumberRequired

Service price, in RUB (this sum will be credited to your Onlinesim account after successful operation)

keystringRequired

API key of your Onlinesim partner's profile

exceptionPhoneSetinteger[]

List of exception prefixes that SHOULD NOT be issued when the number is requested. Format: country code + following digits of a number.

itemsinteger

Examples

Example payload of Onlinesim server GET_NUMBER request
{
  "action": "GET_NUMBER",
  "country": "russia",
  "operator": "any",
  "service": "vk",
  "sum": 40,
  "key": "apikey"
}

Responses

200

The response of your server for GET_NUMBER request must be in following format:

Content-Typeapplication/json

Headers

NameTypeDescription
Content-Typestring

Content type header and encoding scheme

Schema
Responseobject
numberintegerRequired

Phone number in international format according to the requested parameters

activationIdintegerRequired

Operation ID (assigned by your server)

≥ 1
statusstringRequired

Request status (SUCCESS - when number is successfully issued, NO_NUMBERS - when there are no available numbers, ERROR - for other errors)

Enum:SUCCESSNO_NUMBERSERROR

Examples

Successful response example from your server
{
  "number": 79281234567,
  "activationId": 355,
  "status": "SUCCESS"
}
No available numbers response example from your server
{
  "number": null,
  "activationId": null,
  "status": "NO_NUMBERS"
}
Response example from your server in case of other types of errors
{
  "number": null,
  "activationId": null,
  "status": "ERROR"
}

Code Samples

Generating examples...