Path: API › 计划任务

`POST /crontab`

获取指定 ID 的计划任务的完整配置信息。

## Request body

_Required._

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

## Example request

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

## Responses

### default

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

#### Example

```json
{
  "id": 1,
  "name": "续签Let's Encrypt证书",
  "type": "day",
  "status": 1,
  "where_hour": 10,
  "where_minute": 15
}
```

- `action22.response.default.id` (integer, optional) — 任务 ID
- `action22.response.default.name` (string, optional) — 任务名称
- `action22.response.default.type` (string, optional) — 执行周期类型
- `action22.response.default.status` (integer, optional) — `1` 启用 / `0` 禁用
- `action22.response.default.sBody` (string, optional) — 执行命令/脚本


## get_crond_find

获取指定 ID 的计划任务的完整配置信息。

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

## 输入参数

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

## 输出参数

| 参数名称 | 类型 | 描述 |
|----------|------|------|
| id | Integer | 任务 ID |
| name | String | 任务名称 |
| type | String | 执行周期类型 |
| status | Integer | `1` 启用 / `0` 禁用 |
| sBody | String | 执行命令/脚本 |

## 示例

### 请求

```
POST /crontab HTTP/1.1
action=get_crond_find&id=1
```

### 响应

```json
{"id": 1, "name": "续签Let's Encrypt证书", "type": "day", "status": 1, "where_hour": 10, "where_minute": 15}
```

