===== 查询工单自定义字段列表 ===== ==== 请求参数 ==== ==== 请求地址 ==== GET /api/v1/tickets/ticket_fields.json ==== 调用者权限 ==== 所有客服 ==== 调用示例 ==== curl https://www.bangwo8.com/api/v1/tickets/ticket_fields.json -v -u {account}:{password} ==== 返回参数 ==== ^名称 ^类型 ^注释 ^ |id |int |字段id,系统自动分配 | |url |varchar |字段的资源url | |name |varchar |字段名字 | |key |varchar |字段的唯一标识 | |system |tinyint |是否为系统字段,取值为:1-系统字段,0-自定义字段,默认为0 | |type |int |字段类型,取值为:1-下拉列表,2-单行文本,3-多行文本,4-正整数,5-小数,6-复选框,7-正则表达式,8-日期(格式为:2018-02-03),11-表单,12-附件,13-评星,14-高级复选框,15-商品表,16-满意度评价表,17-电话类型的文本,18-级联字段,20-资产表 | |isRequired |tinyint |是否必选,取值为:1-非必选,0-必选 | |isReadonly |tinyint |是否只读,取值为:1-只读,0-可编辑 | |readonly_range |int |只读范围,只有isReadonly取值为1时,该参数才生效。取值为:1-所有客服,2-客服分组,3-客服,4-当前用户。 | |readonly_support |varchar |当只读范围是某个客服时,该参数是客服id;当只读范围是某个客服分组时,该参数是客服分组id。 | |custom_field_options |array |展示下拉列表、高级复选款选项或级联目录,如果字段类型是下拉列表或者高级复选框,该字段会展示下拉列表和高级复选框的选项;如果字段是级联字段,会展示级联的多级目录;其他的字段类型展示为空。 | |custom_field_table |array |表单的列,如果字段类型是表单或商品表单,该字段会有值。 | ==== 返回示例 ==== [     {         "id": "8769479",         "name": "新梯数据表",         "key": "field_1",         "type": "12",         "isRequired": "0",         "isReadonly": "0"     },     {         "id": "8769482",         "name": "电梯日常使用状况检查表",         "key": "field_2",         "type": "12",         "isRequired": "0",         "isReadonly": "0"     },     {         "id": "8769485",         "name": "保养汇总表",         "key": "field_3",         "type": "12",         "isRequired": "0",         "isReadonly": "0"     },     {         "id": "8769488",         "name": "电/扶梯保养记录表",         "key": "field_4",         "type": "12",         "isRequired": "0",         "isReadonly": "0"     },     {         "id": "8769491",         "name": "曳引与强制驱动电梯日常维修保养记录单",         "key": "field_5",         "type": "12",         "isRequired": "0",         "isReadonly": "0"     },     {         "id": "8769494",         "name": "深圳市特种设备安装改造大修告知书",         "key": "field_6",         "type": "12",         "isRequired": "0",         "isReadonly": "0"     },     {         "id": "8769551",         "name": "深圳市特种设备安装改造大修告知书-告知设备清单",         "key": "field_7",         "type": "12",         "isRequired": "0",         "isReadonly": "0"     },     {         "id": "8769554",         "name": "中华人民共和国特种设备安装改造维修许可证",         "key": "field_8",         "type": "12",         "isRequired": "0",         "isReadonly": "0"     },     {         "id": "8769557",         "name": "安装确认表",         "key": "field_9",         "type": "12",         "isRequired": "0",         "isReadonly": "0"     },     {         "id": "8769560",         "name": "安装完成表",         "key": "field_10",         "type": "12",         "isRequired": "0",         "isReadonly": "0"     },     {         "id": "8769563",         "name": "工人签字",         "key": "field_11",         "type": "23",         "isRequired": "0",         "isReadonly": "0"     },     {         "id": "8769569",         "name": "主管签字",         "key": "field_12",         "type": "23",         "isRequired": "0",         "isReadonly": "0"     },     {         "id": "8769572",         "name": "经理签字",         "key": "field_13",         "type": "23",         "isRequired": "0",         "isReadonly": "0"     },     {         "id": "8769575",         "name": "特种设备安全监察局签字",         "key": "field_14",         "type": "23",         "isRequired": "0",         "isReadonly": "0"     },     {         "id": "8781221",         "name": "确认情况",         "key": "field_15",         "type": "1",         "isRequired": "0",         "isReadonly": "0",         "custom_field_options": [             {                 "key": "1197569",                 "value": "安装局确认"             },             {                 "key": "1197572",                 "value": "安装师傅确认"             },             {                 "key": "1197575",                 "value": "主管确认"             },             {                 "key": "1197578",                 "value": "经理确认"             }         ]     },     {         "id": "9481577",         "name": "开单日期",         "key": "field_18",         "type": "8",         "isRequired": "0",         "isReadonly": "0"     },     {         "id": "9481617",         "name": "区域",         "key": "field_19",         "type": "2",         "isRequired": "0",         "isReadonly": "0"     },     {         "id": "9481685",         "name": "胶水",         "key": "field_22",         "type": "2",         "isRequired": "0",         "isReadonly": "0"     },     {         "id": "9481693",         "name": "印刷方式",         "key": "field_24",         "type": "1",         "isRequired": "0",         "isReadonly": "0",         "custom_field_options": [             {                 "key": "1328981",                 "value": "转轮uv"             },             {                 "key": "1328985",                 "value": "普通uv"             }         ]     }, { "id": "24139508", "name": "测试级联字段", "key": "field_4", "type": "18", "isRequired": "0", "isReadonly": "0", "custom_field_options": [ { "key": "1", "value": "北京市", "subset_value": [ { "key": "26", "value": "海淀", "subset_value": [ { "key": "32", "value": "中关村" }, { "key": "33", "value": "清华大学" } ] }, { "key": "27", "value": "丰台" }, { "key": "28", "value": "朝阳" } ] }, { "key": "6", "value": "吉林省", "subset_value": [ { "key": "29", "value": "长春" }, { "key": "30", "value": "吉林" }, { "key": "31", "value": "四平" } ] } ] } ] ===== 查询工单字段列表(包含系统字段) ===== ==== 请求参数 ==== ==== 请求地址 ==== GET /api/v1/tickets/ticket_fields2.json ==== 调用者权限 ==== 所有客服 ==== 调用示例 ==== curl https://www.bangwo8.com/api/v1/tickets/ticket_fields2.json -v -u {account}:{password} ==== 返回参数 ==== ^名称 ^类型 ^注释 ^ |id |int |字段id,系统自动分配 | |url |varchar |字段的资源url | |name |varchar |字段名字 | |key |varchar |字段的唯一标识 | |system |tinyint |是否为系统字段,取值为:1-系统字段,0-自定义字段,默认为0 | |type |int |字段类型,取值为:1-下拉列表,2-单行文本,3-多行文本,4-正整数,5-小数,6-复选框,7-正则表达式,8-日期(格式为:2018-02-03),11-表单,12-附件,13-评星,14-高级复选框,15-商品表,16-满意度评价表,17-电话类型的文本,20-资产表 | |isRequired |tinyint |是否必选,取值为:1-非必选,0-必选 | |isReadonly |tinyint |是否只读,取值为:1-只读,0-可编辑 | |readonly_range |int |只读范围,只有isReadonly取值为1时,该参数才生效。取值为:1-所有客服,2-客服分组,3-客服,4-当前用户。 | |readonly_support |varchar |当只读范围是某个客服时,该参数是客服id;当只读范围是某个客服分组时,该参数是客服分组id。 | |custom_field_options |array |下拉列表的选项,如果字段类型是下拉列表,该字段会有值。 | |custom_field_table |array |表单的列,如果字段类型是表单或商品表单,该字段会有值。 | ==== 返回示例 ==== [     {         "id": "8769479",         "name": "新梯数据表",         "key": "field_1",         "type": "12",         "isRequired": "0",         "isReadonly": "0"     },     {         "id": "8769482",         "name": "电梯日常使用状况检查表",         "key": "field_2",         "type": "12",         "isRequired": "0",         "isReadonly": "0"     },     {         "id": "8769485",         "name": "保养汇总表",         "key": "field_3",         "type": "12",         "isRequired": "0",         "isReadonly": "0"     },     {         "id": "8769488",         "name": "电/扶梯保养记录表",         "key": "field_4",         "type": "12",         "isRequired": "0",         "isReadonly": "0"     },     {         "id": "8769491",         "name": "曳引与强制驱动电梯日常维修保养记录单",         "key": "field_5",         "type": "12",         "isRequired": "0",         "isReadonly": "0"     },     {         "id": "8769494",         "name": "深圳市特种设备安装改造大修告知书",         "key": "field_6",         "type": "12",         "isRequired": "0",         "isReadonly": "0"     },     {         "id": "8769551",         "name": "深圳市特种设备安装改造大修告知书-告知设备清单",         "key": "field_7",         "type": "12",         "isRequired": "0",         "isReadonly": "0"     },     {         "id": "8769554",         "name": "中华人民共和国特种设备安装改造维修许可证",         "key": "field_8",         "type": "12",         "isRequired": "0",         "isReadonly": "0"     },     {         "id": "8769557",         "name": "安装确认表",         "key": "field_9",         "type": "12",         "isRequired": "0",         "isReadonly": "0"     },     {         "id": "8769560",         "name": "安装完成表",         "key": "field_10",         "type": "12",         "isRequired": "0",         "isReadonly": "0"     },     {         "id": "8769563",         "name": "工人签字",         "key": "field_11",         "type": "23",         "isRequired": "0",         "isReadonly": "0"     },     {         "id": "8769569",         "name": "主管签字",         "key": "field_12",         "type": "23",         "isRequired": "0",         "isReadonly": "0"     },     {         "id": "8769572",         "name": "经理签字",         "key": "field_13",         "type": "23",         "isRequired": "0",         "isReadonly": "0"     },     {         "id": "8769575",         "name": "特种设备安全监察局签字",         "key": "field_14",         "type": "23",         "isRequired": "0",         "isReadonly": "0"     },     {         "id": "8781221",         "name": "确认情况",         "key": "field_15",         "type": "1",         "isRequired": "0",         "isReadonly": "0",         "custom_field_options": [             {                 "key": "1197569",                 "value": "安装局确认"             },             {                 "key": "1197572",                 "value": "安装师傅确认"             },             {                 "key": "1197575",                 "value": "主管确认"             },             {                 "key": "1197578",                 "value": "经理确认"             }         ]     },     {         "id": "9481577",         "name": "开单日期",         "key": "field_18",         "type": "8",         "isRequired": "0",         "isReadonly": "0"     },     {         "id": "9481617",         "name": "区域",         "key": "field_19",         "type": "2",         "isRequired": "0",         "isReadonly": "0"     },     {         "id": "9481685",         "name": "胶水",         "key": "field_22",         "type": "2",         "isRequired": "0",         "isReadonly": "0"     },     {         "id": "9481693",         "name": "印刷方式",         "key": "field_24",         "type": "1",         "isRequired": "0",         "isReadonly": "0",         "custom_field_options": [             {                 "key": "1328981",                 "value": "转轮uv"             },             {                 "key": "1328985",                 "value": "普通uv"             }         ]     } ] ===== 下拉字段选项全量覆盖 ===== ==== 请求参数 ==== ^名称 ^类型 ^必填 ^注释 ^ |optionName |string |是 |字段选项名称 | |extendId |int |否 |外部扩展id | ==== 调用者权限 ==== 管理员 ==== 调用示例 ==== curl https://www.bangwo8.com/api/v1/tickets/ticket_fields/24917015/allOptions.json \ -H "Content-Type: application/json" \ -d '[ { "optionName":"选项1", "extendId":"001" }, { "optionName":"选项2", "extendId":"002" }, { "optionName":"选项3", "extendId":"003" } ]' \ -v -u {account}:{password} -X PUT ==== 返回参数 ==== ^名称 ^类型 ^注释 ^ |columnId |int |字段id | |name |string |字段名称 | |key |string |下拉字段唯一标识 | |type |int |1为下拉字段 | |custom_field_options |string |字段选项列表 | custom_field_options字段选项列表说明: ^名称 ^类型 ^注释 ^ |optionId |int |选项id | |optionName |string |字段选项名称 | |extendId |int |外部扩展id | ==== 返回值示例 ==== ** 成功示例 **\\ { "columnId":"24917015", "name":"ipaas下拉字段", "key":"field_14", "type":"1", "custom_field_options":[ { "optionId":"358769", "optionName":"选项1", "extendId":"001" }, { "optionId":"358770", "optionName":"选项2", "extendId":"002" }, { "optionId":"358771", "optionName":"选项3", "extendId":"003" } ] } ** 失败示例 **\\ columnId为空时 { "state":"403", "message":"columnId does not exist" } optionName为空时: { "state":"403", "message":"optionName cannot be empty" } 当columnId对应字段不是下拉列表字段时: { "state":"10001", "message":"This field is not a drop-down field" } 当optionName参数未传递或者传参为空时: { "state":"403", "message":"optionName cannot be empty" } 当选项有重复时: { "state":"403", "message":"optionName cannot repeat" } ===== 新增、修改字段选项内容 ===== //说明:选项中原来库中已存在的会进行更新,原来库中不存在的进行新增。// ==== 请求参数 ==== ^名称 ^类型 ^必填 ^注释 ^ |parentId |int |否(修改级联字段时\\ 两字段必填一个) |帮我吧级联选项父级id(如果是一级,则该字段写0) | |extendParentId |int |::: |级联选项外部扩展父级id(如果是一级,不要传该字段) | |optionName |string |是 |字段选项名称 | |extendId |int |否 |选项的外部扩展id | ==== 请求地址 ==== PUT /api/v1/tickets/ticket_fields/{columnId}/options.json ==== 调用者权限 ==== 管理员 ==== 请求示例 ==== 下拉列表字段: curl https://www.bangwo8.com/api/v1/tickets/ticket_fields/24917015/options.json \ -H "Content-Type: application/json" \ -d '[ { "optionName":"选项1", "extendId":"001" }, { "optionName":"选项2", "extendId":"002" }, { "optionName":"选项3", "extendId":"003" } ]' \ -v -u {account}:{password} -X PUT 级联字段: curl https://www.bangwo8.com/api/v1/tickets/ticket_fields/24917015/options.json \ -H "Content-Type: application/json" \ -d '[ { "parentId":"0", "optionName":"选项1", "extendId":"001" }, { "parentId":"1", "optionName":"选项1", "extendId":"011" } ]' \ -v -u {account}:{password} -X PUT ==== 返回参数 ==== ^名称 ^类型 ^注释 ^ |columnId |int |字段id | |name |string |字段名称 | |key |string |字段唯一标识 | |type |int |字段类型(1-下拉字段,18-级联字段) |custom_field_options |string |字段选项列表 **custom_field_options字段选项列表说明:** ^名称 ^类型 ^注释 ^ |optionId |int |选项id | |optionName |string |字段选项名称 | |extendId |int |外部扩展id | ==== 返回值示例 ==== ** 成功示例 **\\ 下拉字段: { "columnId":"24917015", "name":"ipaas下拉字段", "key":"field_14", "type":"1", "custom_field_options":[ { "optionId":"358769", "optionName":"选项1", "extendId":"001" }, { "optionId":"358770", "optionName":"选项2", "extendId":"002" }, { "optionId":"358771", "optionName":"选项3", "extendId":"003" } ] } 级联字段: { "columnId":"24917015", "name":"ipaas级联字段", "key":"field_14", "type":"18", "custom_field_options":[ { "optionId":"0", "optionName":"选项1", "extendId":"001" }, { "optionId":"1", "optionName":"选项1", "extendId":"011" } ] } ** 失败示例 **\\ //请参考下拉字段选项全量覆盖接口返回参数// ===== 删除字段选项内容 ===== ==== 请求参数 ==== ^名称 ^类型 ^必填 ^注释 ^ |optionId |int |两个参数至少使用一个 |帮我吧中字段选项id | |extendId |int |::: |外部扩展id | //说明:当开发者两个参数都传,出现对应选项不同的情况以外部扩展id为准、如果外部扩展id搜索不到对应选项,则以传的帮我吧字段选项id为准。// ==== 请求地址 ==== DELETE /api/v1/tickets/ticket_fields/{columnId}/options.json ==== 调用者权限 ==== 管理员 ==== 请求示例 ==== curl -v -u {account}:{password} https://www.bangwo8.com/api/v1/tickets/ticket_fields/24917015/options.json?extendId=003&optionId=358771 \ -H "Content-Type: multipart/form-data" -X DELETE ==== 返回参数 ==== ^名称 ^类型 ^注释 ^ |optionId |int |选项id | |optionName |string |字段选项名称 | |extendId |int |外部扩展id | ==== 返回值示例 ==== ** 成功示例 **\\ { "optionId":"358771", "optionName":"选项3", "extendId":"003" } ** 失败示例 **\\ 当URL中的columnId不存在时: { "state":"403", "message":"columnId does not exist" } 当URL中输入的optionId或者extendId不存在对应选项时: { "state":"403", "message":"optionId or extendId not exist" } 当optionId或者extendId两个参数都为空或者没传时: { "state":"403", "message":"Fill in at least one of optionId and extendId, but not both" }