setRentStatus


URL

http://api-conserver.onlinesim.ru/stubs/handler_api.php?api_key=APIKEY&action=setRentStatus&id=$id&status=$status

Example

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

Method allows to finish phone number rent.

Parameters

Parameter name Data type Description Required
id INT ID of phone number rent, is received after phone number order, also displayed in the active rents list yes
status CONST gets only value equals to 2, else raises an error yes

Result

After successeful execution you will get the following JSON response:

{
  "status": "success"
}
Result Description
status method execution status

Private method errors

Possible errors in JSON format.

{ 
    "status": "error", 
    "message": "*error_code*" 
} 
error_code Description
NO_ID_RENT rent ID is wrong or doesn't exist