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—countryis not in getCountries, or is not a numberWRONG_SERVICE—serviceis missing or not sold in this countryNO_BALANCE— not enough money on the balanceNO_NUMBERS— no numbers for this service and country now (also when all are excluded byphoneException)WARNING_WAIT15MIN— too many operations without SMS are open- and the common errors
Security
Parameters
query4
| Name | Type | Description |
|---|---|---|
action* | string | Method name: Enum: getNumber |
service* | string | Service code: the key of getNumbersStatus without Example: go |
country | integer≥ 0 | Country ID from getCountries ( Default: 0Example:16 |
phoneException | string | Number prefixes (with the country code) that must not be issued: a comma separated list
( Example: 4479,4475 |
Responses
200ACCESS_NUMBER:<operation ID>:<number> or an error
Content-Type
text/plainSchema
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 missingBANNED— the account is blockedBAD_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 laterToo 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)
BAD_KEYBANNEDBAD_ACTIONToo many requests. Please wait a moment before trying again.Examples
number
Number issued
ACCESS_NUMBER:65904893:447400123456noNumbers
No numbers now
NO_NUMBERSnoBalance
Not enough money
NO_BALANCECode Samples
Generating examples...