SMSPVAdevelopers
Rental API
SMSPVA / DOCUMENTATION

Rental data by provider

GET /api/rent.php?method=getdataWithProviders

SMSPVA API
GEThttps://smspva.com/api/rent.php?method=getdataWithProviders

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

The apikey query parameter is optional. Omit it for public data; set it for account-specific data or pricing where documented.

Parameters

NameLocationTypeRequiredExampleDescription
methodquerystringYes"getdataWithProviders"Method name
apikeyquerystringNo(optional)Optional API key. When supplied, it may affect personalized rental data and prices.
countryquerystringYes"KZ"Country code of number Countries list
dtypequerystringNo"week"Type of period: week or month Defaults to week when omitted.
dcountqueryintegerNo1Count type of period, i.e. if dtype=week then counts of weeks Defaults to 1 when omitted.
extendquerystringNo"1"Optional flag enabling extended response format.

How to use this method

Compare the services available in a country, their daily prices and the providers supplying them. Use the same dtype and dcount that you plan to rent.

Choose a country from Rental countries, then pass your service code to Create rental or Create multi-service rental.

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.

# Optional: add --data-urlencode "apikey=$SMSPVA_API_KEY" for account-specific data.
curl --get --fail-with-body --max-time 30 "https://smspva.com/api/rent.php" \
  --data-urlencode "method=getdataWithProviders" \
  --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": {
    "services": [
      {
        "name": "1cupis & okcupid & winline",
        "service": "opt48",
        "price_day": 5,
        "img": "images/ico/cupis_okcupid_winline.ico",
        "procent_days": 0,
        "procent": 0,
        "day_step": 0,
        "count": {
          "Claro_AR": 27
        },
        "totalCount": 12
      }
    ],
    "totalAmount": 1735,
    "allOperators": [
      "Claro_AR"
    ]
  }
}
NameTypeDescription
statusintegerStatus of the response: 1 for success, 0 for failure
dataobject
data.servicesarray<object>
data.services[].namestringService name
data.services[].servicestringService code Services list
data.services[].price_daynumberPrice per day for this service
data.services[].imgstringService icon URL
data.services[].procent_daysintegerNumber of days for discount
data.services[].procentintegerDiscount percentage
data.services[].day_stepintegerDay step for pricing
data.services[].countobjectNumber of available numbers for this service from each operator
data.services[].count.*integer
data.services[].totalCountintegerTotal count of available numbers for this service
data.totalAmountintegerTotal count of available numbers for all services
data.allOperatorsarray<string>List of all available operators in this country
msgstringError message when status is 0. The API may return HTTP 200 for this result.

On this page