URL
http://api-conserver.onlinesim.ru/stubs/handler_api.php?api_key=APIKEY&action=getNumber&service=$service&country=$country&phoneException=$phoneException
Example
- javascript
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api-conserver.onlinesim.ru/stubs/handler_api.php?api_key=APIKEY&action=getNumber&service=vk&country=7&phoneException=910",
"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=getNumber&service=vk&country=7&phoneException=910",
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));
Ordering phone number for SMS activation with selected service.
Parameter name | Data type | Description |
---|---|---|
service | TXT | service name |
country | INT | country code, default is 7 if country code is missing or not found |
phoneException | INT/ARRAY | exception of phone numbers starting with the value. 910 - excepts all phone numbers starting with 910. [910,920] - except all numbers starting with 910, 920 |
After successful execution you will get the following TXT response:
ACCESS_NUMBER:$id:$number
Result | Description |
---|---|
id | ID of phone number booked fir activation |
number | booked phone number |
Possible errors in JSON format.
{
"status": "error",
"message": "*error_code*"
}
Possible errors in TXT format.
*error_code*
error_code | Type | Description |
---|---|---|
NO_BALANCE |
JSON | not enough money on the balance to finish the operation |
WRONG_SERVICE |
TXT | service is missing/wrong |
NO_NUMBERS |
TXT | no phone numbers available for the selected service |