SMSPVAdevelopers
Rental API
SMSPVA / DOCUMENTATION

Create multi-service rental

GET /api/rent.php?method=create_multi

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

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.

This request can modify a rental or incur charges. If the response is lost, check your orders and history before trying again: the change may already have been made. The examples do not retry automatically.

Authentication

Send apikey as a required query parameter.

Parameters

NameLocationTypeRequiredExampleDescription
methodquerystringYes"create_multi"Method name
apikeyquerystringYesSMSPVA_API_KEYYour API key You can find it on the website in the top right drop-down menu in the Profile and APIKEY section
dtypequerystringYes"week"Type of period: week or month
dcountqueryintegerYes1Count type of period, i.e. if dtype=week then counts of weeks
countryquerystringYes"KZ"Country code of number Countries list
servicesquerystringYes"opt6,opt7,opt8"Services codes separated by commas Services list
providerquerystringNo"T-Mobile"Optional parameter. Provider name. If not specified, a provider will be chosen randomly from the available ones.
partner_keyquerystringNo"partnerkeyhere"Optional partner key for referral accounting.

How to use this method

Rent one number for several services. Pass their comma-separated codes in services and first check Multi-service count.

Choose a country and compare services, providers and prices for the same country and duration. After creating the rental, find it in Rental orders and activate it before sending an SMS.

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.

: "${SMSPVA_API_KEY:?Set SMSPVA_API_KEY}"
curl --get --fail-with-body --max-time 30 "https://smspva.com/api/rent.php" \
  --data-urlencode "method=create_multi" \
  --data-urlencode "apikey=$SMSPVA_API_KEY" \
  --data-urlencode "dtype=week" \
  --data-urlencode "dcount=1" \
  --data-urlencode "country=KZ" \
  --data-urlencode "services=opt6,opt7,opt8"

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": {
    "id": 40370,
    "pnumber": "9096037108",
    "ccode": "+7",
    "service": "opt6",
    "until": "1587633960"
  }
}
NameTypeDescription
statusintegerStatus of the response: 1 for success, 0 for failure
dataobject
data.idintegerID of order
data.pnumberstringPhone number without country code
data.ccodestringDigital country code
data.servicestringService code Services list
data.untilstringUNIX timestamp of expire date
msgstringError message when status is 0.

On this page