> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/api-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/api-reference/cn/zga/certificate/describecertificates.md).

# DescribeCertificates

## 1. 接口描述

本接口(DescribeCertificates)用于查询证书列表。

## 2. 请求参数

以下请求参数列表仅列出了接口中需要的请求参数

| 参数名称             | 必选 | 类型              | 描述                                            |
| ---------------- | -- | --------------- | --------------------------------------------- |
| certificateIds   | 否  | Array of String | <p>证书ID。</p><p>最多支持100个ID查询。</p>              |
| certificateLabel | 否  | String          | 自定义证书标签                                       |
| san              | 否  | String          | 主题备用名称(证书关联的域名)                               |
| resourceGroupId  | 否  | String          | <p>资源组的ID。</p><p>如果不传，则返回该用户可见的所有资源组内的实例。</p> |
| expired          | 否  | Boolean         | 证书是否过期                                        |
| pageSize         | 否  | Integer         | <p>返回的分页大小。</p><p>默认为20，最大为1000。</p>          |
| pageNum          | 否  | Integer         | <p>返回的分页数。</p><p>默认为1。</p>                    |

## 3. 响应结果

| 参数名称       | 类型                                                                                 | 描述                                         |
| ---------- | ---------------------------------------------------------------------------------- | ------------------------------------------ |
| requestId  | String                                                                             | 唯一请求 ID，每次请求都会返回。定位问题时需要提供该次请求的 requestId。 |
| totalCount | Integer                                                                            | 符合条件的数据总数。                                 |
| dataSet    | Array of [CertificateInfo](/api-reference/cn/zga/datastructure.md#certificateinfo) | 结果集                                        |

## 4. 代码示例

{% tabs %}
{% tab title="示例" %}

1. **分页查询加速器列表**

```json
POST /api/v2/zga HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: DescribeCertificates
<Common Request Params>

Request:
{
  "pageNum": 1,
  "pageSize": 1
}

Response:
{
  "requestId": "TEEFDCA5B-76FB-4E91-A18E-DF7F5D2CE41F",
  "response": {
    "requestId": "TEEFDCA5B-76FB-4E91-A18E-DF7F5D2CE41F",
    "totalCount": 6,
    "dataSet": [
      {
        "certificateId": "certificateIdxxxxx",
        "certificateLabel": "certificatexxx",
        "common": "*.xx.com",
        "fingerprint": "1D7801BBE772D5DE55CBF1F88AEB41A42402DA07",
        "issuer": "TrustAsia TLS RSA CA",
        "sans": ["xx.cn"],
        "algorithm": "RSA",
        "createTime": "2023-04-19T09:11:27Z",
        "startTime": "2023-04-18T09:27:30Z",
        "endTime": "2023-07-18T09:27:30Z",
        "resourceGroupId":"xxx-xx",
        "expired": false
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

## 5. 开发者工具

Zenlayer Cloud API 2.0 提供了配套的[开发工具集（SDK）](/api-reference/cn/api-introduction/toolkit.md)，未来会陆续支持更多开发语言，方便快速接入和使用Zenlayer的产品和服务。

## 6. 错误码

下面包含业务逻辑中遇到的错误码，其他错误码见[公共错误码](/api-reference/cn/api-introduction/instruction/commonerrorcode.md)
