Accessing Activation History

The getHistory method is used to retrieve the history of all activations of virtual numbers associated with your account through the SMS.online API. It automates the process of analyzing completed activations and monitoring service expenses.

This method provides detailed information for each activation, including the date, phone number, received SMS codes, cost, and current status. It simplifies tracking number usage and controlling costs.

A successful request returns a structured list of activations with detailed data: unique activation ID, creation date, phone number, list of received SMS messages, cost (0 for active ones), and activation status. This method is suitable for analytics and expense management systems.

Example Request:

Input Data

ParameterRequiredNoteDescription
YesSee in profile settings API KeyAPI key provides access to paid services
YesgetHistoryMethod name
NoTimestamp in Unix Timestamp formatFrom which date to take activations (limited to 30 days)
NoTimestamp in Unix Timestamp formatUntil which date to take activations (limited to 30 days)
NoNumeric valueOffset of the first element returned in the response (default is 0)
NoNumeric valueNumber of elements returned in the response (default is 50, maximum 100)

Server Response

JSON
[
  {
    "id": 635468024,
    "date": "2022-11-12 15:58:39",
    "phone": "79918529716",
    "sms": "["Your sms code"]",
    "cost": 100
    "status": "4"
  }
]

Example Code

const api_key = "API_KEY"; # Replace 'API_KEY' with your actual API key.
try {
const response = await fetch(`https://api.sms.onlinestubs/handler_api.php?api_key=${api_key}&action=getHistory`);
# 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
Invalid date