# License 续期 (/zh-CN/api-reference/api-ref/voip-callkit/renew-license)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

续期指定的 License。

- OpenAPI: /openapi/voip-callkit/call.zh-CN.yaml
- Operation ID: renewLicense
- Method: POST
- Path: /dabiz/license/v2/renew
- Endpoint: https://api.sd-rtn.com/dabiz/license/v2/renew

## Servers

- https://api.sd-rtn.com

如需继续使用声网服务，为不影响你的业务，声网推荐你至少在 License 到期前 30 天联系 sales@shengwang.cn 申请续期。续期申请通过后，声网会生成 `renewId` 并提供给你，你可以调用 `renew` 接口续期 License。


## Authorization

This endpoint requires authentication.

- `Basic Auth`

## Parameters

- `appid` (query, required, string) - 你的声网项目使用的 [App ID](/zh-CN/introduction/glossary#appid)。
- `renewId` (query, optional, string) - （可选）由 SKU、有效期、品类定义的 License 续期标识。联系 sales@shengwang.cn 获取。如果不填，则声网会按照项目级别、公司级别从高到低优先选择最早生成的 `renewId` 来执行续期操作。

- `license` (query, required, string) - 需要续期的 License 值。你可以在激活接口的 `license` 响应参数中获取。

> [!CAUTION]
> 请注意区分大小写。


## Request body

No request body.

## Responses

### 200

请求成功。

为避免误调用续期 API 引起不必要的损失，只有当 License 的剩余有效时间小于 `renewId` 的有效期时，你才能成功调用续期 API。例如，当 License 的剩余有效时间为 40 天时，如果 `renewId` 的有效期为 60 天，则你可以成功调用续期 API；如果 `renewId` 的有效期为 30 天，则调用续期 API 会失败。


- `message` (string)
  - Example: `license续期成功`
- `data` (object)
  - `data.licenseKey` (string) - 设备的唯一标识。
  - `data.license` (string) - 续期的 License。
  - `data.renewTimes` (integer) - 续期次数。
  - `data.lastRenewTime` (integer) - 上次续期的时间戳。
    - Format: `int64`
  - `data.activationTime` (integer) - License 激活的时间戳。
    - Format: `int64`
  - `data.expireTime` (integer) - License 过期的时间戳。
    - Format: `int64`
### 非 200

请求失败。你可以根据返回的响应状态码和响应 Body 中 `message` 字段的描述排查错误。

- `message` (string) - 请求失败的错误信息。请结合返回的响应状态码排查错误。

## Response examples

### 200

```json
{
  "code": 200,
  "message": "license续期成功",
  "data": {
    "licenseKey": "xxxx",
    "license": "85B3xxxxxxxxxxxxxxxxxxxxxxxx656F",
    "renewTimes": 1,
    "lastRenewTime": 1700644272,
    "activationTime": 1700642665,
    "expireTime": 1705913065
  }
}
```
