Prolong rental
GET /api/rent.php?method=prolong
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
| Name | Location | Type | Required | Example | Description |
|---|---|---|---|---|---|
method | query | string | Yes | "prolong" | Method name |
apikey | query | string | Yes | SMSPVA_API_KEY | Your API key You can find it on the website in the top right drop-down menu in the Profile and APIKEY section |
id | query | integer | Yes | 123 | ID of order |
dtype | query | string | Yes | "week" | Type of period: week or month |
dcount | query | integer | Yes | 1 | Count type of period, i.e. if dtype=week then counts of weeks |
How to use this method
Extend the rental by the requested number of weeks or months. Check canprolong, canprolongmax and canprolonguntil in Rental orders first. The extension must stay within the limits of that order.
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=prolong" \
--data-urlencode "apikey=$SMSPVA_API_KEY" \
--data-urlencode "id=$SMSPVA_RENTAL_ORDER_ID" \
--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
Response with order prolongation status
application/json
Successful prolongation
{
"status": 1
}Incorrect order id
{
"status": 0,
"msg": "Incorrect order id"
}Order not found
{
"status": 0,
"msg": "Order not found"
}Incorrect duration type
{
"status": 0,
"msg": "Incorrect duration type. Available types: week, month"
}Incorrect duration count
{
"status": 0,
"msg": "Incorrect duration count. Min 7 days. Max 90 days."
}Insufficient funds in account
{
"status": 0,
"msg": "Insufficient balance"
}| Name | Type | Description |
|---|---|---|
status | integer | Status of the response: 1 for success, 0 for failure |