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
Parameter | Required | Note | Description |
---|---|---|---|
Yes | See in profile settings API Key | API key provides access to paid services | |
Yes | getRentList | Method name | |
Yes | Numeric value | Rental 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 numbertry {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 URLconst data = await response.json();# Output the content of the server responseconsole.log(data);} catch (err) {# If an error occurred, output the error messageconsole.error(err);}
Possible Errors
Parameter | Description |
---|---|
Invalid action | |
Invalid API key | |
Error in query | |
Time until account is unbanned | |
Account is inactive | |
Rental ID not specified |