URL
https://onlinesim.io/api/getFreeCountryList
Список стран для беслатных номеров
Пример
- javascript
var settings = {
"async": true,
"crossDomain": true,
"url": "https://onlinesim.io/api/getFreeCountryList",
"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/getFreeCountryList",
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));
После успешного выполнения будет получен ответ в формате JSON, в следующем виде:
json {response: 1, countries: [{country: 1,country_text: "english"}, {country: 7,country_text: "russia"}, {country: 46,country_text: "english"}]}
Результат | Описание |
---|---|
response | 1, если запрос выполнен успешно, либо сообщение об ошибке; |
countries | список стран |