Path: API › 计划任务

`POST /crontab`

将指定计划任务的数据导出为 JSON 文件到 `/tmp/` 目录。

## Request body

_Required._

- `action20.request_time` (string, required) — Unix 时间戳。
- `action20.request_token` (string, required) — 按 API 概览生成的签名。
- `action20.action` (string, required) — 具体操作名称。
  - one of `"export_crontab_to_json"`
- `action20.id` (integer, required) — 任务 ID

## Example request

```text
{
  "request_time": "string",
  "request_token": "string",
  "action": "export_crontab_to_json",
  "id": 0
}
```

## Code samples

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

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

## Responses

### default

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

#### Example

```json
{
  "status": true,
  "msg": "/tmp/计划任务数据.json"
}
```

- `action20.response.default.status` (boolean, optional) — `true` 导出成功
- `action20.response.default.msg` (string, optional) — 导出文件路径


## export_crontab_to_json

将指定计划任务的数据导出为 JSON 文件到 `/tmp/` 目录。

- **路由**：`POST /crontab`
- **action**：`export_crontab_to_json`

## 输入参数

| 参数名称 | 必选 | 类型 | 描述 |
|----------|------|------|------|
| action | 是 | String | 固定值 `export_crontab_to_json` |
| id | 是 | Integer | 任务 ID |

## 输出参数

| 参数名称 | 类型 | 描述 |
|----------|------|------|
| status | Boolean | `true` 导出成功 |
| msg | String | 导出文件路径 |

## 示例

```json
{"status": true, "msg": "/tmp/计划任务数据.json"}
```

