查询多条数据
描述
根据数据筛选条件查询表单中的多条数据
使用须知
开发前,请仔细阅读开发指南。
- POST请求头
{"Authorization": "Bearer YOUR_APIKEY"}
YOUR_APIKEY
请阅读开发指南了解。
接口URL
POST - /openapi/v1/app/{app_id}/entry/{entry_id}/data
名词解释
名称 | 说明 |
---|---|
app_id | 应用ID |
entry_id | 该应用内的表单ID |
app_id
+entry_id
表示全局唯一的表单标识,前往开放平台中的API文档进行查看。
请求参数
参数名 | 示例值 | 参数类型 | 是否必填 | 参数描述 |
---|---|---|---|---|
limit | 100 | Number | 否 | 查询的数据条数,1~300,默认300 |
skip | 0 | Number | 否 | 翻页起始值索引 |
fields | _widget_1499052693182 | Array | 否 | 需要查询的数据字段 |
batch_id | String | 否 | 数据批量操作时webhook推送的batch_id,可查询对应的一组数据 | |
isbackup | Number | 否 | 不传默认查询未删除的; 1 查询回收站的; 0 不限制,都查询 | |
data_id | Array | 否 | 需要查询的数据_id | |
filter | Object | 否 | 数据筛选器 | |
filter.rel | and | String | 否 | 筛选组合关系,and或or |
filter.cond | Object | 否 | 过滤条件列表 | |
filter.cond.field | _widget_1499052693182 | String | 否 | 字段别名 |
filter.cond.method | empty | String | 否 | 过滤方法 |
sort | Object | 否 | 排序(asc:正序;desc:倒序),不限制排序字段的数量,复选框组、下拉复选框、地址、定位、图片、附件、手写签名、成员单选、成员多选、部门单选、部门多选不可作为排序字段 |
请求示例
{
"limit": 100,
"skip": 0,
"fields": [
"_widget_1499052693182",
"_widget_1499052693195",
"_widget_1499052693206"
],
"filter": {
"rel": "and",
"cond": [
{
"field": "_widget_1499052693182",
"method": "empty"
},
{
"field": "_widget_1499052693195",
"method": "not_empty"
},
{
"field": "_widget_1499052693206",
"method": "empty"
}
]
},
"sort": {
"_widget_1499052693182": "desc",
"_widget_1499052693195": "asc"
}
}
响应参数
参数名 | 示例值 | 参数类型 | 参数描述 |
---|---|---|---|
data | - | Object | 返回数据内容 |
data.appId | 572177e6951f4dc54168c1eb | String | 应用id |
data.entryId | 5ebc5c2deee7ea61f7ac25df | String | 表单id |
data._id | 5a0a96541a1edd8f444a9181 | String | |
data.flowState | - | String | 流程状态,该字段仅流程表单支持 2表示流程手动结束 1表示流程已结束 0表示流程进行中 |
data.creator | null | Object | 提交人 |
响应数据样例
{
"data": [
{
"appId": "572177e6951f4dc54168c1eb",
"entryId": "5ebc5c2deee7ea61f7ac25df",
"creator": {
"name": "张三",
"_id": "5d66359813f33ef2e45916f2"
},
"deleter": null,
"updater": {
"name": "张三",
"_id": "5d66359813f33ef2e45916f2"
},
"createTime": "2022-01-19 11:46:53",
"updateTime": "2022-01-19 14:22:30",
"deleteTime": null,
"_id": "53240448e172bd9f00cd85ee",
"flowState": "0",
"单行文本": "张三",
"多行文本": "webapi",
"数字": "8",
"日期时间": "2019-01-01 00:00:00",
"单选按钮组": "一年级",
"复选框组": [
"选项1"
],
"下拉框": "女",
"下拉复选框": [
"选项1"
],
"地址": {
"province": "湖南省",
"city": "长沙市",
"district": "芙蓉区",
"detail": "韶山北路"
},
"定位": {
"province": "湖南省",
"city": "长沙市",
"district": "芙蓉区",
"detail": "韶山北路",
"lnglatXY": [
112.99627
]
},
"图片": [
{
"name": "123.jpg",
"size": 68065,
"mime": "image/jpeg",
"url": "https://www.xxxxx.com/FvNMG4BF9LEsbSv3HaO5gA9U0rQz"
}
],
"附件": [
{
"name": "新建文本文档.txt",
"size": "0",
"mime": "text/plain",
"url": "https://www.xxxxx.com/Fto5o-5ea0sNMlW_75VgGJCv2AcJ"
}
],
"子表单": [
{
"单行文本_子表单": "张三"
}
],
"流水号": "00009",
"手写签名": [
{
"name": "bbysignature_1642573334281.png",
"size": "5311",
"mime": "image/png",
"url": "https://www.xxxxx.com/FvcphmzkK_18fD2WFNbAQZDXyeR2"
}
],
"成员单选": {
"name": "万和",
"_id": "5577ebc4504e8e77036d2a09"
},
"成员多选": [
{
"name": "万和",
"_id": "5577ebc4504e8e77036d2a09"
}
],
"部门单选": {
"name": "人事部",
"_id": "51d1177b964603db9e60a962"
},
"部门多选": [
{
"name": "人事部",
"_id": "51d1177b964603db9e60a962"
}
]
}
]
}