工作表记录
获取行记录列表
根据鉴权方式查看“获取行记录列表”对应的真实 API 地址、参数与响应。
鉴权方式
AppKey + Sign 是应用密钥鉴权,由管理员创建,用于以应用管理员身份访问应用数据。
版本
请求地址
Path 参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
worksheet_id | string | 是 | 工作表ID |
Header 参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
HAP-Appkey | string | 是 | HAP应用密钥 |
HAP-Sign | string | 是 | HAP签名 |
Body 参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
responseFormat | string | 否 | json:返回 JSON,md:返回 md 文本(更省 token)。默认为 json 可选值: "json""md" |
pageSize | integer | 是 | 每页数量,最大为 1000 |
pageIndex | integer | 是 | 页码 |
viewId | string | 否 | 视图 id |
fields | string[] | 否 | 要返回的字段列表,填入后,返回数据中只包含这些字段信息 |
filter | object | 否 | 筛选器 |
filter.type | string | 是 | 筛选类型,当type为condition时,field/operator/value为必填;当type为group时,logic为必填 可选值: "group""condition" |
filter.logic | string | 否 | 逻辑操作符,不区分大小写 可选值: "AND""OR" |
filter.field | string | 否 | 字段ID或别名(当type为condition时必填) |
filter.operator | string | 否 | 运算符(当type为condition时必填) |
filter.value | any | 否 | 条件值(当type为condition时必填) |
filter.children | object[] | 否 | 子筛选条件(当type为group时使用) |
filter.children.type | string | 是 | 筛选类型,当type为condition时,field/operator/value为必填;当type为group时,logic为必填 可选值: "group""condition" |
filter.children.logic | string | 否 | 逻辑操作符,不区分大小写 可选值: "AND""OR" |
filter.children.field | string | 否 | 字段ID或别名(当type为condition时必填) |
filter.children.operator | string | 否 | 运算符(当type为condition时必填) |
filter.children.value | any | 否 | 条件值(当type为condition时必填) |
filter.children.children | object | 否 | 筛选器配置 |
filter.children.children.type | string | 是 | 筛选类型,当type为condition时,field/operator/value为必填;当type为group时,logic为必填 可选值: "group""condition" |
filter.children.children.logic | string | 否 | 逻辑操作符,不区分大小写 可选值: "AND""OR" |
filter.children.children.field | string | 否 | 字段ID或别名(当type为condition时必填) |
filter.children.children.operator | string | 否 | 运算符(当type为condition时必填) |
filter.children.children.value | any | 否 | 条件值(当type为condition时必填) |
filter.children.children.children | object[] | 否 | 子筛选条件(当type为group时使用) |
filter.children.children.children.type | string | 是 | 筛选类型,当type为condition时,field/operator/value为必填;当type为group时,logic为必填 可选值: "group""condition" |
filter.children.children.children.logic | string | 否 | 逻辑操作符,不区分大小写 可选值: "AND""OR" |
filter.children.children.children.field | string | 否 | 字段ID或别名(当type为condition时必填) |
filter.children.children.children.operator | string | 否 | 运算符(当type为condition时必填) |
filter.children.children.children.value | any | 否 | 条件值(当type为condition时必填) |
filter.children.children.children.children | object | 否 | 筛选器配置 |
sorts | object[] | 否 | 排序字段列表 |
sorts.field | string | 是 | 字段ID或别名 |
sorts.isAsc | boolean | 否 | 是否升序,默认为降序 |
search | string | 否 | 关键字模糊搜索 |
tableView | boolean | 否 | 是否用表格视图格式返回记录数据 |
useFieldIdAsKey | boolean | 否 | 返回数据时字段名称是否使用ID,默认使用别名 |
includeTotalCount | boolean | 否 | 是否返回总记录行数 |
includeSystemFields | boolean | 否 | 是否返回系统字段 |
响应参数
200成功获取记录列表| 名称 | 类型 | 描述 |
|---|---|---|
success | boolean | 是否调用成功 |
error_code | integer | 错误代码 |
error_msg | string | 错误消息 |
data | object | 记录列表查询结果 |
data.rows | object[] | 记录列表 |
data.rows.id | string | 行记录 ID |
data.rows.{field} | string | 动态字段值,键为字段ID或别名 |
data.rows._createdAt | string | 创建时间 |
data.rows._createdBy | object | 创建人信息 |
data.rows._createdBy.id | string | 人员 id |
data.rows._createdBy.name | string | 名称 |
data.rows._createdBy.avatar | string | 头像地址 |
data.rows._createdBy.isPortal | boolean | 是否为门户用户 |
data.rows._createdBy.status | integer | 状态 |
data.rows._createdBy.accountId | string | 人员 id (兼容字段) |
data.rows._createdBy.fullname | string | 名称 (兼容字段) |
data.rows._updatedAt | string | 更新时间 |
data.rows._updatedBy | object | 更新人信息 |
data.rows._updatedBy.id | string | 人员 id |
data.rows._updatedBy.name | string | 名称 |
data.rows._updatedBy.avatar | string | 头像地址 |
data.rows._updatedBy.isPortal | boolean | 是否为门户用户 |
data.rows._updatedBy.status | integer | 状态 |
data.rows._updatedBy.accountId | string | 人员 id (兼容字段) |
data.rows._updatedBy.fullname | string | 名称 (兼容字段) |
data.rows._owner | object | 拥有者信息 |
data.rows._owner.id | string | 人员 id |
data.rows._owner.name | string | 名称 |
data.rows._owner.avatar | string | 头像地址 |
data.rows._owner.isPortal | boolean | 是否为门户用户 |
data.rows._owner.status | integer | 状态 |
data.rows._owner.accountId | string | 人员 id (兼容字段) |
data.rows._owner.fullname | string | 名称 (兼容字段) |
data.total | integer | 总记录数 |
curl -X POST "https://example.com/v3/app/worksheets/worksheet_id/rows/list" \ -H "HAP-Appkey: {{HAP-Appkey}}" \ -H "HAP-Sign: {{HAP-Sign}}" \ -H "Content-Type: application/json" \ -d '{ "pageSize": 20, "pageIndex": 1, "viewId": "view_123", "fields": [ "field1", "field2" ], "filter": { "type": "group", "logic": "OR", "children": [ { "type": "group", "logic": "AND", "children": [ { "type": "condition", "field": "677b4a73d14fcf3edf4e7f15", "operator": "eq", "value": [ "1" ] }, { "type": "condition", "field": "677b4a73d14fcf3edf4e7f15", "operator": "eq", "value": "test" } ] } ] }, "sorts": { "type": "array", "description": "排序字段", "items": { "type": "object", "properties": { "field": { "type": "string", "description": "字段ID或别名" }, "isAsc": { "type": "boolean", "description": "是否升序,默认为降序" } }, "required": [ "field" ] } }, "examples": { "default": { "value": { "pageSize": 20, "pageIndex": 1, "viewId": "view_123", "fields": [ "field1", "field2" ], "filter": { "type": "group", "logic": "OR", "children": [ { "type": "group", "logic": "AND", "children": [ { "type": "condition", "field": "677b4a73d14fcf3edf4e7f15", "operator": "eq", "value": [ "1" ] }, { "type": "condition", "field": "677b4a73d14fcf3edf4e7f15", "operator": "eq", "value": "test" } ] } ] }, "sorts": [ { "field": "createdAt", "isAsc": true } ] } } } }'{ "data": { "rows": [ { "id": "row123", "fields": [ { "id": "field1", "value": "示例值", "type": "2", "controlName": "文本字段" } ], "_createdBy": { "accountId": "user123", "fullname": "张三" }, "_owner": { "accountId": "user123", "fullname": "张三" }, "_createdAt": "2024-03-25 15:52:58", "_updatedAt": "2024-03-25 15:52:58", "_updatedBy": { "accountId": "user123", "fullname": "张三" } } ], "total": 100, "pageIndex": 1, "pageSize": 20 }, "success": true}