webhook消息通知对接技术对接文档

webhook消息体(message)类型及字段说明:

事件回调支持以下事件:

事件名 说明
workorderCreate 创建工单
workorderChange 工单字段变更
workorderComment 工单新回复
imchatOfflineMsg 回复离线客户

对接鉴权文档: webhook消息通知对接鉴权方法

工单相关对象说明:webhook消息通知对接工单相关对象说明

回复离线客户对象说明:webhook消息通知回复离线客户对象说明

1. 创建工单

“message”示例如下:


{
    "messageType":"workorderCreate",
    "orderId":"12",
    "orderName":"售后工单1",
    "processName":"类型1",
    "orderStatus":3,
    "priority":2,
    "channelName":"渠道名称1",
    "tags":"xx",
    "orderDesc":"工单描述1",
    "attachments":[
        {
            "realName":"附件1",
            "extName":".txt",
            "type":2,
            "fileSize":22333,
            "filePath":"http://www.xxx.com",
            "mediumFilePath":"http://www.xxx.com",
            "thumbnailFilePath":"http://www.xxx.com"
        },
        {
             "realName":"附件1",
            "extName":".txt",
            "type":2,
            "fileSize":22333,
            "filePath":"http://www.xxx.com",
            "mediumFilePath":"http://www.xxx.com",
            "thumbnailFilePath":"http://www.xxx.com"
        }
    ],
    "customerId":"23",
    "customerName":"张三",
    "phone":"13223332325",
    "woOperateDtoList":[
        {
            "operateType":0,
            "userId":54,
            "userName":"李四"    
        },
        {
            "operateType":3,
            "groupId":54,
            "groupName":"李四"
        }
    ],
    "orderExtDtoList":[
         {
            "extendsData": "{}",
            "itemCode": "51d84d2da9ca4185b70053363940817d",
            "itemDesc": "扩展字段1",
            "itemValue": "扩展字段12"
        }, {
            "extendsData": "{\"options\":[{\"key\":1,\"value\":\"选项1\"},{\"key\":2,\"value\":\"选项2\"},{\"key\":3,\"value\":\"选项3\"},{\"key\":4,\"value\":\"选项4\"}]}",
            "itemCode": "faultType",
            "itemDesc": "故障类型",
            "itemValue": "3"
        }
    ]
}

2. 工单字段变更

说明:如果变更之前的值或者变更之后的值为空,这用字符串"-"来占位。

“message”的数据结构如下:

{
  "messageType":"workorderChange",
  "orderId": 工单id,
  "changes": {
    "属性名1": [原值,变更后的值],
    "extendsData":"xx",//如果是下拉项或者单选、多选等字段,对选项进行说明
    "itemDesc":"字段中文名称", //字段名称
    "itemId":"xx"
  },
 "operateId":操作人ID,
 "operateName":操作人,
 "operateGroupId":操作人组ID,
 "operateGroupName":操作人组,
 "operateTime":操作时间
}

示例如下:

{
  "messageType":"workorderChange",
  "orderId": "12",
  "changes": {
    "extendsData": "{\"options\":[{\"key\":1,\"value\":\"选项1\"},{\"key\":2,\"value\":\"选项2\"},{\"key\":3,\"value\":\"选项3\"},{\"key\":4,\"value\":\"选项4\"}]}",
    "itemDesc": "故障类型",    
    "faultType": ["3", "4"],
    "itemId":"xx"
  },
 "operateId":33,
 "operateName":"张三",
 "operateGroupId":"43",
 "operateGroupName":"张组",
 "operateTime":1601013846000
}

3. 工单新回复

“message”示例如下:

{
  "messageType":"workorderComment",
  "orderId": "12",
  "commentId":"22",
  "commentType":1,
  "attachmentVos":[
    {
    "realName":"附件1.txt",
    "type":2,
    "fileSize":22333,
    "filePath":"http://www.xxx.com",
    "mediumFilePath":"http://www.xxx.com",
    "thumbnailFilePath":"http://www.xxx.com"
    },
    {
     "realName":"附件1.txt",
    "type":2,
    "fileSize":22333,
    "filePath":"http://www.xxx.com",
    "mediumFilePath":"http://www.xxx.com",
    "thumbnailFilePath":"http://www.xxx.com"
    }
   ],
  "content":"快点给我办理",
  "createOpGroupId":"56",
  "createOpGroupName":"李组",
  "createOpId":87,
  "createOpName":"李四",
  "createTime":1601013846000
}

4. 回复离线客户

“message”示例如下:

{
    "messageType": "imchatOfflineMsg",
    "phone": "13357293324",
    "customerId": "7a32607b9617428f833592fabb7d8c42",
    "staffName": "洋洋1",
    "externalId": "dezhu62c88019b6804ff6a13dfb91fb81e103",
    "receiveTimestamp": 1608716942936,
    "sessionId": "CE80A38412477B3D89F8BE72ED49A4B1",
    "content": "测试消息内容",
    "customerName": "测试5",
    "staffId": "19881202",
    "url": "https://dzwebdev.msxf.com?token=E3eMFvRreInu&showChat=true&layout=true",
    "basicCustomerSoleExternals": [{
        "macAddress": "mac11",
        "soleType": "0",
        "createTime": 1608717235000,
        "updateTime": 1608717239000
    }, {
        "soleType": "1",
        "productId": "xx",
        "productSoleCode": "code1",
        "createTime": 1608717283000,
        "updateTime": 1608717286000
    }]
}

results matching ""

    No results matching ""