Path: API › ACME 证书

`POST /acme`

下载指定订单的证书文件到本地保存路径。

## Request body

_Required._

- `action3.request_time` (string, required) — Unix 时间戳。
- `action3.request_token` (string, required) — 按 API 概览生成的签名。
- `action3.action` (string, required) — 具体操作名称。
  - one of `"download_cert"`
- `action3.index` (string, required) — 订单索引 ID

## Example request

```text
{
  "request_time": "string",
  "request_token": "string",
  "action": "download_cert",
  "index": "string"
}
```

## Code samples

### cURL（填写面板地址与签名）

```curl
curl --request POST \
  --url "https://your-panel.example.com:8888/acme" \
  --header "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode "request_time=<Unix时间戳>" \
  --data-urlencode "request_token=<按 API 概览生成的签名>" \
  --data-urlencode "action=download_cert" \
  --data-urlencode "index=<index>"
```

## Responses

### default

接口响应，业务状态见下方详细说明。

#### Example

```json
{
  "cert": "-----BEGIN CERTIFICATE-----\n...",
  "private_key": "-----BEGIN PRIVATE KEY-----\n...",
  "domains": [
    "dnstest.cc"
  ]
}
```

- `action3.response.default.cert` (string, optional) — 证书内容（PEM 格式）
- `action3.response.default.private_key` (string, optional) — 私钥内容
- `action3.response.default.fullchain` (string, optional) — 完整证书链
- `action3.response.default.cert_timeout` (integer, optional) — 证书到期时间戳
- `action3.response.default.domains` (array<unknown>, optional) — 证书覆盖的域名


## download_cert

下载指定订单的证书文件到本地保存路径。

- **路由**：`POST /acme`
- **action**：`download_cert`

## 输入参数

| 参数名称 | 必选 | 类型 | 描述 |
|----------|------|------|------|
| action | 是 | String | 固定值 `download_cert` |
| index | 是 | String | 订单索引 ID |

## 输出参数

| 参数名称 | 类型 | 描述 |
|----------|------|------|
| cert | String | 证书内容（PEM 格式） |
| private_key | String | 私钥内容 |
| fullchain | String | 完整证书链 |
| cert_timeout | Integer | 证书到期时间戳 |
| domains | Array | 证书覆盖的域名 |

## 示例

### 请求

```
POST /acme HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded

action=download_cert&index=851cc157ad22888459e59c3cfdc5ac95
```

### 响应

```json
{
  "cert": "-----BEGIN CERTIFICATE-----\n...",
  "private_key": "-----BEGIN PRIVATE KEY-----\n...",
  "domains": ["dnstest.cc"]
}
```

