Get Rental Status of Your Number

The getRentStatus method is used to retrieve the current status of your rented virtual number through the SMS.online API. It automates the process of checking rental status and tracking incoming SMS codes to the rented number.

This method is designed for systems that require regular monitoring of the rented number to receive confirmation codes and other data promptly during the rental period.

A successful request returns an object with information about the current rental status, including a unique rental ID, a list of received SMS codes, and the rental expiration time. This allows for effective management of number usage and real-time message retrieval.

Example Request:

Input Data

ParameterRequiredNoteDescription
YesSee in profile settings API KeyAPI key provides access to paid services
YesgetRentStatusMethod name
YesNumeric valueActivation ID obtained when requesting the number
NoNumeric valuePage number to start fetching from (page numbering starts at 0, from new to old; default is 0)
NoNumeric valueNumber of pages requested (default is 10)

Server Response

JSON
{
  "status": "success", 
  "quantity": "2", 
  "values": { 
    "0": { 
      "phoneFrom": "79180230628", 
      "text": "5", 
      "service": "ot", 
      "date": "2020-01-30 14:31:58" 
    }, 
    "1": { 
      "phoneFrom": "79180230628", 
      "text": "4", 
      "service": "ot", 
      "date": "2025-05-30 14:04:16" 
    } 
  } 
}

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=getRentStatus&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
Number rented by someone else (incorrect rental ID)
Rental paid and completed
Rental canceled with refund
Waiting for the first SMS
Number blocked, funds returned