SMSPVAdevelopers
Rental API
SMSPVA / DOCUMENTATION

Rental history

GET /api/rent.php?method=get_rent_history

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

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

Send apikey as a required query parameter.

Parameters

NameLocationTypeRequiredExampleDescription
methodquerystringYes"get_rent_history"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
skipqueryintegerNo0Number of items to skip
takequeryintegerNo10Number of items received

How to use this method

Find completed rentals and check isAvailForRestore to see which can be restored. For an eligible order, check cost and duration before restoring it.

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=get_rent_history" \
  --data-urlencode "apikey=$SMSPVA_API_KEY" \
  --data-urlencode "skip=0" \
  --data-urlencode "take=10"

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": [
    {
      "orderId": 857191,
      "resourceCode": "opt9",
      "number": "37067787324",
      "branchId": 684,
      "haveSms": false,
      "isAvailForRestore": true,
      "days": 30,
      "country": "LT",
      "begin": 1768902473,
      "end": 1771494473,
      "closed": 1768903921
    }
  ]
}
NameTypeDescription
statusintegerStatus of the response: 1 for success, 0 for failure
dataarray<object>
data[].orderIdintegerID of order
data[].resourceCodestringService code Services list
data[].numberstringrented phone number with country code without plus sign
data[].branchIdintegerInternal branch ID for the order
data[].haveSmsbooleanWhether SMS was received on this number during the rental
data[].isAvailForRestorebooleanWhether this order can be restored (renewed). If true, you can use the Restore method to renew this rental with a new number.
data[].daysintegerNumber of days the order was rented for
data[].countrystringCountry code of number Countries list
data[].beginintegerUNIX timestamp of start date
data[].endintegerUNIX timestamp of end date
data[].closedintegerUNIX timestamp of closed date

On this page