# 查询即将到期的 License 列表 (/zh-CN/api-reference/api-ref/voip-callkit/list-expiring-licenses)

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

查询指定 PID 下即将到期的 License 列表。

- OpenAPI: /openapi/voip-callkit/call.zh-CN.yaml
- Operation ID: getExpiringLicenses
- Method: GET
- Path: /dabiz/license/v3/projects/{appId}/pids/{pid}/expiringLicenses
- Endpoint: https://api.sd-rtn.com/dabiz/license/v3/projects/{appId}/pids/{pid}/expiringLicenses

## Servers

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

能正常使用 License 后，你可以调用 `expiringLicense` 接口查询即将到期的 License 列表。


## Authorization

This endpoint requires authentication.

- `Basic Auth`

## Parameters

- `appId` (path, required, string) - 你的声网项目使用的 [App ID](/zh-CN/introduction/glossary#appid)。
- `pid` (path, required, string) - 由 SKU、有效期、品类定义的 License 激活标识。需要和 `active` 接口中传入的 `pid` 一致。
- `page` (query, optional, integer) - （可选）分页页码。默认值为 1。
  - Default: `1`
- `size` (query, optional, integer) - （可选）每页查询的 License 数量。默认值为 100，最大值为 100。
  - Default: `100`
  - Maximum: `100`
- `expiringDay` (query, required, integer) - 将要过期的天数，可设为如下值：
- `60`: 60 天。
- `90`: 90 天。

服务器会返回即将在设置的天数内过期的 License 信息。不会返回已经过期的 License 信息。

  - Allowed: `60` | `90`

## Request body

No request body.

## Responses

### 200

请求成功。

- `data` (object)
  - `data.count` (integer) - 即将过期的 License 数量。
  - `data.list` (array) - 由多组 Lisence 信息组成的数组。

    - `data.list.items` (object)
      - `data.list.items.license` (string) - 即将过期的 License 的值。
      - `data.list.items.licenseKey` (string) - 设备的唯一标识。和你在 `activate` 接口中传入的 `licenseKey` 一致。
      - `data.list.items.activeTime` (string) - License 的激活时间，RFC3339 格式。
        - Format: `date-time`
      - `data.list.items.expireTime` (string) - License 的过期时间，RFC3339 格式。
        - Format: `date-time`
### 非 200

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

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

## Response examples

### 200

```json
{
  "code": 200,
  "data": {
    "count": 1,
    "list": [
      {
        "license": "698AxxxxxxxxxxxxxxxxxxxxxxxxEDDB0",
        "licenseKey": "xxxx",
        "activeTime": "2024-12-02T08:15:39Z",
        "expireTime": "2024-12-05T08:15:39Z"
      }
    ]
  }
}
```
