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
Parameter | Required | Note | Description |
---|---|---|---|
Yes | See in profile settings API Key | API key provides access to paid services | |
Yes | setStatus | Method name | |
Yes | Numeric value | Activation ID obtained when requesting the number | |
Yes | Numeric value | Activation 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 Response | Description |
---|---|
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 numberconst status = 1; # Insert the new status from the table abovetry {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 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 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. |