Path: API › 网站管理

`POST /site`

获取指定网站的 SSL 证书完整信息，包括证书部署状态、域名列表、TLS 协议版本配置。

## Request body

_Required._

- `action253.request_time` (string, required) — Unix 时间戳。
- `action253.request_token` (string, required) — 按 API 概览生成的签名。
- `action253.action` (string, required) — 具体操作名称。
  - one of `"GetSSL"`
- `action253.siteName` (string, required) — 网站域名

## Example request

```text
{
  "request_time": "string",
  "request_token": "string",
  "action": "GetSSL",
  "siteName": "string"
}
```

## Code samples

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

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

## Responses

### default

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

#### Example

```json
{
  "status": false,
  "oid": -1,
  "domain": [
    {
      "name": "testapi.bt.local"
    },
    {
      "name": "api-test.example.com"
    }
  ],
  "key": false,
  "csr": false,
  "type": -1,
  "httpTohttps": false,
  "cert_data": {},
  "tls_versions": {
    "TLSv1": false,
    "TLSv1.1": true,
    "TLSv1.2": true,
    "TLSv1.3": true
  },
  "auth_type": "http",
  "email": "test@message.com"
}
```

- `action253.response.default.status` (boolean, optional) — SSL 是否已部署
- `action253.response.default.oid` (integer, optional) — 证书订单 ID，`-1` = 无
- `action253.response.default.domain` (array<unknown>, optional) — 网站域名列表 `[{name, apply_ssl, dns_status}]`
- `action253.response.default.key` (boolean, optional) — 是否有私钥文件
- `action253.response.default.csr` (boolean, optional) — 是否有证书文件
- `action253.response.default.type` (integer, optional) — 证书类型，`-1` = 无
- `action253.response.default.httpTohttps` (boolean, optional) — 是否开启 HTTP 强制跳转 HTTPS
- `action253.response.default.cert_data` (object, optional) — 证书信息（颁发者、到期时间等）
- `action253.response.default.tls_versions` (object, optional) — TLS 协议版本开关 `{TLSv1, TLSv1.1, TLSv1.2, TLSv1.3}`
- `action253.response.default.auth_type` (string, optional) — 认证方式（`http` / `dns`）
- `action253.response.default.email` (string, optional) — 申请邮箱


## GetSSL

获取指定网站的 SSL 证书完整信息，包括证书部署状态、域名列表、TLS 协议版本配置。

- **路由**：`POST /site`
- **action**：`GetSSL`

## 输入参数

| 参数名称 | 必选 | 类型 | 描述 |
|----------|------|------|------|
| action | 是 | String | 固定值 `GetSSL` |
| siteName | 是 | String | 网站域名 |

## 输出参数

| 参数名称 | 类型 | 描述 |
|----------|------|------|
| status | Boolean | SSL 是否已部署 |
| oid | Integer | 证书订单 ID，`-1` = 无 |
| domain | Array | 网站域名列表 `[{name, apply_ssl, dns_status}]` |
| key | Boolean | 是否有私钥文件 |
| csr | Boolean | 是否有证书文件 |
| type | Integer | 证书类型，`-1` = 无 |
| httpTohttps | Boolean | 是否开启 HTTP 强制跳转 HTTPS |
| cert_data | Object | 证书信息（颁发者、到期时间等） |
| tls_versions | Object | TLS 协议版本开关 `{TLSv1, TLSv1.1, TLSv1.2, TLSv1.3}` |
| auth_type | String | 认证方式（`http` / `dns`） |
| email | String | 申请邮箱 |

## 示例

### 请求

```
POST /site HTTP/1.1
Content-Type: application/x-www-form-urlencoded

request_time=1700000000&request_token=xxx&action=GetSSL&siteName=testapi.bt.local
```

### 响应（未部署 SSL）

```json
{
    "status": false,
    "oid": -1,
    "domain": [{"name": "testapi.bt.local"}, {"name": "api-test.example.com"}],
    "key": false,
    "csr": false,
    "type": -1,
    "httpTohttps": false,
    "cert_data": {},
    "tls_versions": {"TLSv1": false, "TLSv1.1": true, "TLSv1.2": true, "TLSv1.3": true},
    "auth_type": "http",
    "email": "test@message.com"
}
```

