Path: API › 网站管理

`POST /site`

为已有网站添加额外域名绑定。

## Request body

_Required._

- `action230.request_time` (string, required) — Unix 时间戳。
- `action230.request_token` (string, required) — 按 API 概览生成的签名。
- `action230.action` (string, required) — 具体操作名称。
  - one of `"AddDomain"`
- `action230.id` (integer, required) — 网站 ID
- `action230.webname` (string, required) — 网站主域名
- `action230.domain` (string, required) — 要添加的新域名

## Example request

```text
{
  "request_time": "string",
  "request_token": "string",
  "action": "AddDomain",
  "id": 0,
  "webname": "string",
  "domain": "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=AddDomain" \
  --data-urlencode "id=<id>" \
  --data-urlencode "webname=<webname>" \
  --data-urlencode "domain=<domain>"
```

## Responses

### default

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

#### Example

```json
{
  "domains": [
    {
      "name": "testapi.bt.local"
    },
    {
      "name": "api-test.example.com"
    },
    {
      "name": "new.example.com"
    }
  ]
}
```

- `action230.response.default.domains` (array<unknown>, optional) — 添加后的完整域名列表


## AddDomain

为已有网站添加额外域名绑定。

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

## 输入参数

| 参数名称 | 必选 | 类型 | 描述 |
|----------|------|------|------|
| action | 是 | String | 固定值 `AddDomain` |
| id | 是 | Integer | 网站 ID |
| webname | 是 | String | 网站主域名 |
| domain | 是 | String | 要添加的新域名 |

## 输出参数

| 参数名称 | 类型 | 描述 |
|----------|------|------|
| domains | Array | 添加后的完整域名列表 |

## 示例

### 请求

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

action=AddDomain&id=1&webname=testapi.bt.local&domain=new.example.com
```

### 响应

```json
{"domains": [{"name": "testapi.bt.local"}, {"name": "api-test.example.com"}, {"name": "new.example.com"}]}
```

