getRentList


URL

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

Example

  • javascript
    var settings = {
        "async": true,
        "crossDomain": true,
        "url": "https://api-conserver.onlinesim.ru/stubs/handler_api.php?api_key=APIKEY&action=getRentList",
        "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=getRentList",
        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 phone numbers ordered for rent with all active numbers including unactivated numbers, if the activation period has not expired.

Result

After successeful execution you will get the following JSON response:

{
  "status": "success",
  "values": {
    "0": {
      "id": "123",
      "phone": "89000000000"
    },
    ...
  }
}
Result Description
status method execution status
values array of phone numbers rent data
values.[0].id ID of phone number rent
values.[0].phone phone number ordered for rent

Private method errors

Possible errors in JSON format.

{
  "status": "error",
  "message": "*error_code*"
}
error_code Description
NO_NUMBERS no rented or booked phone numbers for activation