What the API is for
If your app or test suite has a verification step, you do not have to copy numbers and codes by hand. With the API you pick a service and country, buy a number, read the code and finish the order. It is used for test automation, managing several accounts and building integrations.
Authentication
Create an API key in your dashboard and send it in the `X-API-Key` header on every request. Keep the key on your server and never put it in browser or mobile app code. Regenerating the key immediately invalidates the old one.
Example: the number purchase flow
The basic flow has three calls. The base URL is `https://authsms.net/api/v1`:
curl -H "X-API-Key: YOUR_KEY" "https://authsms.net/api/v1/offers?service=wa"
curl -X POST -H "X-API-Key: YOUR_KEY" -H "Content-Type: application/json" \
-d '{"service":"wa","country":"62"}' https://authsms.net/api/v1/numbers
curl -H "X-API-Key: YOUR_KEY" https://authsms.net/api/v1/numbers/NUMBER_IDKey features
- One-time numbers: buy, wait for the code, finish. Automatic refund if no SMS arrives.
- Several SMS on the same number, and the option to buy the same number again.
- Rentals for hours, days or weeks, with extension.
- Signed webhooks so you do not have to poll for the code.
- Price and stock endpoints need no authentication.