Path: API › FTP 管理

`POST /ftp`

修改指定 FTP 用户的密码。

## Request body

_Required._

- `action155.request_time` (string, required) — Unix 时间戳。
- `action155.request_token` (string, required) — 按 API 概览生成的签名。
- `action155.action` (string, required) — 具体操作名称。
  - one of `"SetUserPassword"`
- `action155.id` (integer, required) — FTP 用户 ID
- `action155.ftp_username` (string, required) — FTP 用户名
- `action155.new_password` (string, required) — 新密码（不少于 6 位）

## Example request

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

## Responses

### default

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

#### Example

```json
{
  "status": true,
  "msg": "操作成功"
}
```

- `action155.response.default.status` (boolean, optional) — 请求结果，`true` 表示成功
- `action155.response.default.msg` (string, optional) — 提示信息


## SetUserPassword

修改指定 FTP 用户的密码。

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

## 输入参数

| 参数名称 | 必选 | 类型 | 描述 |
|----------|------|------|------|
| action | 是 | String | 固定值 `SetUserPassword` |
| id | 是 | Integer | FTP 用户 ID |
| ftp_username | 是 | String | FTP 用户名 |
| new_password | 是 | String | 新密码（不少于 6 位） |

## 示例

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

action=SetUserPassword&id=3&ftp_username=api_ftp_doc&new_password=NewPass@2024
```

## 输出参数

| 参数名称 | 类型 | 描述 |
|----------|------|------|
| status | Boolean | 请求结果，`true` 表示成功 |
| msg | String | 提示信息 |

```json
{"status": true, "msg": "修改成功"}
```

---

## SetStatus

启用或暂停 FTP 用户。

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

## 输入参数

| 参数名称 | 必选 | 类型 | 描述 |
|----------|------|------|------|
| action | 是 | String | 固定值 `SetStatus` |
| id | 是 | Integer | FTP 用户 ID |
| username | 是 | String | FTP 用户名（**非** ftp_username） |
| status | 是 | String | `1` = 启用，`0` = 暂停 |

> 注意：`AddUser` 用 `ftp_username`，但 `DeleteUser`/`SetStatus` 用 `username`。这是面板设计不一致。

## 示例

```
action=SetStatus&id=3&username=api_ftp_doc&status=0
```

```json
{"status": true, "msg": "操作成功"}
```

