Available number counts
GET /api/rent.php?method=getcount
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 | "getcount" | Method name |
country | query | string | Yes | "KZ" | Country code of number Countries list |
dtype | query | string | No | "week" | Type of period: week or month Defaults to week when omitted. |
dcount | query | integer | No | 1 | Count type of period, i.e. if dtype=week then counts of weeks Defaults to 1 when omitted. |
How to use this method
Check available rental numbers in a country. If omitted, dtype defaults to week and dcount to 1. Use Rental data for names and prices, or Counts by provider for a provider breakdown.
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=getcount" \
--data-urlencode "country=KZ" \
--data-urlencode "dtype=week" \
--data-urlencode "dcount=1"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 | Type | Description |
|---|---|---|
status | integer | Status of the response: 1 for success, 0 for failure |
data | oneOf | Count data by service or total count, depending on backend response. |
msg | string | Error message when status is 0. |