getRentServicesAndCountries


URL

http://api-conserver.onlinesim.ru/stubs/handler_api.php?api_key=APIKEY&action=getRentServicesAndCountries&country=7

Example

  • javascript
    var settings = {
        "async": true,
        "crossDomain": true,
        "url": "https://api-conserver.onlinesim.ru/stubs/handler_api.php?api_key=APIKEY&action=getRentServicesAndCountries&country=7",
        "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://api-conserver.onlinesim.ru/stubs/handler_api.php?api_key=APIKEY&action=getRentServicesAndCountries&country=7",
        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));

Getting a list of countries available for rent with rent details.

Parameters

Parameter name Data type Description Required
country INT code of country available for rent yes

Result

After successeful execution you will get the following JSON response:

{
  "countries": {
    "0": 7,
    "1": 380,
    ...
  },
  "operators": {
    "0": "any"
  },
  "services": {
    "full": {
      "quant": 301,
      "cost": 1.25
    }
  }
}

If "country" parameter is missing or country is not available then:

{
  "countries": {
    "0": 7,
    "1": 380,
    ...
  },
  "operators": {
    "0": "any"
  },
  "services": {
    "full": {}
  }
}
Result Description
countries list of countries available for rent in JSON format
operators list of cell operators in JSON format
services list of services with details in JSON format
services.service.quant quantity of phone numbers available for service
services.service.cost rent price per hour