帮我吧文档:数据接口:表单字段

JSON格式

名称 类型 注释
id int 字段id,字段在创建的时候由系统自动分配
url varchar 字段的资源url
name varchar 字段名称
key varchar 字段的唯一标识
type int 字段类型,取值为:1-下拉列表,2-单行文本,3-多行文本,4-正整数,5-小数,6-复选框,8-日期(格式为:2018-02-03),12-附件,13-评星
custom_field_options array 下拉列表的选项。如果字段类型是下拉列表,该字段会有值。

JSON示例

{

   "id": 1,
   "url": "https://www.bangwo8.com/api/v1/forms/221/form_fields/1.json",
   "name": "爱好",
   "key": "field_10",
   "type": "1",
   "system": "0",
   "custom_field_options": [//key为下拉选项的ID
     {
       "key": "231",
       "value": "读书"
     },
     {
       "key": "232",
       "value": "旅行"
     },
     {
       "key": "233",
       "value": "健身"
     }
  ]
 

}

查询指定表单的字段列表

GET /api/v1/forms/{id}/form_fields.json

调用者权限

管理员

调用示例

curl https://www.bangwo8.com/api/v1/forms/91739/form_fields.json -u {account}:{password}

返回值示例

Status: 200 OK

{
  "form_fields":[
   {
      "id": 1,
      "name": "爱好",
      "key": "field_10",
      "type": "1",
      "custom_field_options": [
        {
         "key": "231",
         "value": "读书"
        },
        {
         "key": "232",
         "value": "旅行"
        },
        {
         "key": "233",
         "value": "健身"
        }
       ]
    },
    {
      "id": 2,
      "name": "姓名",
      "key": "field_4",
      "type": "2",
      "custom_field_options": [
       ]
    }
    ...
  ]
}

页面工具