表单数据列表

HTTP Request

GET|PUT /apaas/api/v2/form_entities

HEADERS

字段名 是否必填 描述
ACCESS-TOKEN true 授权token(aPaas提供)

URL Parameters

字段名 是否必填 描述
custom_form_id 表单ID
search_column_name 搜索字段name, 适用于text_field、text_area、email_field、mobile_field、tel_field、url_field、auto_number_field
query search_column_name对应的搜索内容
filters 筛选列表 [ { name: 自定义字段name, op: 匹配方式(in/eq/within)}, value: 匹配值 ],适用于select_field、multi_select、select2_field、datetime_field、address_select、datetime_range_field、integer_field、float_field、currency_field
sort 排序组合 [ { 自定义字段name: 排序方式(asc/desc)} ]
scope tab对应的数据,取值来源于列表页设置返回的tabs
page 页码
per_page 每页的数量

请求参数Body(示例)

{
    "page": 1,
    "per_page": 20,
    "custom_form_id": 2,
    "search_column_name": "text_1691474633936_f856b9",
    "query": "xxxxxxxx",
    "filters": [
      {"name": "id", "op": "in", "value": [11, 22]},
      {"name": "select_1691125929052_d05a00", "op": "in", "value": ["H6Qq/ojoIFNyICUXzx3UOw=="]}, // 单选
      {"name": "multi_select_1691562342042_e0b50f", "op": "in", "value": ["qxjjDA3ECTzu2olh+sPR9A==", "QpbX0pPJ6koOUsZBXwtclg=="]}, // 多选
      {"name": "created_at", "op": "within", "value": ["2023-08-14 12:00:00", "2023-08-14 15:00:00"]}, // 时间
      {"name": "address_select_1692266369719_510d42", "op": "eq", "value": {"city_id": "73", "country_id": "4","district_id": "732","province_id": "9"}}, // 国家、省、市、区查询
      {"name": "datetime_range_field_1692266369719_513d41", "op":"within", "value": ["2023-08-20 00:00:00", "2023-08-26 02:00:00"]}, // 起止时间
      {"name": "integer_field_1692266369719_578e31", "op":"within", "value": [10, 20]}, // 数字、金额
      {"name": "user", "op":"in", "value": {"user_ids": [1, 2], "department_ids": [3, 4] }}, // 用户、部门
       {"name": "nest_2324013095370acf", "op": "eq", "value": {"level_0": "60943MKVMq0Erpe9dUdV7w==", "level_1": "WkFg1hVKiht2xdOjfhlpqQ==" }} // 级联
    ],
    "sort": [{ "created_at": "desc" }, {"id": "asc"}],
    "only_field_names": [
      "id", "custom_form_id", "app_id", "text_1691116765689_fe4558", "user", "created_at", "updated_at"
    ]
}

返回数据字段说明

字段名 参数类型 描述
models Array 数据列表
next_page int 下一页
prev_page int 上一页
total_count Int 总数据量
total_pages Int 总页数
current_page Int 当前页
page int 页码
per_page int 每页的数量
only_field_names Array 需要返回的字段名列表 可选参数, 按需返回需要的字段可以提升程序处理速度和减少网络带宽占用

列表返回数据

{
  "code": 0,
  "message": "success",
  "remark": "成功",
  "data": {
    "models": [
      {
        "app_id": 4,
        "custom_form_id": 13,
        "created_at": "2023-08-16T15:29:15.318+08:00",
        "updated_at": "2023-09-26T10:29:39.440+08:00",
        "id": 30,
        "text_1691116765689_fe4558": "哇咔隧道咔a 133333a a",
        "user": {
          "uid": 1,
          "name": "test",
          "phone": null,
          "path_uid": null,
          "third_userid": null
        }
      },
      {
        "app_id": 4,
        "custom_form_id": 13,
        "created_at": "2023-08-22T14:25:40.156+08:00",
        "updated_at": "2023-09-05T16:50:53.134+08:00",
        "id": 1027,
        "text_1691116765689_fe4558": "哇咔隧道咔a 133333a a",
        "user": {
          "uid": 1,
          "name": "test",
          "phone": null,
          "path_uid": null,
          "third_userid": null
        }
      },
      {
        "app_id": 4,
        "custom_form_id": 13,
        "created_at": "2023-08-22T14:25:40.149+08:00",
        "updated_at": "2023-08-22T14:25:40.149+08:00",
        "id": 1026,
        "text_1691116765689_fe4558": "哇咔隧道咔a 133333a a",
        "user": {
          "uid": 1,
          "name": "test",
          "phone": null,
          "path_uid": null,
          "third_userid": null
        },
      },
      {
        "app_id": 4,
        "custom_form_id": 13,
        "created_at": "2023-08-22T14:25:40.143+08:00",
        "updated_at": "2023-08-22T14:25:40.143+08:00",
        "id": 1025,
        "text_1691116765689_fe4558": "哇咔隧道咔a 133333a a",
        "user": {
          "uid": 1,
          "name": "test",
          "phone": null,
          "path_uid": null,
          "third_userid": null
        }
      }
    ],
    "total_count": 401,
    "total_pages": 200,
    "next_page": 2,
    "prev_page": null,
    "current_page": 1,
    "per_page": 4,
    "page": 1
  }
}

表单数据列表ID集合

HTTP Request

GET|PUT /apaas/api/v2/form_entities/ids

URL Parameters

字段名 是否必填 描述
custom_form_id 表单ID
search_column_name 搜索字段name, 适用于text_field、text_area、email_field、mobile_field、tel_field、url_field、auto_number_field
query search_column_name对应的搜索内容
filters 筛选列表 [ { name: 自定义字段name, op: 匹配方式(in/eq/within)}, value: 匹配值 ],适用于select_field、multi_select、select2_field、datetime_field、address_select、datetime_range_field、integer_field、float_field、currency_field
sort 排序组合 [ { 自定义字段name: 排序方式(asc/desc)} ]
scope tab对应的数据,取值来源于列表页设置返回的tabs

请求参数Body(示例)

{
    "custom_form_id": 2,
    "search_column_name": "text_1691474633936_f856b9",
    "query": "xxxxxxxx",
    "filters": [
      {"name": "id", "op": "in", "value": [11, 22]},
      {"name": "select_1691125929052_d05a00", "op": "in", "value": ["H6Qq/ojoIFNyICUXzx3UOw=="]}, // 单选
      {"name": "multi_select_1691562342042_e0b50f", "op": "in", "value": ["qxjjDA3ECTzu2olh+sPR9A==", "QpbX0pPJ6koOUsZBXwtclg=="]}, // 多选
      {"name": "created_at", "op": "within", "value": ["2023-08-14 12:00:00", "2023-08-14 15:00:00"]}, // 时间
      {"name": "address_select_1692266369719_510d42", "op": "eq", "value": {"city_id": "73", "country_id": "4","district_id": "732","province_id": "9"}}, // 国家、省、市、区查询
      {"name": "datetime_range_field_1692266369719_513d41", "op":"within", "value": ["2023-08-20 00:00:00", "2023-08-26 02:00:00"]}, // 起止时间
      {"name": "integer_field_1692266369719_578e31", "op":"within", "value": [10, 20]}, // 数字、金额
      {"name": "user", "op":"in", "value": {"user_ids": [1, 2], "department_ids": [3, 4] }}, // 用户、部门
      {"name": "nest_2324013095370acf", "op": "eq", "value": {"level_0": "60943MKVMq0Erpe9dUdV7w==", "level_1": "WkFg1hVKiht2xdOjfhlpqQ==" }} // 级联
    ],
    "sort": [{ "created_at": "desc" }, {"id": "asc"}]
}

返回数据字段说明

字段名 参数类型 描述
ids Array 数据id数组

返回数据

{
    "code": 0,
    "message": "success",
    "remark": "成功",
    "data": {
        "ids": [
            47,
            46,
            45,
            44,
            43,
            42,
            41,
            40,
            39,
            38,
            37,
            36,
            35,
            24
        ]
    }
}

表单数据Simple列表

HTTP Request

GET /apaas/api/v2/form_entities/simple

HEADERS

字段名 是否必填 描述
ACCESS-TOKEN true 授权token(aPaas提供)

URL Parameters

字段名 是否必填 描述
custom_form_id 自定义表单ID
query 主字段值 like 查询
page 页码
per_page 每页的数量

返回数据

{
  "code": 0,
  "message": "success",
  "remark": "成功",
  "data": {
    "models": [
      {
        "value": 1027,
        "label": "ddd",
        "id": 1027,
        "text_1691116775689_fb4558": "ddd"
      }
    ],
    "next_page": null,
    "prev_page": null,
    "current_page": 1,
    "per_page": 15,
    "page": 1
  }
}

创建表单数据

HTTP Request

POST /apaas/api/v2/form_entities

HEADERS

字段名 是否必填 描述
ACCESS-TOKEN true 授权token(aPaas提供)

URL Parameters

字段名 是否必填 描述
custom_form_id 表单ID

Body Parameters

字段名 是否必填 描述
form_entity json 表单数据
only_field_names Array 需要返回的字段名列表 可选参数, 按需返回需要的字段可以提升程序处理速度和减少网络带宽占用

请求正文

{
    "only_field_names": [
      "id", "created_at", "updated_at"
    ],
    "form_entity": {
        "text_1691116765689_fe45581": "哇咔隧道咔a 133333a a",
        "select_1691125929052_d05a00": "H6Qq/ojoIFNyICUXzx3UOw==",
        "multi_select_1691562342042_e0b50f": ["qxjjDA3ECTzu2olh+sPR9A==","QpbX0pPJ6koOUsZBXwtclg=="],
        "address_select_1692580744482_e108c6":  {
          "country_id": "4", "province_id": "9",
          "city_id": "73", "district_id": "732", "detail_address": "马路口驴子街"
        },
        "geo_address_1692673349914_fc5d81": {
            "latitude": 29.952211,
            "longitude": 90.080563
        },
        "datetime_range_field_1692266369719_513d41": ["2023-08-20 00:01:00", "2023-08-25 23:59:59"],
        "file_field_1692266369719_123d41": [
            {"id": 1, "name": "test1.jpg", "file_file_name": "test1.jpg", "file_content_type": "jpg", "file_file_size": 10, "file_url""https://dn-ikcrm-files-dev.qbox.me/attachments/files/403692/xxxx.gif"},
            {"id": 2, "name": "test2.jpg", "file_file_name": "test2.jpg", "file_content_type": "jpg", "file_file_size": 10, "file_url""https://dn-ikcrm-files-dev.qbox.me/attachments/files/403692/xxxx.gif"},
            {"id": 4, "name": "test4.jpg", "file_file_name": "test4.jpg", "file_content_type": "jpg", "file_file_size": 10, "file_url""https://dn-ikcrm-files-dev.qbox.me/attachments/files/403692/xxxx.gif"},
            {"id": 3, "name": "test3.jpg", "file_file_name": "test3.jpg", "file_content_type": "jpg", "file_file_size": 10, "file_url""https://dn-ikcrm-files-dev.qbox.me/attachments/files/403692/xxxx.gif"}
        ],
        "nest_2324013095370acf": {
            "level_0": "60943MKVMq0Erpe9dUdV7w==",
            "level_1": "WkFg1hVKiht2xdOjfhlpqQ=="
        }
    }
}

返回数据

{
    "code": 0,
    "message": "success",
    "remark": "成功",
    "data": {
        "created_at": "2023-08-16T15:29:15.318+08:00",
        "updated_at": "2023-08-22T15:31:52.299+08:00",
        "id": 30
    }
}

更新表单数据

HTTP Request

PUT|POST /apaas/api/v2/form_entities/:id

HEADERS

字段名 是否必填 描述
ACCESS-TOKEN true 授权token(aPaas提供)

URL Parameters

字段名 是否必填 描述
id 表单数据ID
custom_form_id 表单ID

Body Parameters

字段名 是否必填 描述
form_entity json 表单数据
only_field_names Array 需要返回的字段名列表 可选参数, 按需返回需要的字段可以提升程序处理速度和减少网络带宽占用

请求正文

{
    "only_field_names": [
      "id", "created_at", "updated_at"
    ],
    "form_entity": {
        "text_1691116765689_fe45581": "哇咔隧道咔a 133333a a",
        "select_1691125929052_d05a00": "H6Qq/ojoIFNyICUXzx3UOw==",
        "multi_select_1691562342042_e0b50f": ["qxjjDA3ECTzu2olh+sPR9A==","QpbX0pPJ6koOUsZBXwtclg=="],
        "address_select_1692580744482_e108c6":  {
          "country_id": "4", "province_id": "9",
          "city_id": "73", "district_id": "732", "detail_address": "马路口驴子街"
        },
        "geo_address_1692673349914_fc5d81": {
            "latitude": 29.952211,
            "longitude": 90.080563
        },
        "usr_23269095707e8": [
            {"uid": 4, "name": "test1", "third_userid": null}
        ],
        "dept_232691000022d": [
            {"did": 1, "name": "dept1", "third_dept_id": null}
        ],
        "nest_2324013095370acf": {
            "level_0": "60943MKVMq0Erpe9dUdV7w==",
            "level_1": "WkFg1hVKiht2xdOjfhlpqQ=="
        },
        "cu_rela_2324018421118": {
            "value": 1,
            "label": "上海微问家",
            "relation_source": {
                "id": 23,
                "name": "data_1_3_9ddabc",
                "label": "推广线索",
                "external_type": ""
            }
        }

    }
}

返回数据

{
    "code": 0,
    "message": "success",
    "remark": "成功",
    "data": {
        "created_at": "2023-08-16T15:29:15.318+08:00",
        "updated_at": "2023-08-29T16:42:17.772+08:00",
        "id": 30
    }
}

表单字段计算

HTTP Request

GET /apaas/api/v2/form_entities/evaluate

Body Parameters

字段名 是否必填 描述
id 表单数据ID
custom_form_id 表单ID
field_name 需要计算的字段name

请求正文

{
    "id": 1, // 新增数据时id不存在,不需要传
    "custom_app_id": 2,
    "custom_form_id": 3,
    "field_name": "text_169111676456_af4re5t",
    "form_entity": { // 当前表单
        "float_1691116765689_fe45581": 3.45,
        "integer_1691125929052_d05a00": 1.12,
        "cu_rela_2324018421118": {
            "value": 1,
            "label": "上海微问家",
            "relation_source": {
                "id": 23,
                "name": "data_1_3_9ddabc",
                "label": "推广线索",
                "external_type": ""
            }
        }
    },
    "data_1_3_9ddabc": { // 引用表单
        "id": 2, // 引用数据的id
        "float_1691116765689_9ddabc": 5.78,
        "integer_1691116765689_9ddabc": 6.23,
    }
}

返回数据

{
    "code": 0,
    "message": "success",
    "remark": "成功",
    "data": {
       "value": 1212.11
    }

表单数据详情

HTTP Request

GET /apaas/api/v2/form_entities /:id?only_field_names[]=id&only_field_names[]=app_id&only_field_names[]=custom_form_id&only_field_names[]=text_1691116765689_fe4558&only_field_names[]=user&only_field_names[]=created_at&only_field_names[]=updated_at

HEADERS

字段名 是否必填 描述
ACCESS-TOKEN true 授权token(aPaas提供)

URL Parameters

字段名 是否必填 描述
id 表单数据ID
custom_form_id 表单ID
only_field_names[] 需要返回的字段名列表多个字段指定多个相同的 only_field_names[]

返回数据

{
    "code": 0,
    "message": "success",
    "remark": "成功",
    "data": {
        "app_id": 4,
        "custom_form_id": 13,
        "created_at": "2023-08-16T15:29:15.318+08:00",
        "updated_at": "2023-08-16T15:29:15.318+08:00",
        "id": 30,
        "text_1691116765689_fe4558": "哇咔隧道咔a 133333a a",
        "user": {
            "id": 1,
            "name": "test"
        }
    }
}

表单数据转移

HTTP Request

PUT /apaas/api/v2/form_entities/transfer

Body Parameters

字段名 是否必填 描述
ids true 表单数据ID数组
custom_form_id true 表单ID
to_user_uid true 新负责人用户id

请求参数Body(示例)

{
    "custom_form_id": 2,
    "ids": [1, 2],
    "to_user_uid": 3
}

返回数据

{
    "code": 0,
    "message": "success",
    "remark": "成功"
}

批量删除表单数据

HTTP Request

DELETE /apaas/api/v2/form_entities/mass_destroy

Body Parameters

字段名 是否必填 描述
ids 表单数据ID
custom_form_id 表单ID

请求正文

{
    "ids": [26],
    "custom_form_id": 2
}

返回数据

{
    "code": 0,
    "message": "success",
    "remark": "成功",
    "data": {
        "id": 58,
        "name": "text_1691116765689_fe4558",
        "label": "滴滴答答",
        "status": "enable",
        "status_i18n": "启用",
        "field_type": "text_field",
        "field_type_i18n": "单行文本",
        "custom_field_group_id": 17,
        "setting": {},
        "created_at": "2023-08-04T10:49:26.036+08:00",
        "updated_at": "2023-08-04T14:17:15.142+08:00"
    }
}
文档更新时间: 2024-06-18 14:40   作者:蒋海军