Rental orders
GET /api/rent.php?method=orders
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
| Name | Location | Type | Required | Example | Description |
|---|---|---|---|---|---|
method | query | string | Yes | "orders" | 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 |
How to use this method
View your active rentals, their current state and extension options. Use an order’s ID to activate, read SMS or extend it. Completed rentals and restoration eligibility are in Rental history.
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=orders" \
--data-urlencode "apikey=$SMSPVA_API_KEY"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": 40300,
"scode": "opt16",
"sname": "Instagram",
"state": 0,
"pnumber": "9096068511",
"ccode": "+7",
"cname": "KZ",
"hasnewsms": false,
"until": 1587552240,
"canprolong": true,
"canprolongmax": 162,
"canprolonguntil": 1634883780,
"lastonline": 1586947920
}
]
}| Name | Type | Description |
|---|---|---|
status | integer | Status of the response: 1 for success, 0 for failure |
data | array<object> | |
data[].id | integer | ID of order |
data[].scode | string | Service code Services list |
data[].sname | string | Service name |
data[].state | integer | Order state: 0 - not active, 1 - active, 2 - activating, -1 - not in system |
data[].pnumber | string | Phone number without country code |
data[].ccode | string | Digital country code |
data[].cname | string | Country code of number Countries list |
data[].hasnewsms | boolean | New SMS received for this order |
data[].until | integer | UNIX timestamp of expire date |
data[].canprolong | boolean | Is this order available for prolongation? |
data[].canprolongmax | integer | Maximum number of days available for prolongation. This is the limit - you cannot extend beyond this number of days. |
data[].canprolonguntil | integer | Unix timestamp showing the deadline until which you can prolong the order. After this date, prolongation is not available. |
data[].lastonline | integer | Unix timestamp of last online date of number |