Rental API
SMSPVA / DOCUMENTATION
按天延长
GET /api/rent.php?method=prolong_max
SMSPVA API
发送 GET 请求后,检查 JSON 中的 status:1 成功,0 失败,即使 HTTP 为 200 也一样。失败原因见 msg。
此请求可能修改租赁订单或产生费用。响应丢失后,先查询订单及历史,再决定是否重试:更改可能已经生效。示例不会自动重试。
身份验证
apikey 为必填查询参数。
参数
| 名称 | 位置 | 类型 | 必填 | 示例 | 说明 |
|---|---|---|---|---|---|
method | query | string | 是 | "prolong_max" | 方法名称 |
apikey | query | string | 是 | SMSPVA_API_KEY | 你的 API 密钥 可在网站右上角菜单的 Profile and APIKEY 中找到。 |
id | query | integer | 是 | 123 | 订单 ID |
dtype | query | string | 是 | "day" | 时长单位,必须为 "day"。 |
dcount | query | integer | 是 | 5 | 延期天数(1-6),同时不能超过该订单的 canprolongmax。 |
使用说明
用 dtype=day 按天延期,dcount 为 1–6。请先在租赁订单中查看 canprolong、canprolongmax 和 canprolonguntil,延期不能超出该订单的限制。
请求示例
运行环境及依赖. 示例会对查询参数编码,最多等待 30 秒。使用 data 前请检查 HTTP 和 JSON status。cURL 输出原始响应供你检查,Java 使用 Jackson 读取 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_max" \
--data-urlencode "apikey=$SMSPVA_API_KEY" \
--data-urlencode "id=$SMSPVA_RENTAL_ORDER_ID" \
--data-urlencode "dtype=day" \
--data-urlencode "dcount=5"响应
请查看与你的请求对应的响应。数值和日期仅供示例;可选字段可能因结果或所选响应格式而不同。
HTTP 200
按天延期的结果。
application/json
成功延期,最多 7 天
{
"status": 1
}Incorrect order id
{
"status": 0,
"msg": "Incorrect order id"
}Order not found
{
"status": 0,
"msg": "Order not found"
}Invalid duration parameters
{
"status": 0,
"msg": "More than 7 days or type is not day"
}Insufficient funds in account
{
"status": 0,
"msg": "Insufficient balance"
}| 名称 | 类型 | 说明 |
|---|---|---|
status | integer | 响应状态:1 成功,0 失败。 |