Activation Status Change

The setStatus method allows you to manage the activation state of a virtual number via the SMS.online API. It is used to change the current status of the number in the system, such as when completing activation or canceling the use of the number.

This method is useful for automating processes related to managing virtual numbers, enabling real-time updates of activation status.

After a successful request, the system updates the number's status, including information about successful activation, cancellation, or other operations related to the number's use. This helps maintain the current activation state in integrated systems.

Example Request:

Input Data

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

What status to send when?

Immediately after receiving the number, it is waiting for SMS.

You can perform the following actions:

8 - Cancel activation

Right after receiving the code:

3 - Request another SMS

6 - Confirm SMS code and complete activation

For activation with status 3:

6 - Confirm SMS code and complete activation

Server Response

Server ResponseDescription
Awaiting reactivation
Activation completed successfully
Activation canceled

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 status = 1; # Insert the new status from the table above
try {
const response = await fetch(`https://api.sms.onlinestubs/handler_api.php?api_key=${api_key}&action=setStatus&id=${id}&status=${status}`);
# 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 API key
Invalid action
Error in query
Time until account is unbanned
Account is inactive
Cannot cancel the number in the first 2 minutes
Activation not found
Invalid status
Invalid ID or ID is not a number.