getCountries


URL

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

Example

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

Result

After successeful execution you will get the following JSON response:

{
  "7": {
    "id": 7,
    "rus": "Россия",
    "eng": "Russia",
    "chn": "俄罗斯",
    "visible": 1,
    "retry": 0,
    "rent": 1,
    "multiService": 0
  },
  ...
} 
Result Description
id country id
rus name of a country in Russian
eng name of a country in English
chn name of a country in Chinese
visible 0 - country is NOT displayed on site, 1 - is displayed
retry 0 - SMS resending is NOT availabe, 1 - is available
rent 0 - country is NOT available for order, 1 - is available
multiService 0 - country is NOT available for multiservice, 1- is available