SMSPVAdevelopers
Rental API
SMSPVA / DOCUMENTATION

Restore rental

GET /api/rent.php?method=restore_user

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

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"restore_user"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
idqueryintegerYes""ID of order

How to use this method

Restore an eligible completed rental. Get its ID from Rental history, check isAvailForRestore, and review cost and duration first.

On success, status=1 and data.id contains the new restored order ID. Use it to find the rental in Rental orders. If status=0, read msg for the reason.

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_RENTAL_ORDER_ID: id.
: "${SMSPVA_API_KEY:?Set SMSPVA_API_KEY}"
: "${SMSPVA_RENTAL_ORDER_ID:?Set SMSPVA_RENTAL_ORDER_ID}"
curl --get --fail-with-body --max-time 30 "https://smspva.com/api/rent.php" \
  --data-urlencode "method=restore_user" \
  --data-urlencode "apikey=$SMSPVA_API_KEY" \
  --data-urlencode "id=$SMSPVA_RENTAL_ORDER_ID"

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

The response contains a restored order ID when the request succeeds, or an error message when it fails.

application/json

Successful restore

{
  "status": 1,
  "data": {
    "id": 123456
  }
}

Incorrect order ID

{
  "status": 0,
  "msg": "Incorrect order id"
}

Order not found

{
  "status": 0,
  "msg": "Order not found"
}

Not enough balance

{
  "status": 0,
  "msg": "NOBALANCE_12.50"
}

Number is busy

{
  "status": 0,
  "msg": "The number is busy, there is already an order for this service"
}

Success

NameTypeDescription
statusintegerRequest status. 1 means the order was restored successfully.
dataobjectRestored order data.
data.idintegerNew restored order ID.

Required: status, data

Error

NameTypeDescription
statusintegerRequest status. 0 means the restore request failed.
msgstringError message.

Required: status, msg

On this page