The recommended workflow to automate number rental and release with SMSVerifier API involves registering, renting a number via the API, polling for the OTP SMS, then releasing the number promptly to optimize costs and throughput.
API Registration and Authentication
Before automating number rental and release, you need to create an account on SMSVerifier and obtain your unique API key. This key authenticates your requests and keeps your usage secure.
Your API key is your authentication token; keep it confidential and never expose it in client-side code.
Once registered, all API calls require this key as a query parameter or header for authorization. Here is a simple example of checking your account balance to verify your API key:
curl "https://smsverifier.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getBalance"
import requests
r = requests.get("https://smsverifier.com/stubs/handler_api.php", params={"api_key":"YOUR_API_KEY","action":"getBalance"})
print(r.text)const r = await fetch("https://smsverifier.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getBalance");
console.log(await r.text());Automated Number Rental Process
After authentication, the next step is to rent a virtual phone number. The rental API endpoint requires parameters for the service (e.g. WhatsApp, Google), country, and optionally other filters like operator or region.
The API responds with a rented number and a unique rental ID for tracking.
Example API call to rent a number:
curl "https://smsverifier.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getNumber&service=whatsapp&country=us"
Always store the returned rental ID and phone number together to manage polling and releasing properly.
Polling for OTP SMS
Once the number is entered on the target site/app, the next step is to wait for the OTP SMS. The SMSVerifier API provides endpoints to check the status and retrieve the SMS text.
Poll the API periodically (e.g., every 5-10 seconds) using the rental ID until the OTP arrives or a timeout occurs.
Avoid excessive polling frequency to prevent request bans or rate limiting.
Example polling request:
curl "https://smsverifier.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getStatus&id=RENTAL_ID"
The response will indicate if the SMS is received and provide the OTP code.
Releasing and Managing Numbers
After successfully obtaining the OTP, or if no SMS arrives within the set timeout (usually 20 minutes), release the number to free it up and avoid unwanted charges.
Use the release API endpoint with the rental ID to mark the number as released.
curl "https://smsverifier.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=setStatus&status=cancel&id=RENTAL_ID"
Prompt releasing guarantees refunds if no SMS was received during the rental period.
If managing multiple concurrent rentals, maintain a data structure mapping rental IDs to numbers and statuses, periodically polling and releasing as appropriate.
Best Practices and Common Pitfalls
Throttle API calls
Implement delays between polling requests to respect API rate limits and avoid bans.
Track rental IDs
Keep detailed logs of rental IDs, numbers, timestamps, and statuses for troubleshooting and auditing.
Set timeouts
Automatically release numbers after a defined timeout if no SMS arrives to optimize credit usage.
Handle errors gracefully
Check API error codes and implement retries or notifications for failures or expired rentals.
Frequently asked questions
How do I start renting numbers via SMSVerifier API?
What is the typical sequence to automate OTP receiving and number release?
Can I automate releasing numbers to avoid extra charges?
How do I handle multiple concurrent rentals efficiently?
What are common errors to watch for during automation?
Is there a way to test the rental and OTP flow before going live?
Ready to automate your number rentals?
Register and get your API key now to start renting and releasing virtual numbers efficiently with SMSVerifier.
Read the API docs