getNum


URL

https://onlinesim.io/api/getNum.php?apikey=APIKEY&service=VKcom

It makes a request for a virtual number, creates an operation (saves the list of request parameters).

Example

  • javascript
    var settings = {
        "async": true,
        "crossDomain": true,
        "url": "https://onlinesim.io/api/getNum.php?apikey=APIKEY&service=VKcom",
        "method": "GET",
        "headers": {"accept": "application/json"}
    }
    $.ajax(settings).done(function (response) {
        console.log(response);
    });
  • php
    $curl = curl_init();
    curl_setopt_array($curl, array(
        CURLOPT_URL => "https://onlinesim.io/api/getNum.php?apikey=APIKEY&service=VKcom",
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_SSL_VERIFYHOST => false,
        CURLOPT_SSL_VERIFYPEER => false,
        CURLOPT_HTTPHEADER => [
            "Content-Type: application/json",
        ]
    ));
    $response = curl_exec($curl);
    curl_close($curl);
    var_dump(json_decode($response, true));

Parameters

Name of parameter Parameter Type of data Description
service required TEXT defines the website (service), which the SMS will be expected and displayed from. see getNumbersStats
region non-required INT Without parameter - any region
78 - St. Petersburg
77 - Moscow
country non-required INT Without parameter - 7
see getNumbersStats
reject non-required ARRAY Array mask reject, Example: [911,912123] reject all numbers, start at 911 and 912123.
extension non-required INT Without parameter - 7
Extension of the number.
3 or 0 - without Extension.
2 - extension for a month
dev_id non-required INT account id for software developers.
number non-required BOOL If you pass this parameter, the query will return the number.

Services

You can find out the list of countries and services through the request see getNumbersStats

If Other is selected, the incoming SMSs will not be filtered, therefore if the required service is absent in the list, the sender's name has to be transmitted, for example if the SMS is received from Gett, service=Gett. You can see the list of popular senders in your account, in the All Services block, the drop-down list next to the Add button.

Result

After the successful completion, you will get a response in the JSON format, in the following form:

json {response:RESPONSE, tzid:TZID}

Result Description
response 1, if the request has been completed successfully, or an error message
tzid Operation ID

RESPONSE

Result Description
EXCEEDED_CONCURRENT_OPERATIONS maximum quantity of numbers booked concurrently is exceeded for your account
WARNING_LOW_BALANCE Not enough funds to buy the service
NO_NUMBER temporarily no numbers available for the selected service
TIME_INTERVAL_ERROR delayed SMS reception is not possible at this interval of time
INTERVAL_CONCURRENT_REQUESTS_ERROR maximum quantity of concurrent requests for number issue is exceeded, try again later
ERROR_NO_SERVICE service is not specified
TRY_AGAIN_LATER temporarily unable to perform the request
NO_FORWARD_FOR_DEFFER forwarding can be activated only for online reception
NO_NUMBER_FOR_FORWARD there are no numbers for forwarding
ERROR_LENGTH_NUMBER_FOR_FORWARD wrong length of the number for forwarding
DUPLICATE_OPERATION adding operations with identical parameters

Testing

/demo/api/getNum.php?apikey=APIKEY&service=VKcom

The method will return generated test data. To test errors, forward the required error as the err parameter. For example, err=EXCEEDED_CONCURRENT_OPERATIONS