帮我吧文档:数据接口:客户管理:公司字段

JSON格式

名称 类型 注释
id int 字段id,字段在创建的时候由系统自动分配,系统字段默认为1
url varchar 字段的资源url
name varchar 字段名字
key varchar 字段的唯一标识
type int 字段类型,取值为:1-下拉列表,2-单行文本,3-多行文本,4-正整数,5-小数,6-复选框,7-正则表达式,8-日期(格式为:2018-02-03),12-附件,14-高级复选框,17-电话类型的文本,18-级联
system tinyint 是否为系统字段,取值为:1-系统字段,0-自定义字段
custom_field_options array 下拉列表或高级复选框的选项,如果字段类型是下拉列表或高级复选框,该字段会有值。
cascade_options object级联的选项,如果字段类型是级联,该字段会有值。级联示例:北京市-北京市-丰台区-总部基地

JSON示例

{
    "id":"13",
    "url":"https://www.bangwo8.com/api/v1/companies/company_fields/13.json",
    "name":"高级复选框字段",
    "key":"multi_checkbox",
    "type":14,
    "system":"0",
    "custom_field_options":[
        {
            "key":"22",
            "value":"选项1"
        },
        {
            "key":"23",
            "value":"选项2"
        },
        {
            "key":"24",
            "value":"选项3"
        },
        {
            "key":"25",
            "value":"选项4"
        }
    ],
    "cascade_options":[//级联字段最多5级
	{
		"level_id":"0",//级联第一级的“level_id”固定为0
		"parent_key":"0",//级联第一级的“parent_key”固定为0
		"item_key":"11",
		"item_value":"北京市"
	},
	{
		"level_id":"0",
		"parent_key":"0",
		"item_key":"12",
		"item_value":"河北省"
	},
	{
		"level_id":"1",//级联第二级的“level_id”固定为1
		"parent_key":"11",
		"item_key":"111",
		"item_value":"海淀区"
	},
	{
		"level_id":"1",
		"parent_key":"11",
		"item_key":"112",
		"item_value":"朝阳区"
	},
	{
		"level_id":"1",
		"parent_key":"11",
		"item_key":"113",
		"item_value":"丰台区"
	},
	{
		"level_id":"1",
		"parent_key":"12",
		"item_key":"121",
		"item_value":"石家庄市"
	},
	{
		"level_id":"1",
		"parent_key":"12",
		"item_key":"122",
		"item_value":"保定市"
	}
    ]
}

查询公司字段列表

GET /api/v1/companies/company_fields.json

调用者权限

管理员

调用示例

curl https://www.bangwo8.com/api/v1/companies/company_fields.json -u {account}:{password}

返回值示例

Status: 200 OK

{
    "company_fields":[
        {
            "id":"13",
            "url":"https://www.bangwo8.com/api/v1/companies/company_fields/13.json",
            "name":"高级复选框字段",
            "key":"multi_checkbox",
            "type":14,
            "system":"0",
            "custom_field_options":[
                {
                    "key":"22",
                    "value":"选项1"
                },
                {
                    "key":"23",
                    "value":"选项2"
                },
                {
                    "key":"24",
                    "value":"选项3"
                },
                {
                    "key":"25",
                    "value":"选项4"
                }
            ]
        },
        {
            "id":"21",
            "url":"https://www.bangwo8.com/api/v1/companies/company_fields/21.json",
            "name":"级联字段",
            "key":"region",
            "type":18,
            "system":"0",
            "cascade_options":[
                {
                    "key":"1",
                    "value":"北京市",
                    "sub-items":[
                        {
                            "key":"11",
                            "value":"海淀区",
                            "sub-items":[
                                {
                                    "key":"111",
                                    "value":"知春路"
                                },
                                {
                                    "key":"112",
                                    "value":"五道口"
                                },
                                {
                                    "key":"113",
                                    "value":"上地"
                                }
                            ]
                        },
                        {
                            "key":"12",
                            "value":"丰台区",
                            "sub-items":[
                                {
                                    "key":"121",
                                    "value":"右安门街道"
                                },
                                {
                                    "key":"122",
                                    "value":"丰台街道"
                                },
                                {
                                    "key":"123",
                                    "value":"新村街道"
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ]
}

页面工具