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-Type
application/jsonSchema
schemaobject
actionstringRequired
Method name, in this case GET_NUMBEREnum:GET_NUMBERExample:GET_NUMBERcountrystringRequired
Country name from the country listExample:germanyoperatorstringRequired
Operator name: any if your GET_SERVICES answer has the any operator, otherwise one of the operators you listed for the countryExample:anyservicestringRequired
Service name from the service list (a value of services, e.g. fb)Example:fbsumnumberRequired
Your income for the operation, in RUB: credited to your OnlineSIM account when the operation is closed with an SMS receivedExample:40keystringRequired
API key of your OnlineSIM partner profileExample:apikeyExamples
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-Type
application/jsonSchema
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:79088081050activationIdinteger
Required with SUCCESS. Operation ID assigned by your server; OnlineSIM reads it as an integer and sends it back in FINISH_ACTIVATION≥ 1Example:355statusstringRequired
Request status:
SUCCESS- the number is issued;NO_NUMBERS- no available numbers;- any other value (e.g.
ERROR) - an error.
SUCCESS OnlineSIM tries the next partner.Enum:SUCCESSNO_NUMBERSERRORExample:SUCCESSExamples
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...