Path: API › 数据查询

`POST /data`

查询面板 SQLite 数据库中的任意表，支持搜索、分页、排序。这是获取各类资源 ID 的核心接口。

## Request body

_Required._

- `action44.request_time` (string, required) — Unix 时间戳。
- `action44.request_token` (string, required) — 按 API 概览生成的签名。
- `action44.action` (string, required) — 具体操作名称。
  - one of `"getData"`
- `action44.table` (string, required) — 表名：`sites`、`databases`、`ftps`、`domain`、`crontab`、`backup`、`config`
- `action44.type` (string, optional) — 筛选类型，`-1` 表示全部
- `action44.search` (string, optional) — 搜索关键词
- `action44.p` (integer, optional) — 页码
- `action44.limit` (integer, optional) — 每页数量
- `action44.list` (string, optional) — `true` 返回数组格式

## Example request

```text
{
  "request_time": "string",
  "request_token": "string",
  "action": "getData",
  "table": "string",
  "type": "string",
  "search": "string",
  "p": 0,
  "limit": 0,
  "list": "string"
}
```

## Code samples

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

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

## Responses

### default

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

#### Example

```json
{
  "data": [
    {
      "id": 1,
      "name": "testapi.bt.local",
      "path": "/www/wwwroot/testapi.bt.local",
      "status": "1"
    }
  ]
}
```

- `action44.response.default.data` (array<unknown>, optional) — 数据记录列表
- `action44.response.default.page` (string, optional) — 分页 HTML
- `action44.response.default.where` (string, optional) — 查询条件


## getData

查询面板 SQLite 数据库中的任意表，支持搜索、分页、排序。这是获取各类资源 ID 的核心接口。

- **路由**：`POST /data`
- **action**：`getData`

## 输入参数

| 参数名称 | 必选 | 类型 | 描述 |
|----------|------|------|------|
| action | 是 | String | 固定值 `getData` |
| table | 是 | String | 表名：`sites`、`databases`、`ftps`、`domain`、`crontab`、`backup`、`config` |
| type | 否 | String | 筛选类型，`-1` 表示全部 |
| search | 否 | String | 搜索关键词 |
| p | 否 | Integer | 页码 |
| limit | 否 | Integer | 每页数量 |
| list | 否 | String | `true` 返回数组格式 |

## 输出参数

| 参数名称 | 类型 | 描述 |
|----------|------|------|
| data | Array | 数据记录列表 |
| page | String | 分页 HTML |
| where | String | 查询条件 |

## 常用示例

### 查网站列表

```
action=getData&table=sites&type=-1
```

```json
{"data": [{"id": 1, "name": "testapi.bt.local", "path": "/www/wwwroot/testapi.bt.local", "status": "1"}]}
```

### 查数据库列表

```
action=getData&table=databases&type=-1
```

### 查FTP用户列表

```
action=getData&table=ftps&type=-1
```

### 查域名列表

```
action=getData&table=domain&search=1&list=true
```

