Renewing Your Virtual Number Rental

The continueRentNumber method is used to extend the rental period of a virtual number via the SMS.online API. It automates the renewal process, ensuring uninterrupted access to your rented number for receiving SMS without the risk of losing it.

This method is designed for situations where you need to keep using the same number for an extended time. You can specify the renewal period, after which the system will update the rental duration and provide confirmation of the successful renewal.

A successful request returns an object with information about the updated rental, including the number ID, new rental duration, and the amount charged. This ensures stable SMS reception throughout the extended period.

Example Request:

Input Data

ParameterRequiredNoteDescription
YesSee in profile settings API KeyAPI key provides access to paid services
YescontinueRentNumberMethod name
YesNumeric valueActivation ID obtained when requesting the number
Yes4, 8, 12, 24, 72, 168, 360, 720, 2160Rental time in hours

Server Response

JSON
{
  "status": "success",
  "phone": {
    "id": 1049,
    "endDate": "2020-01-31T12:01:52",
    "number": "79959707564"
  }
}

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
const rent_time = 1; # Insert the extension time in hours from the table above
try {
const response = await fetch(`https://api.sms.onlinestubs/handler_api.php?api_key=${api_key}&action=continueRentNumber&id=${id}&rent_time=${rent_time}`);
# 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)
Invalid extension time
Balance not found
Missing or incorrectly specified status