How to use the SMSPool API
- By Admin
What is an API?
An API (application programming interface) can easily communicate with our servers. You can connect it to your desired program and create your functionality within our APIs using the API.
How do I use the SMSPool API?
Our endpoint is usually: https://api.smspool.net/ and is free of charge to use. It does not cost any money. SMSPool will provide you with a 32-character long API key attached to all your purchases, orders, and rentals upon registering. Please do NOT share this with anyone, as it could give users access to all your orders and balance.
All API requests can be done in both GET or POST, unless said otherwise and all responses are in JSON
What are the API endpoints?
All API endpoints are listed below, and it's listed logically from step one to get your SMS verifications.
Overview
List of all informative endpoints
Country endpoint - https://api.smspool.net/country/retrieve_all
Param | Required | Comment |
---|---|---|
country | No | Use either the country number or country code required to retrieve services by country. |
Responses
Success | [{"ID":"1","name":"United States","region":"Americas"}] |
Service endpoint - https://api.smspool.net/service/retrieve_all
Param | Required | Comment |
---|---|---|
country | No | Use either the country number or country code required to retrieve services by country. |
Responses
Success | [{"ID":"1","name":"1688"},{"ID":"2","name":"1Q"}] |
Balance endpoint - https://api.smspool.net/request/balance
Param | Required | Comment |
---|---|---|
key | Yes | Your 32-character API key |
Responses
Success | {"balance":"1.00"} |
Order history endpoint - https://www.api.smspool.net/request/history
Param | Required | Comment |
---|---|---|
key | Yes | Your 32-character API key |
Responses
Success | {[Array of all orders]} |
My active orders endpoint - https://api.smspool.net/request/active
Param | Required | Comment |
---|---|---|
key | Yes | Your 32-character API key |
Responses
Success | [{"timestamp":"2022-05-24 21:20:07","order_code":"ABCDEFGH","phonenumber":"123456789","code":"0","full_code":"0","short_name":"US","service":"Service","status":"pending","expiry":"1653420607"}] |
Price endpoint - https://api.smspool.net/request/price
Param | Required | Comment |
---|---|---|
key | Yes | Your 32-character API key |
country | Yes | The country code/ID that you can retrieve from the country endpoint |
service | Yes | The service ID/name that you can retrieve from the service endpoint |
Responses
Success | {"price":"0.75"} |
Fail | {"success":0,"message":"Fill in all params!"} |
Fail | {"success":0,"message":"No price was found for this query.","price":0} |
Price endpoint - https://api.smspool.net/request/price
Param | Required | Comment |
---|---|---|
key | Yes | Your 32-character API key |
country | Yes | The country code/ID that you can retrieve from the country endpoint |
service | Yes | The service ID/name that you can retrieve from the service endpoint |
Responses
Success | {"price":"0.75"} |
Fail | {"success":0,"message":"Fill in all params!"} |
Fail | {"success":0,"message":"No price was found for this query.","price":0} |
Suggested countries endpoint - https://api.smspool.net/request/suggested_countries
Param | Required | Comment |
---|---|---|
service | Yes | The service ID/name that you can retrieve from the service endpoint |
Responses
Success | [{"pool":1,"country_id":1,"name":"United States","short_name":"US","price":"0.31"},{"pool":7,"country_id":2,"name":"United Kingdom","short_name":"GB","price":"0.10"}] |
List of all endpoints for ordering
Order SMS endpoint - https://api.smspool.net/purchase/sms
Orders that do not receive an SMS will be refunded automatically.
Param | Required | Comment |
---|---|---|
key | Yes | Your 32-character API key |
country | Yes | The country code/ID that you can retrieve from the country endpoint |
service | Yes | The service ID/name that you can retrieve from the service endpoint |
pool | No | The pool you'd like to order from is not required, in case it's empty it'll automatically select a suitable pool. Pools can be selected by number or by name (for example Alpha) |
max_price | No | Set the max price of your order |
pricing_option | No | Set the pricing option of your order, 0 = highest success rate, 1 = cheapest option |
area_code | No | Set the area code for your order, works for pool Foxtrot (7) |
Responses
Success | {"success":1,"number":"123456789","order_id":"ABCDEFG","country":"United States","service":"Service","pool":5,"expires_in":599,"message":""} |
Fail | {"success":0,"message":"This country is currently not available for this service, please try the following countries: "} |
Fail | {"success":0,"message":"Insufficient balance, the price is: 0.85 while you only have: 0.00"} |
Fail | {"success":0,"errors":[{"message":"Missing or invalid param: country"},{"message":"Missing or invalid param: service"},{"message":"Missing or invalid param: key","description":"Your API key which can be found on your settings page at /my/settings"}]} |
Fail | {"success":0,"message":"This service is not available for this country."} |
Fail | {"success":0,"message":"Something went horribly wrong, try again please!"} |
Check SMS endpoint - https://api.smspool.net/sms/check
Param | Required | Comment |
---|---|---|
key | Yes | Your 32-character API key |
orderid | Yes | The `order_id` you received from the Order SMS endpoint |
Responses
Success | {"status":1,"message":"pending","resend":0,"expiration":1669382268} |
Success | {"status":2,"message":"expired","resend":0,"expiration":1669382268} |
Success | {"status":3,"sms":"00000","full_sms":"full SMS","expiration":1669382268} |
Success | {"status":4,"message":"resend","resend":0,"expiration":1669382268} |
Success | {"status":5,"message":"cancelled","resend":0,"expiration":1669382268} |
Success | {"status":6,"message":"refunded","resend":0,"expiration":1669382268} |
Fail | {"success":0,"message":"We could not find this order!"} |
Resend SMS endpoint - https://api.smspool.net/sms/resend
Param | Required | Comment |
---|---|---|
key | Yes | Your 32-character API key |
orderid | Yes | The `order_id` you received from the Order SMS endpoint |
Responses
Success | {"success":1,"message":"Number has been requested again","resend":0} |
Fail | {"success":0,"message":"Phonenumber could not be requested again, try later again.","resend":0} |
Cancel SMS endpoint - https://api.smspool.net/sms/cancel
Param | Required | Comment |
---|---|---|
key | Yes | Your 32-character API key |
orderid | Yes | The `order_id` you received from the Order SMS endpoint |
Responses
Success | {"success":1} |
Fail | {"success":0} |
Archive SMS orders endpoint - https://www.api.smspool.net/request/archive
Param | Required | Comment |
---|---|---|
key | Yes | Your 32-character API key |
Responses
Success | {"success":1,"message":"All your inactive orders have been archived."} |
Rental endpoints
Retrieve all rentals - https://api.smspool.net/rental/retrieve_all
Param | Required | Comment |
---|---|---|
key | No | Your 32-character API key, is only required if you want to see prices specifically for your account. |
type | Yes | Choose whether the rental is extendable or not |
Responses
Success | {"0":{"name":"United States","region":"Americas","pricing":"{\"7\":18,\"14\":25,\"30\":30}"}} |
Fail | {"success":0,"message":"Fill in all params! [GET: type, key (optional)]"} |
The 0 represents the rental ID, this is the ID you need to select in order to order this specific rental.
Order rental - https://api.smspool.net/purchase/rental
Param | Required | Comment |
---|---|---|
key | Yes | Your 32-character API key |
id | Yes | The rental ID was retrieved from the "Retrieve all rentals" endpoint. |
days | Yes | The number of days you'd like to rent for |
service_id | No | Specify a service ID to only purchase a line for that service and get 50% off. Only works for US extendable rentals. |
Responses
Success | {"success":1, "message": "", "phonenumber": "123456789", "days": 30, "rental_code":"ABCDEFG", "expiry":"1653758381"} |
Fail | {"success":0,"message":"The service you entered is not available!"} |
Fail | {"success":0,"message":"You do not have enough balance, please top up your account with 0.00 dollars in order to purchase this rental."} |
Fail | {"success":0,"message":"Something has gone wrong, please try later again."} |
Fail | {"success":0,"message":"You selected a invalid amount of days! The following days are available: 7 14 30 "} |
Note: the `rental_code` you get from this endpoint is important, make sure to save it somewhere..
Retrieve rental messages - https://api.smspool.net/rental/retrieve_messages
Param | Required | Comment |
---|---|---|
key | Yes | Your 32-character API key |
rental_code | Yes | The retrieved rental code from the `Order rental` endpoint. |
Responses
Success | {"success":1,"messages":{"0":{"ID":6,"sender":null,"message":"Message 1","timestamp":"11 May 2022 18:39:54"},"1":{"ID":6,"sender":null,"message":"Message 2","timestamp":"11 May 2022 01:11:35"}},"source":"6"} |
Fail | {"success":0,"message":"No rental was found!"} |
Retrieve rental status - https://api.smspool.net/rental/retrieve_status.php
Param | Required | Comment |
---|---|---|
key | Yes | Your 32-character API key |
rental_code | Yes | The retrieved rental code from the `Order rental` endpoint. |
Responses
Success | {"success":1,"status":{"expiry":1654495533,"available":1,"phonenumber":"123456789","activeFor":90}} |
Fail | {"success":0,"message":"No rental was found!"} |
Needs to be called every time when activeFor expires for certain rentals.
Note: the available must be 1 before you send a code. Please run this endpoint every time before retrieving your rental messages.
Refund rental - https://api.smspool.net/rental/refund.php
Param | Required | Comment |
---|---|---|
key | Yes | Your 32-character API key |
rental_code | Yes | The retrieved rental code from the `Order rental` endpoint. |
Responses
Success | {"success":1,"message":"Your rental has been refunded!"} |
Fail | {"success":0,"message":"This number could not be refunded as you already have refunded it."} |
Fail | {"success":0,"message":"TYou cannot refund a rental after 12 hours or after receiving one message."} |
Extend rental - https://api.smspool.net/rental/extend.php
Param | Required | Comment |
---|---|---|
key | Yes | Your 32-character API key |
days | Yes | The amount of days you'd like to extend it with. |
rental_code | Yes | The retrieved rental code from the `Order rental` endpoint. |
Responses
Success | {"success":1,"message":"Your rental has been succesfully extended!"} |
Fail | {"success":0,"message":"Something went wrong on extending your rental, you have NOT been charged!"} |
Fail | {"success":0,"message":"You do not have enough balance, please top up your account with 0.00 dollars in order to purchase this rental."} |
Fail | {"success":0,"message":"You selected a invalid amount of days! The following days are available: 7 14 30 "} |
Return to blog
About the author
SMSPool Admin
The owner of SMSPool.net, a site that originally started as a hobby but saw rapid expansion due to the high demand, loves anything technology related and loves writing about technology related articles.