getRentStatus


URL

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

Example

  • javascript
    var settings = {
        "async": true,
        "crossDomain": true,
        "url": "https://api-conserver.onlinesim.ru/stubs/handler_api.php?api_key=APIKEY&action=getRentStatus&id=123",
        "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=getRentStatus&id=123",
        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 SMS recieved on rented phone number.

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

Result

After successeful execution you will get the following JSON response:

{
  "status": "success",
  "quantity":2,
  "values": {
    "0": {
      "phoneFrom": "+79000000000",
      "text": "txt_sms",
      "service": "+79100000001",
      "date": "2021-02-02T13:46:49+03:00"
    },
    "1": {
      "phoneFrom": "+79000000000",
      "text": "txt_sms2",
      "service": "@twitter",
      "date": "2021-02-02T14:46:49+03:00"
    },
    ...
  }
}
Result Description
status method execution status
quantity quantity of SMS recieved on rented phone number
values array of SMS data
values.[n].phoneFrom phone number which SMS was sent
values.[n].text SMS text
values.[n].service sender's phone number
values.[n].date date when SMS was recieved

Private method errors

Possible errors in JSON format.

{ 
    "status": "error", 
    "message": "*error_code*" 
} 
error_code Description
INVALID_PHONE rent ID is wrong or doesn't exist
STATUS_WAIT_CODE rent number is not activated, no SMS received