Active Rented Numbers List

The getRentList method is used to fetch the current list of all rented virtual numbers linked to your account through the SMS.online API. It allows real-time tracking of active rentals and resource usage.

The method returns detailed information for each rental, including a unique rental ID, start date, duration, current status, phone number, and rental cost. This simplifies the management of active numbers and enables timely renewals or terminations.

This method is especially useful for automation, analytics, and monitoring systems where only current rented numbers are needed, without the history of completed sessions.

Example Request:

Input Data

ParameterRequiredNoteDescription
YesSee in profile settings API KeyAPI key provides access to paid services
YesgetRentListMethod name
YesNumeric valueRental ID obtained when requesting the number

Server Response

JSON
{
  "status": "success", 
  "values": [
    { 
      "id": "12345", 
      "phone": "79181234567",
      "price": "100",
      "hours": "4"
    }, 
    { 
      "id": "12345", 
      "phone": "79181234568",
      "price": "100",
      "hours": "4"
    } 
  ]
}

Example Code

const api_key = "API_KEY"; # Replace 'API_KEY' with your actual API key.
const id = 1; # Insert the activation ID obtained when requesting the number
try {
const response = await fetch(`https://api.sms.onlinestubs/handler_api.php?api_key=${api_key}&action=getRentList&id=${id}`);
# Make a GET request to the specified URL
const data = await response.json();
# Output the content of the server response
console.log(data);
} catch (err) {
# If an error occurred, output the error message
console.error(err);
}

Possible Errors

ParameterDescription
Invalid action
Invalid API key
Error in query
Time until account is unbanned
Account is inactive
Rental ID not specified