帮我吧文档:数据接口:工单:工单查询器

获取工单查询器列表

请求参数

请求地址

GET /api/v1/ticketviews.json

调用者权限

所有客服

调用示例

  curl https://www.bangwo8.com/api/v1/ticketviews.json \
  -v -u {account}:{password}

返回参数

名称 类型 注释
id int 查询器id,系统自动分配
url varchar 查询器的资源url
title varchat 查询器名称
active tinyint 查询器是否启用,取值为:0-未启用,1-启用,默认启用。
ticket_count int 查询器包含的工单数量。用GET方式传递了fields=show_tickets_num时会显示该参数
createDT datetime 查询器的创建时间
updateDT datetime 查询器的更新时间

返回示例

{
    "ticketviews": [
        {
            "id": "10",
            "title": "最近解决的工单",
            "active": "0",
            "createDT": "2019-08-16 00:00:08",
            "updateDT": ""
        },
        {
            "id": "13",
            "title": "售前",
            "active": "0",
            "createDT": "2019-12-08 16:11:23",
            "updateDT": "2019-12-08 16:13:40"
        },
        {
            "id": "15",
            "title": "售中",
            "active": "1",
            "createDT": "2019-12-08 16:14:41",
            "updateDT": "2019-12-08 16:12:48"
        },
        {
            "id": "17",
            "title": "售后",
            "active": "1",
            "createDT": "2019-12-08 16:12:48",
            "updateDT": "2019-12-08 16:14:41"
        },
        {
            "id": "2",
            "title": "所有工单",
            "active": "1",
            "createDT": "2019-08-16 00:00:00",
            "updateDT": "2019-10-07 13:35:59"
        },
        {
            "id": "3",
            "title": "您未解决的工单",
            "active": "0",
            "createDT": "2019-08-16 00:00:01",
            "updateDT": ""
        },
        {
            "id": "4",
            "title": "未分配的工单",
            "active": "0",
            "createDT": "2019-08-16 00:00:02",
            "updateDT": ""
        },
        {
            "id": "5",
            "title": "所有未解决的工单",
            "active": "0",
            "createDT": "2019-08-16 00:00:03",
            "updateDT": ""
        },
        {
            "id": "6",
            "title": "最近更新的工单",
            "active": "0",
            "createDT": "2019-08-16 00:00:04",
            "updateDT": ""
        },
        {
            "id": "7",
            "title": "你组中的新工单",
            "active": "0",
            "createDT": "2019-08-16 00:00:05",
            "updateDT": ""
        },
        {
            "id": "8",
            "title": "待回应的工单",
            "active": "0",
            "createDT": "2019-08-16 00:00:06",
            "updateDT": ""
        },
        {
            "id": "9",
            "title": "您组中未解决的工单",
            "active": "0",
            "createDT": "2019-08-16 00:00:07",
            "updateDT": ""
        }
    ],
    "count": "12"
}

获取指定工单查询器信息

请求参数

名称 类型 注释
id int 查询器id

请求地址

GET /api/v1/ticketviews/{id}.json

调用者权限

所有客服

调用示例

curl https://www.bangwo8.com/api/v1/ticketviews/9.json \
  -v -u {account}:{password}

返回参数

名称 类型 注释
id int 查询器id,系统自动分配
title varchat 查询器名称
active tinyint 查询器是否启用,取值为:0-未启用,1-启用,默认启用。
ticket_count int 查询器包含的工单数量。用GET方式传递了fields=show_tickets_num时会显示该参数
createDT datetime 查询器的创建时间
updateDT datetime 查询器的更新时间

返回示例

Status: 200 OK
{
    "ticketview": {
        "id": "9",
        "title": "您组中未解决的工单",
        "active": "0",
        "createDT": "2019-08-16 00:00:07",
        "updateDT": ""
    }

获取指定工单查询器里的工单

请求参数

名称 类型 注释
id int 查询器id

请求地址

GET /api/v1/ticketviews/{id}/tickets.json

调用者权限

所有客服

调用示例

curl https://www.bangwo8.com/api/v1/ticketviews/9/tickets.json \
  -v -u {account}:{password}

返回参数

名称 类型 必填 描述
ticketId int 工单id,系统自动生成
custUserId int 联系人id,说明该工单是为该客户解决问题
subject String 工单标题
descript String 工单描述
servicerUserId int 受理客服id
ccUserIdList string 抄送客服id列表
ticketType int 工单类型:1–问题,2–事务,3–故障,4–任务
priorityLevel int 工单优先级:1–低,2–正常,3–高,4–紧急
tagList int 工单标签列表,以逗号分隔
ticketStatus int 工单状态:1–新建,2–已开启,3–待回应,4–已解决,5–自动关闭,6–手动关闭
createDT datetime 工单创建时间
updateDT datetime 工单更新时间
solveDT datetime 解决时间
waitDT datetime 等待时间
openDT datetime 开启时间
closeDT datetime 关闭时间
servicerGroupId int 受理客服组id
createrId int 工单创建人id
agentId int 关联agents表aId
ticketSource int 工单来源:1–远程,2–聊天,3–呼叫中心,4–留言,5–系统创建,7–API,8–工单模板发布,9–邮件接入
ticketTemplateId int 工单模板id,创建工单需指明当前工单使用哪个工单模板
ccGroupIdList string 抄送客服组id列表
customTemplateId int 客户模板id
createrType String 创建类型
custom_fields array 工单自定义字段

返回示例

{
    "tickets": [
        {
            "ticketId": "5237431",
            "subject": "测试工单",
            "descript": "",
            "ticketSource": "工单工作台",
            "ticketType": "",
            "priorityLevel": "",
            "ticketStatus": "新建",
            "custUserId": "21130282",
            "servicerUserId": "565123",
            "ticketTemplateId": "21130282",
            "tagList": "",
            "createDT": "2019-12-19 14:28:51",
            "updateDT": "2019-12-19 14:37:26",
            "custom_fields": [
                {
                    "key": "field_12",
                    "value": "合同制定"
                },
                {
                    "key": "field_14",
                    "value": "呃呃呃"
                },
                {
                    "key": "field_16",
                    "value": [
                        {
                            "name": "195151szk8umd8or8fmfa5.jpg",
                            "uri": "386279/snNyQASjsh.jpg",
                            "datetime": "2019-12-19 14:28:48"
                        }
                    ]
                },
                {
                    "key": "field_17",
                    "value": "0"
                },
                {
                    "key": "field_18",
                    "value": "0"
                },
                {
                    "key": "field_19",
                    "value": ""
                },
                {
                    "key": "field_20",
                    "value": ""
                },
                {
                    "key": "field_21",
                    "value": "0"
                },
                {
                    "key": "field_22",
                    "value": "sign0"
                },
                {
                    "key": "field_23",
                    "value": "0"
                },
                {
                    "key": "field_24",
                    "value": ""
                },
                {
                    "key": "field_25",
                    "value": "a:4:{s:2:\"SN\";s:16:\"xpt87wm7u4a64lv4\";s:5:\"total\";i:0;s:4:\"data\";a:0:{}s:10:\"isAppraise\";i:0;}"
                },
                {
                    "key": "field_27",
                    "value": "vvv"
                },
                {
                    "key": "field_29",
                    "value": "123.00"
                },
                {
                    "key": "field_30",
                    "value": "测试"
                },
                {
                    "key": "field_31",
                    "value": "测试"
                },
                {
                    "key": "field_32",
                    "value": "2019-12-20"
                },
                {
                    "key": "field_33",
                    "value": "a:3:{s:2:\"SN\";s:16:\"0oi3ov3jne6l7fuu\";s:5:\"total\";i:0;s:4:\"data\";a:0:{}}"
                },
                {
                    "key": "field_34",
                    "value": "低"
                },
                {
                    "key": "field_35",
                    "value": "近(1-15公里)"
                }
            ]
        },
        {
            "ticketId": "5179132",
            "subject": "测试3",
            "descript": "",
            "ticketSource": "工单工作台",
            "ticketType": "",
            "priorityLevel": "",
            "ticketStatus": "新建",
            "custUserId": "21101341",
            "servicerUserId": "0",
            "ticketTemplateId": "21101341",
            "tagList": "",
            "createDT": "2019-12-14 15:09:23",
            "updateDT": "2019-12-14 15:14:48",
            "custom_fields": [
                {
                    "key": "field_12",
                    "value": "项目成交"
                },
                {
                    "key": "field_14",
                    "value": ""
                },
                {
                    "key": "field_16",
                    "value": []
                },
                {
                    "key": "field_17",
                    "value": "0"
                },
                {
                    "key": "field_18",
                    "value": "0"
                },
                {
                    "key": "field_19",
                    "value": ""
                },
                {
                    "key": "field_20",
                    "value": ""
                },
                {
                    "key": "field_21",
                    "value": "0"
                },
                {
                    "key": "field_22",
                    "value": "sign0"
                },
                {
                    "key": "field_23",
                    "value": "0"
                },
                {
                    "key": "field_24",
                    "value": ""
                },
                {
                    "key": "field_25",
                    "value": "a:4:{s:2:\"SN\";s:16:\"edlzdckt6cnb7xe3\";s:5:\"total\";i:0;s:4:\"data\";a:0:{}s:10:\"isAppraise\";i:0;}"
                },
                {
                    "key": "field_27",
                    "value": ""
                },
                {
                    "key": "field_29",
                    "value": "4.00"
                },
                {
                    "key": "field_30",
                    "value": "法鑫四期工程"
                },
                {
                    "key": "field_31",
                    "value": "C"
                },
                {
                    "key": "field_32",
                    "value": "2019-12-14"
                },
                {
                    "key": "field_33",
                    "value": "a:3:{s:2:\"SN\";s:16:\"qoknk59fsc5ragpt\";s:5:\"total\";i:0;s:4:\"data\";a:0:{}}"
                },
                {
                    "key": "field_34",
                    "value": ""
                },
                {
                    "key": "field_35",
                    "value": ""
                }
            ]
        },
        {
            "ticketId": "5178823",
            "subject": "测试2",
            "descript": "",
            "ticketSource": "工单工作台",
            "ticketType": "",
            "priorityLevel": "",
            "ticketStatus": "新建",
            "custUserId": "21101341",
            "servicerUserId": "565123",
            "ticketTemplateId": "21101341",
            "tagList": "",
            "createDT": "2019-12-14 15:00:20",
            "updateDT": "2019-12-14 15:00:20",
            "custom_fields": [
                {
                    "key": "field_12",
                    "value": "项目新建"
                },
                {
                    "key": "field_14",
                    "value": ""
                },
                {
                    "key": "field_16",
                    "value": [
                        {
                            "name": "合同图标.png",
                            "uri": "386279/wEa4ffDp4p.png",
                            "datetime": "2019-12-14 15:27:31"
                        }
                    ]
                },
                {
                    "key": "field_17",
                    "value": "0"
                },
                {
                    "key": "field_18",
                    "value": "0"
                },
                {
                    "key": "field_19",
                    "value": ""
                },
                {
                    "key": "field_20",
                    "value": ""
                },
                {
                    "key": "field_21",
                    "value": "0"
                },
                {
                    "key": "field_22",
                    "value": "sign0"
                },
                {
                    "key": "field_23",
                    "value": "0"
                },
                {
                    "key": "field_24",
                    "value": ""
                },
                {
                    "key": "field_25",
                    "value": "a:4:{s:2:\"SN\";s:16:\"o713y7288c2ve0cf\";s:5:\"total\";i:0;s:4:\"data\";a:0:{}s:10:\"isAppraise\";i:0;}"
                },
                {
                    "key": "field_27",
                    "value": ""
                },
                {
                    "key": "field_29",
                    "value": "5.00"
                },
                {
                    "key": "field_30",
                    "value": "法鑫三期工程"
                },
                {
                    "key": "field_31",
                    "value": "B"
                },
                {
                    "key": "field_32",
                    "value": "2019-12-14"
                },
                {
                    "key": "field_33",
                    "value": "a:3:{s:2:\"SN\";s:16:\"d0xoi11n34zpncn7\";s:5:\"total\";i:0;s:4:\"data\";a:0:{}}"
                },
                {
                    "key": "field_34",
                    "value": ""
                },
                {
                    "key": "field_35",
                    "value": ""
                }
            ]
        },
        {
            "ticketId": "5172289",
            "subject": "测试1",
            "descript": "",
            "ticketSource": "工单工作台",
            "ticketType": "",
            "priorityLevel": "",
            "ticketStatus": "新建",
            "custUserId": "21101341",
            "servicerUserId": "565123",
            "ticketTemplateId": "21101341",
            "tagList": "",
            "createDT": "2019-12-14 14:42:36",
            "updateDT": "2019-12-14 14:43:11",
            "custom_fields": [
                {
                    "key": "field_12",
                    "value": "项目搁置"
                },
                {
                    "key": "field_14",
                    "value": ""
                },
                {
                    "key": "field_16",
                    "value": []
                },
                {
                    "key": "field_17",
                    "value": "0"
                },
                {
                    "key": "field_18",
                    "value": "0"
                },
                {
                    "key": "field_19",
                    "value": ""
                },
                {
                    "key": "field_20",
                    "value": ""
                },
                {
                    "key": "field_21",
                    "value": "0"
                },
                {
                    "key": "field_22",
                    "value": "sign0"
                },
                {
                    "key": "field_23",
                    "value": "0"
                },
                {
                    "key": "field_24",
                    "value": ""
                },
                {
                    "key": "field_25",
                    "value": "a:4:{s:2:\"SN\";s:16:\"jvbbh4f61z5pvsa7\";s:5:\"total\";i:0;s:4:\"data\";a:0:{}s:10:\"isAppraise\";i:0;}"
                },
                {
                    "key": "field_27",
                    "value": ""
                },
                {
                    "key": "field_29",
                    "value": "2.00"
                },
                {
                    "key": "field_30",
                    "value": "法鑫二期工程"
                },
                {
                    "key": "field_31",
                    "value": "A"
                },
                {
                    "key": "field_32",
                    "value": "2019-12-14"
                }
            ]
        },
        {
            "ticketId": "5136568",
            "subject": "测试5",
            "descript": "",
            "ticketSource": "工单工作台",
            "ticketType": "",
            "priorityLevel": "",
            "ticketStatus": "新建",
            "custUserId": "23898976",
            "servicerUserId": "565123",
            "ticketTemplateId": "23898976",
            "tagList": "",
            "createDT": "2019-12-12 17:01:20",
            "updateDT": "2019-12-12 17:02:47",
            "custom_fields": [
                {
                    "key": "field_12",
                    "value": "合同制定"
                },
                {
                    "key": "field_14",
                    "value": "cs"
                },
                {
                    "key": "field_15",
                    "value": ""
                },
                {
                    "key": "field_16",
                    "value": []
                },
                {
                    "key": "field_17",
                    "value": "0"
                },
                {
                    "key": "field_18",
                    "value": "0"
                },
                {
                    "key": "field_19",
                    "value": ""
                },
                {
                    "key": "field_20",
                    "value": ""
                },
                {
                    "key": "field_21",
                    "value": "0"
                },
                {
                    "key": "field_22",
                    "value": "sign0"
                },
                {
                    "key": "field_23",
                    "value": "0"
                },
                {
                    "key": "field_24",
                    "value": ""
                },
                {
                    "key": "field_25",
                    "value": "a:4:{s:2:\"SN\";s:16:\"51vtwil9ycq8c9oi\";s:5:\"total\";i:0;s:4:\"data\";a:0:{}s:10:\"isAppraise\";i:0;}"
                },
                {
                    "key": "field_27",
                    "value": "c's"
                },
                {
                    "key": "field_28",
                    "value": "1763020"
                },
                {
                    "key": "field_29",
                    "value": "0.00"
                }
            ]
        },
        {
            "ticketId": "5135629",
            "subject": "碧桂园一期项目",
            "descript": "",
            "ticketSource": "工单工作台",
            "ticketType": "",
            "priorityLevel": "",
            "ticketStatus": "新建",
            "custUserId": "21101341",
            "servicerUserId": "565123",
            "ticketTemplateId": "21101341",
            "tagList": "",
            "createDT": "2019-12-12 16:15:53",
            "updateDT": "2019-12-12 16:16:15",
            "custom_fields": [
                {
                    "key": "field_12",
                    "value": "报价谈判"
                },
                {
                    "key": "field_14",
                    "value": ""
                },
                {
                    "key": "field_15",
                    "value": ""
                },
                {
                    "key": "field_16",
                    "value": []
                },
                {
                    "key": "field_17",
                    "value": "0"
                },
                {
                    "key": "field_18",
                    "value": "0"
                },
                {
                    "key": "field_19",
                    "value": ""
                },
                {
                    "key": "field_20",
                    "value": ""
                },
                {
                    "key": "field_21",
                    "value": "0"
                },
                {
                    "key": "field_22",
                    "value": "sign0"
                },
                {
                    "key": "field_23",
                    "value": "0"
                },
                {
                    "key": "field_24",
                    "value": ""
                },
                {
                    "key": "field_25",
                    "value": "a:4:{s:2:\"SN\";s:16:\"ercmq5rh4p7bxjgm\";s:5:\"total\";i:0;s:4:\"data\";a:0:{}s:10:\"isAppraise\";i:0;}"
                },
                {
                    "key": "field_26",
                    "value": "890"
                },
                {
                    "key": "field_27",
                    "value": "先安抚"
                },
                {
                    "key": "field_28",
                    "value": "1763020"
                }
            ]
        },
        {
            "ticketId": "5109538",
            "subject": "碧桂园",
            "descript": "",
            "ticketSource": "工单工作台",
            "ticketType": "",
            "priorityLevel": "",
            "ticketStatus": "新建",
            "custUserId": "21101341",
            "servicerUserId": "565123",
            "ticketTemplateId": "21101341",
            "tagList": "",
            "createDT": "2019-12-10 16:09:39",
            "updateDT": "2019-12-10 16:09:39",
            "custom_fields": [
                {
                    "key": "field_12",
                    "value": "报价谈判"
                },
                {
                    "key": "field_14",
                    "value": "23"
                },
                {
                    "key": "field_15",
                    "value": ""
                },
                {
                    "key": "field_16",
                    "value": []
                },
                {
                    "key": "field_17",
                    "value": "0"
                },
                {
                    "key": "field_18",
                    "value": "0"
                },
                {
                    "key": "field_19",
                    "value": ""
                },
                {
                    "key": "field_20",
                    "value": ""
                },
                {
                    "key": "field_21",
                    "value": "0"
                },
                {
                    "key": "field_22",
                    "value": "sign0"
                },
                {
                    "key": "field_23",
                    "value": "0"
                },
                {
                    "key": "field_24",
                    "value": ""
                },
                {
                    "key": "field_25",
                    "value": "a:4:{s:2:\"SN\";s:16:\"8vsvyuj1w4mrio9a\";s:5:\"total\";i:0;s:4:\"data\";a:0:{}s:10:\"isAppraise\";i:0;}"
                },
                {
                    "key": "field_26",
                    "value": "12"
                },
                {
                    "key": "field_27",
                    "value": "32"
                }
            ]
        }
    ],
    "count": "8",
    "previous_page": "",
    "next_page": ""

获取指定工单查询器的工单个数

请求参数

名称 类型 注释
id int 查询器id

请求地址

GET /api/v1/ticketviews/{id}/count.json

调用者权限

所有客服

调用示例

curl https://www.bangwo8.com/api/v1/ticketviews/15/count.json \
  -v -u {account}:{password}

返回参数

名称 类型 注释
ticketview_id int 查询器id
count int 该查询器下的工单总数

返回示例

{
    "ticketview_count": [
        {
            "ticketview_id": "15",
            "count": "7"
        }
    ]
}

获取多个工单查询器的工单个数

请求参数

名称 类型 注释
id int 查询器id

请求地址

GET /api/v1/ticketviews/show_many.json?ids={ids}

调用者权限

所有客服

调用示例

curl https://www.bangwo8.com/api/v1/ticketviews/show_many.json?ids={15,2} -v -u {account}:{password}

返回参数

名称 类型 注释
ticketview_id int 查询器id
count int 该查询器下的工单总数

返回示例

{
    "ticketview_counts": [
        {
            "ticketview_id": "15",
            "count": "7"
        },
        {
            "ticketview_id": "2",
            "count": "23"
        }
    ]
}

页面工具