single-service activations

Buy a number for a service

GEThttps://onlinesim.io/stubs/handler_api.php?action=getNumber

Orders a number of the country for receiving SMS from the service. The price is reserved on the balance. The answer gives the operation ID (id of getStatus, getFullSms and setStatus) and the number with the country code.

Errors:

  • BAD_COUNTRY — country is not in getCountries, or is not a number
  • WRONG_SERVICE — service is missing or not sold in this country
  • NO_BALANCE — not enough money on the balance
  • NO_NUMBERS — no numbers for this service and country now (also when all are excluded by phoneException)
  • WARNING_WAIT15MIN — too many operations without SMS are open
  • and the common errors

Security

Parameters

query4
NameTypeDescription
action*string

Method name: getNumber

Enum:getNumber
service*string

Service code: the key of getNumbersStatus without _0 (e.g. go for Google), or an Onlinesim service slug

Example:go
countryinteger
≥ 0

Country ID from getCountries (id). Without it or 0: Russia

Default:0Example:16
phoneExceptionstring

Number prefixes (with the country code) that must not be issued: a comma separated list (phoneException=4479,4475) or an array (phoneException[]=4479&phoneException[]=4475)

Example:4479,4475

Responses

200ACCESS_NUMBER:<operation ID>:<number> or an error
Content-Typetext/plain
Schema
schemaoneOf
One Of
[0]string
Pattern:^ACCESS_NUMBER:\d+:\d+$
[1]string
Enum:BAD_COUNTRYWRONG_SERVICENO_BALANCENO_NUMBERSWARNING_WAIT15MIN
[2]string
Error answered as text by every action (also by the JSON ones):
  • BAD_KEY — the API key is wrong or missing
  • BANNED — the account is blocked
  • BAD_ACTION — unknown action or an error without its own code (for example a temporary error or too many concurrent requests); check the request and repeat it later
  • Too many requests. Please wait a moment before trying again. — the converter's limit of getNumber, getRentNumber, setStatus and setRentStatus (3 requests per second, 150 per 30 seconds)
Enum:BAD_KEYBANNEDBAD_ACTIONToo many requests. Please wait a moment before trying again.

Examples

number

Number issued

ACCESS_NUMBER:65904893:447400123456
noNumbers

No numbers now

NO_NUMBERS
noBalance

Not enough money

NO_BALANCE

Code Samples

Generating examples...