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

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": "24136421",
            "name": "测试省市级联",
            "key": "field_1",
            "type": "18",
            "custom_field_options": [
                {
                    "key": "1",
                    "value": "北京市",
                    "subset_value": [
                        {
                            "key": "26",
                            "value": "海淀区"
                        },
                        {
                            "key": "27",
                            "value": "朝阳区"
                        },
                        {
                            "key": "28",
                            "value": "西城区"
                        }
                    ]
                },
                {
                    "key": "6",
                    "value": "吉林省",
                    "subset_value": [
                        {
                            "key": "29",
                            "value": "长春市"
                        },
                        {
                            "key": "30",
                            "value": "吉林市"
                        },
                        {
                            "key": "31",
                            "value": "四平市"
                        }
                       ...
                    ]
                }
            ]
        }
    ]
}

页面工具