Path: API › FTP 管理

`POST /ftp`

批量修改多个 FTP 用户的密码。需同时传入用户 ID 和用户名。

## Request body

_Required._

- `action151.request_time` (string, required) — Unix 时间戳。
- `action151.request_token` (string, required) — 按 API 概览生成的签名。
- `action151.action` (string, required) — 具体操作名称。
  - one of `"BatchSetUserPassword"`
- `action151.data` (string, required) — JSON 数组，每项格式 `{"id":1,"ftp_username":"user1","new_password":"newpass"}`

## Example request

```text
{
  "request_time": "string",
  "request_token": "string",
  "action": "BatchSetUserPassword",
  "data": "string"
}
```

## Code samples

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

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

## Responses

### default

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

#### Example

```json
[
  {
    "ftp_username": "batch_test1",
    "status": true
  },
  {
    "ftp_username": "batch_test2",
    "status": true
  }
]
```


## BatchSetUserPassword

批量修改多个 FTP 用户的密码。需同时传入用户 ID 和用户名。

- **路由**：`POST /ftp`
- **action**：`BatchSetUserPassword`

## 输入参数

| 参数名称 | 必选 | 类型 | 描述 |
|----------|------|------|------|
| action | 是 | String | 固定值 `BatchSetUserPassword` |
| data | 是 | String | JSON 数组，每项格式 `{"id":1,"ftp_username":"user1","new_password":"newpass"}` |

> 注意：`new_password` 长度不能少于 6 位。

## 输出参数

| 参数名称 | 类型 | 描述 |
|----------|------|------|
| - | Array&lt;Object&gt; | 操作结果，每项含 `ftp_username` 和 `status` |

## 示例

### 请求

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

action=BatchSetUserPassword&data=[{"id":5,"ftp_username":"batch_test1","new_password":"NewPass1@"},{"id":6,"ftp_username":"batch_test2","new_password":"NewPass2@"}]
```

### 响应

```json
[{"ftp_username": "batch_test1", "status": true}, {"ftp_username": "batch_test2", "status": true}]
```

