Rental countries
GET /api/rent.php?method=getcountries
Send a GET request and check status in the JSON response: 1 means success and 0 means failure, even with HTTP 200. If it fails, read msg for the reason.
Authentication
You can call this method without an API key.
Parameters
| Name | Location | Type | Required | Example | Description |
|---|---|---|---|---|---|
method | query | string | Yes | "getcountries" | Method name |
How to use this method
Find the countries currently available for number rental. Use a returned code with Rental data or Data by provider to check services, prices and stock.
Request examples
Environment and dependencies. Each example encodes query values and allows 30 seconds for the request. Check HTTP and JSON status before using data. cURL prints the response for you to check; Java uses Jackson to read the JSON.
curl --get --fail-with-body --max-time 30 "https://smspva.com/api/rent.php" \
--data-urlencode "method=getcountries"Responses
Check the response that matches your request. Example values and dates are illustrative. Optional fields can depend on the outcome or the response format you selected.
HTTP 200
Success
application/json
Illustrative response
{
"status": 1,
"data": [
{
"name": "United States",
"code": "US",
"url_country_name": "united-states",
"rent_switch_type": "FAST",
"rent_avail_prolong": "1"
}
]
}| Name | Type | Description |
|---|---|---|
status | integer | |
data | array<object> | |
data[].name | string | Country name |
data[].code | string | Country code of number Countries list |
data[].url_country_name | string | Country slug used in public URLs. |
data[].rent_switch_type | string | Rental availability mode for the country. |
data[].rent_avail_prolong | string | Indicates whether rental prolongation is available for the country. |