1.1 接口说明

第三方系统提供一个公网可以访问的地址,优音云客服系统会把工单数据以json的形式推送到提供的接口中,推送是在工单流转中触发,流转到工单的某一步骤时,如果当前步骤配置了工单流出接口,才会推送当前步骤数据。数据推送请求为post、格式为一个json对象,其中每一个json对象对应一个步骤动作信息。

注意:云客服系统会在工单流出失败后的第 10秒、60秒、180秒、300秒重推失败数据。5次推送均失败则记录推送信息,第三方系统可以通过云客服系统提供的推送记录管理页面重推失败数据,且支持批量推送。因此建议开发者考虑接口兼容处理,批量推送时数据会以JSONArray的形式推送。

1.2 配置工单流出接口

注意:配置工单流出地址前需要先保存工单模板,否则会无法选择步骤动作。

1.2.1 进入工单设置页面,选择需要配置的工单流程,点击【编辑】按钮进入配置页面

1.2.2 选择需要流出的工单节点,输入流出对接的url

1.3 请求方式

POST

1.4 请求参数

说明
该接口请求到达后只需解析rows元素中每个Object对象val值即可(附件请上送name及val)。

非必填参数,调用接口时请传递参数名,参数值可为空

序号 名称 类型 是否必填 说明
1 currentNodeForm Object对象 当前节点信息数据
1.1 form Object对象 新建工单的表单元素
1.1.1 rows Object数组 rows元素含有多个Object表单元素对象(参考本章节使用样例):其中Object元素对象属性如下:1、title:字段名称;
2、kind:字段类型;点击查看详情
0-自定义单行文本;
1-自定义多行文本;
2-自定义单选;
3-自定义多选;
4-自定义下拉框;
5-自定义日期;
6-自定义日期时间;
7-自定义数字;
8-附件;
3、id:元素ID;
4、val:字符型字段值;(若为附件则是Object类型数组)点击查看详情
Object类型属性如下:
4.1name:页面显示名称(须带文件后缀,如xxx.xlsxxx.jpg等,并与url中文件名后缀保持一致);
4.2uid:数据标识;
4.3url: 附件文件目录;
1.2 approve 网关分支参数标识 当前节点含有网关分支时approve为具体的网关分支标识内容值;其他情况approve为null,不能传值
1.3 priority Object对象 流转工单的优先级(0-紧急 1-重要 2-普通),说明:1、新建工单后的流转工单有priority参数;2、后续工单流出后的流入调用,该参数可为null
1.4 workflow_id String 工作流模板ID
1.5 transaction_id String 工单编号
1.6 process_instance_id String 流程实例id
1.7 task_id String 工作流任务ID(为下一步流转工单的任务节点ID)
1.8 customer_id String 当前工单所属客户id(currentNodeForm节点流出参数)
1.9 target_agent_num String 下步处理座席工号
1.10 agent_num String 当前处理座席工号
2 nextNodeForm Object对象 下一节点信息数据(若无下个节点信息,则该节点对象为null)
2.1 form Object对象 新建工单的表单元素
2.1.1 rows Object数组 rows元素含有多个Object表单元素对象(参考本章节使用样例):其中Object元素对象属性如下:1、title:字段名称;
2、kind:字段类型;点击查看详情
0-自定义单行文本;
1-自定义多行文本;
2-自定义单选;
3-自定义多选;
4-自定义下拉框;
5-自定义日期;
6-自定义日期时间;
7-自定义数字;
8-附件;
3、id:元素ID;
4、val:字符型字段值;(若为附件则是Object类型数组)点击查看详情
Object类型属性如下:
4.1name:页面显示名称(须带文件后缀,如xxx.xlsxxx.jpg等,并与url中文件名后缀保持一致);
4.2uid:数据标识;
4.3url: 附件文件目录;
2.2 branch Object数组 只有用户节点后含有网关分支选项时,该元素内容不为null,且包含多个Object对象;
其中:Object对象 id属性 为顺序流id;Object对象 approve属性 为分支内容标识(下一步流入需要传入该参数,且值必须匹配);
举例如下:
“branch”:[
{
“id”: “Flow_10lx65t”,
approve“: “同意
},
{
“id”: “Flow_1li4h6g”,
approve“: “打回销售
}
]
2.3 priority Object对象 流转工单的优先级(0-紧急 1-重要 2-普通),说明:1、新建工单后的流转工单有priority参数;2、后续工单流出后的流入调用,该参数可为null
2.4 workflow_id String 工作流模板ID
2.5 process_instance_id String 流程实例id
2.6 task_id String 工作流任务ID(为下一步流转工单的任务节点ID)
2.7 target_agent_num String 下步处理座席工号
2.8 agent_num String 当前处理座席工号

1.5 请求样例

调用:

url:https://ykftest.uincall.com/callcenter/work/workflow/receive?tenant_id=acf528a2-d0e2-4a7b-8513-74cb399xxxxx&access_token=670253572927b24acffc41078ddxxxxx

POST数据:
场景1、工单流出不含网关分支:
{
    "currentNodeForm": {
        "form": {
            "rows": [{
                "title": "业务类型",
                "val": ["政府采购业务"],
                "kind": 4,
                "id": "6045f8c7-af9c-46cb-bd1e-634e155xxxx"
            }, {
                "title": "问题来源",
                "val": ["内部转交"],
                "kind": 4,
                "id": "4359e602-0bde-4fdd-92e1-1d0db0fxxxx"
            }, {
                "title": "优先级",
                "val": "中",
                "kind": 2,
                "id": "1a8d2db8-57e2-4cf9-94c0-a146fb5xxxx"
            }, {
                "title": "问题类型",
                "val": ["软件需求类问题"],
                "kind": 4,
                "id": "60826917-7512-48b9-8553-acc1ac5xxxx"
            }, {
                "title": "软件类型",
                "val": ["部门预算系统"],
                "kind": 4,
                "id": "9f7588c4-d5bf-48ff-ad5b-6ecb320xxxx"
            }, {
                "title": "所属地区",
                "val": ["内蒙古自治区"],
                "kind": 4,
                "id": "b96f6873-4f58-4260-8df5-5fccc0axxxx"
            }, {
                "title": "单位类型",
                "val": ["财政部门"],
                "kind": 4,
                "id": "263eaebc-7c9d-4dc6-8f55-51818acxxxx"
            }, {
                "title": "单位名称",
                "val": "测试",
                "kind": 0,
                "id": "9c7795dc-6d1f-4717-8c36-310b2eaxxxx"
            }, {
                "title": "联系人",
                "val": "测试",
                "kind": 0,
                "id": "f6033cf2-b3c0-49cb-912f-a743aeaxxxx"
            }, {
                "title": "电话/手机号",
                "val": "11",
                "kind": 0,
                "id": "10b0bc78-e0fa-49e9-b94b-b37c42exxxx"
            }, {
                "title": "工单详情",
                "val": "11111111",
                "kind": 1,
                "id": "c6de3e95-4e0b-4a6f-a35d-c5b4394xxxx"
            }, {
                "title": "工单详情附件",
                "val": "",
                "kind": 8,
                "id": "00499b43-eea3-4ce2-b1b2-ac3728bxxxx"
            }]
        },
        "approve":null,
        "priority": 2,
        "workflow_id": "a7636c85379ac03295e6dd3e2e6xxxx",
        "transaction_id": "1640583790372",
        "process_instance_id": "afc4460a-4e87-11ec-ba15-02427e6xxxx",
        "task_id": "afc44610-4e87-11ec-ba15-02427e6xxxx",
        "customer_id" : "xxxxxx123456",
        "target_agent_num": "",
        "agent_num": "8050",
    },
    "nextNodeForm": {
        "form": {
            "rows": [{
                "title": "业务类型",
                "val": ["政府采购业务"],
                "kind": 4,
                "id": "6045f8c7-af9c-46cb-bd1e-634e155xxxx"
            }, {
                "title": "问题来源",
                "val": ["内部转交"],
                "kind": 4,
                "id": "4359e602-0bde-4fdd-92e1-1d0db0fxxxx"
                }]
        },
        "approve":null,
        "priority": null,
        "workflow_id": "a7636c85379ac03295e6dd3e2e6xxxx",
        "process_instance_id": "afc4460a-4e87-11ec-ba15-02427e6xxxx",
        "task_id": "",
        "target_agent_num": "",
        "agent_num": ""
    }
}

场景2、工单流出下个节点含有网关分支(工单模板XXX用户节点后配置有网关分支):
{
    "currentNodeForm": {
        "form": {
            "rows": [{
                "title": "业务类型",
                "val": ["政府采购业务"],
                "kind": 4,
                "id": "6045f8c7-af9c-46cb-bd1e-634e155xxxx"
            }, {
                "title": "问题来源",
                "val": ["内部转交"],
                "kind": 4,
                "id": "4359e602-0bde-4fdd-92e1-1d0db0fxxxx"
            }, {
                "title": "优先级",
                "val": "中",
                "kind": 2,
                "id": "1a8d2db8-57e2-4cf9-94c0-a146fb5xxxx"
            }, {
                "title": "问题类型",
                "val": ["软件需求类问题"],
                "kind": 4,
                "id": "60826917-7512-48b9-8553-acc1ac5xxxx"
            }, {
                "title": "软件类型",
                "val": ["部门预算系统"],
                "kind": 4,
                "id": "9f7588c4-d5bf-48ff-ad5b-6ecb320xxxx"
            }, {
                "title": "所属地区",
                "val": ["内蒙古自治区"],
                "kind": 4,
                "id": "b96f6873-4f58-4260-8df5-5fccc0axxxx"
            }, {
                "title": "单位类型",
                "val": ["财政部门"],
                "kind": 4,
                "id": "263eaebc-7c9d-4dc6-8f55-51818acxxxx"
            }, {
                "title": "单位名称",
                "val": "测试",
                "kind": 0,
                "id": "9c7795dc-6d1f-4717-8c36-310b2eaxxxx"
            }, {
                "title": "联系人",
                "val": "测试",
                "kind": 0,
                "id": "f6033cf2-b3c0-49cb-912f-a743aeaxxxx"
            }, {
                "title": "电话/手机号",
                "val": "11",
                "kind": 0,
                "id": "10b0bc78-e0fa-49e9-b94b-b37c42exxxx"
            }, {
                "title": "工单详情",
                "val": "11111111",
                "kind": 1,
                "id": "c6de3e95-4e0b-4a6f-a35d-c5b4394xxxx"
            }, {
                "title": "工单详情附件",
                "val": "",
                "kind": 8,
                "id": "00499b43-eea3-4ce2-b1b2-ac3728bxxxx"
            }]
        },
        "priority": 2,
        "workflow_id": "a7636c85379ac03295e6dd3e2e6xxxx",
        "transaction_id": "1640583790372",
        "process_instance_id": "afc4460a-4e87-11ec-ba15-02427e6xxxx",
        "task_id": "afc44610-4e87-11ec-ba15-02427e6xxxx",
        "customer_id" : "xxxxxx123456",
        "target_agent_num": "",
        "agent_num": "8050"
    },
    "nextNodeForm": {
        "form": {
            "rows": [{
                "title": "业务类型",
                "val": ["政府采购业务"],
                "kind": 4,
                "id": "6045f8c7-af9c-46cb-bd1e-634e155xxxx"
            }, {
                "title": "问题来源",
                "val": ["内部转交"],
                "kind": 4,
                "id": "4359e602-0bde-4fdd-92e1-1d0db0fxxxx"
                }]
        },
        "branch": [
            {
                "id": "Flow_10lx65t",
                "approve": "同意"
            },
            {
                "id": "Flow_1li4h6g",
                "approve": "打回销售"
            }],
        "priority": null,
        "workflow_id": "a7636c85379ac03295e6dd3e2e6xxxx",
        "process_instance_id": "afc4460a-4e87-11ec-ba15-02427e6xxxx",
        "task_id": "",
        "customer_id" : "xxxxxx123456",
        "target_agent_num": "",
        "agent_num": "1009"
    }
}

场景3、工单流出当前节点含有网关分支操作:
{
    "currentNodeForm": {
        "form": {
            "rows": [{
                "title": "业务类型",
                "val": ["政府采购业务"],
                "kind": 4,
                "id": "6045f8c7-af9c-46cb-bd1e-634e155xxxx"
            }, {
                "title": "问题来源",
                "val": ["内部转交"],
                "kind": 4,
                "id": "4359e602-0bde-4fdd-92e1-1d0db0fxxxx"
                }]
        },
        "approve":"打回销售",
        "priority": null,
        "workflow_id": "a7636c85379ac03295e6dd3e2e6xxxx",
        "transaction_id": "1640583790372",
        "process_instance_id": "afc4460a-4e87-11ec-ba15-02427e6xxxx",
        "task_id": "",
        "customer_id" : "xxxxxx123456",
        "target_agent_num": "1008",
        "agent_num": "1009"
    },
    "nextNodeForm": {
        "form": {
            "rows": [{
                "title": "业务类型",
                "val": ["政府采购业务"],
                "kind": 4,
                "id": "6045f8c7-af9c-46cb-bd1e-634e155xxxx"
            }, {
                "title": "问题来源",
                "val": ["内部转交"],
                "kind": 4,
                "id": "4359e602-0bde-4fdd-92e1-1d0db0fxxxx"
                }]
        },
        "branch":null,
        "priority": null,
        "workflow_id": "a7636c85379ac03295e6dd3e2e6xxxx",
        "process_instance_id": "afc4460a-4e87-11ec-ba15-02427e6xxxx",
        "task_id": "",
        "customer_id" : "xxxxxx123456",
        "target_agent_num": "",
        "agent_num": ""
    }
}

场景4、工单流出为最后一步,没有nextNodeForm值场景:
{
    "currentNodeForm": {
        "form": {
            "rows": [{
                "title": "业务类型",
                "val": ["政府采购业务"],
                "kind": 4,
                "id": "6045f8c7-af9c-46cb-bd1e-634e155xxxx"
            }, {
                "title": "问题来源",
                "val": ["内部转交"],
                "kind": 4,
                "id": "4359e602-0bde-4fdd-92e1-1d0db0fxxxx"
            }, {
                "title": "优先级",
                "val": "中",
                "kind": 2,
                "id": "1a8d2db8-57e2-4cf9-94c0-a146fb5xxxx"
            }, {
                "title": "问题类型",
                "val": ["软件需求类问题"],
                "kind": 4,
                "id": "60826917-7512-48b9-8553-acc1ac5xxxx"
            }, {
                "title": "软件类型",
                "val": ["部门预算系统"],
                "kind": 4,
                "id": "9f7588c4-d5bf-48ff-ad5b-6ecb320xxxx"
            }, {
                "title": "所属地区",
                "val": ["内蒙古自治区"],
                "kind": 4,
                "id": "b96f6873-4f58-4260-8df5-5fccc0axxxx"
            }, {
                "title": "单位类型",
                "val": ["财政部门"],
                "kind": 4,
                "id": "263eaebc-7c9d-4dc6-8f55-51818acxxxx"
            }, {
                "title": "单位名称",
                "val": "测试",
                "kind": 0,
                "id": "9c7795dc-6d1f-4717-8c36-310b2eaxxxx"
            }, {
                "title": "联系人",
                "val": "测试",
                "kind": 0,
                "id": "f6033cf2-b3c0-49cb-912f-a743aeaxxxx"
            }, {
                "title": "电话/手机号",
                "val": "11",
                "kind": 0,
                "id": "10b0bc78-e0fa-49e9-b94b-b37c42exxxx"
            }, {
                "title": "工单详情",
                "val": "11111111",
                "kind": 1,
                "id": "c6de3e95-4e0b-4a6f-a35d-c5b4394xxxx"
            }, {
                "title": "工单详情附件",
                "val": "",
                "kind": 8,
                "id": "00499b43-eea3-4ce2-b1b2-ac3728bxxxx"
            }]
        },
        "approve":null,
        "priority": 2,
        "workflow_id": "a7636c85379ac03295e6dd3e2e6xxxx",
        "transaction_id": "1640583790372",
        "process_instance_id": "afc4460a-4e87-11ec-ba15-02427e6xxxx",
        "task_id": "afc44610-4e87-11ec-ba15-02427e6xxxx",
        "customer_id" : "xxxxxx123456",
        "target_agent_num": "",
        "agent_num": "8050"
    },
    "nextNodeForm": null
}

1.6 回应参数

注意:同步成功后第三方系统接口返回格式要求:{“errcode”:200,”errmsg”:”同步成功”}。其他未知格式或错误代码均认为同步失败。请参考错误码

1.7 接收工单流出内容接口样例

@PostMapping(value = "receive")
public void receive(HttpServletRequest request) {
    log.info("模拟接收工单流出数据流-> /xxx/xxx/receive start>>>");
    InputStream is = null;
    StringBuilder sb = new StringBuilder();
    try {
        is = request.getInputStream();
        byte[] b = new byte[4096];
        for (int n; (n = is.read(b)) != -1; ) {
            sb.append(new String(b, 0, n));
        }
    } catch (IOException e) {
        e.printStackTrace();
    } finally {
        if (null != is) {
            try {
                is.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
    log.info("/xxx/xxx/receive, json: {}", sb.toString());
    return ResultUtil.success("同步成功");
}
文档更新时间: 2024-09-24 14:35   作者:admin