差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录 前一修订版
后一修订版 两侧同时换到之后的修订记录
cs:400systemintegration:20webhook [2019/11/21 08:12]
candywang [访客来源事件]
cs:400systemintegration:20webhook [2020/02/18 07:14]
candywang
行 54: 行 54:
   * [[#​访客完成满意度评价|访客完成满意度评价(ServiceSessionEnquiryEvent)]]   * [[#​访客完成满意度评价|访客完成满意度评价(ServiceSessionEnquiryEvent)]]
   * [[#​访客来源|访客来源(ServiceSessionAttributesCreateEvent,​ServiceSessionAttributesChangeEvent)]]   * [[#​访客来源|访客来源(ServiceSessionAttributesCreateEvent,​ServiceSessionAttributesChangeEvent)]]
-==== 会话结束 ==== 
- 
-事件名称:ServiceSessionClosedEvent 
- 
-触发条件:坐席/管理员手动结束会话、会话超时自动结束 
- 
-消息内容示例: 
- 
-<code json> 
-{ 
-    "​eventId":​ "​ca81ade0-6dc5-11e6-9c13-dfa1eed70626", ​   //事件ID 
-    "​timestamp":​ 1472460726612, ​                          //​时间戳 
-    "​event":​ "​ServiceSessionClosedEvent", ​                //​事件类型 
-    "​payload":​ { 
-        "​serviceSession":​ { 
-            "​id":​ "​4fe1b496-90ac-4412-8f40-0f6a13cbfc4b",​ //会话ID 
-            "​state":​ "​Terminal", ​                         //​会话状态 
-            "​origin_type":​ "​webim", ​                      //​渠道类型,值为app(App渠道)、webim(网页)、weixin(微信)、weibo(微博)、phone(呼叫中心)、rest(rest API渠道) 
-            "​timestamp":​ { 
-                "​create":​ 1472139263000, ​                 //​会话创建时间 
-                "​start":​ 1472139269000, ​                  //​会话接起时间 
-                "​stop":​ 1472460695000 ​                    //​会话结束时间 
-            },  
-            "​channel":​ {                                  //关联 
-                "​id":​ 3104,                               //​关联ID 
-                "​name":​ "​快速创建的关联", ​                  //​关联名称 
-                "​type":​ "​easemob" ​                        //​关联类型,easemob代表环信IM 
-            },  
-            "​visitor":​ { 
-                "​id":​ "​a6527ed1-e3f4-4537-aeef-ae35199e3765",​ //​系统内部访客ID 
-                "​name":​ "​webim-visitor-RY7KQK99XVGXBE3JKCHM",​ //​访客ID,显示在资料的ID字段 
-                "​channel_user":​ {                             //​访客所属关联信息(此处是APP渠道示例,其他渠道示例见下文) 
-                    "​app_name":​ "​sandbox", ​ 
-                    "​channel_type":​ "​easemob", ​ 
-                    "​im_id":​ "​webim-visitor-RY7KQK99XVGXBE3JKCHM",​ //​环信IM的环信ID 
-                    "​org_name":​ "​sipsoft"​ 
-                } 
-            },  
-            "​agent":​ { 
-                "​id":​ "​b58b99c1-cd3b-44d9-9821-20fb6a0f2f49",​ //坐席ID 
-                "​name":​ "​Admin", ​                             //​坐席昵称 
-                "​type":​ "​Agent" ​                              //​坐席类型,机器人、普通坐席或管理员 
-            },  
-            "​agent_queue":​ { 
-                "​id":​ 2112,                                  //​技能组ID 
-                "​name":​ "​集体组" ​                             //​技能组名称 
-            },  
-            "​summary_category":​ [                            //​会话标签,数组,包含所有的标签ID 
-                { 
-                    "​id":​ 23976, ​ 
-                    "​name":​ "​测试4-4"​ 
-                } 
-            ],  
-            "​comment":​ "", ​                                  //​会话备注 
-            "​enquiry":​{ ​                               
-                "​score":​3, ​                                  //​满意度评分 
-                "​comment":"" ​                                //​满意度评价详情 
-            } 
-        } 
-    } 
-} 
-</​code>​ 
- 
-访客所属关联信息结构示例: 
- 
-<code json> 
-# IM用户 
-"​channel_user":​ { 
-    "​app_name":​ "​sandbox",​ 
-    "​channel_type":​ "​callcenter",​ 
-    "​im_id":​ "​webim-visitor-RY7KQK99XVGXBE3JKCHM",​ 
-    "​org_name":​ "​sipsoft"​ 
-} 
- 
-# CallCenter用户 
-  "​channel_user":​ { 
-    "​channel_type":​ "​callcenter",​ 
-    "​name":​ "​访客的名称",​ 
-    "​phone":​ "​13112345678"​ 
-  } 
- 
-# Rest 渠道用户 
-  "​channel_user":​ { 
-  } 
- 
-# weibo 渠道用户 
-  "​channel_user":​ { 
-    "​channel_type":​ "​weibo",​ 
-    "​name":​ "​访客的微博名",​ 
-    "​weibo_id":​ "​访客的微博ID"​ 
-  } 
- 
-# 微信渠道用户 
-  "​channel_user":​ { 
-    "​channel_type":​ "​wechat_oauth2",​ 
-    "​name":​ "​访客的微信名",​ 
-    "​weixin_id":​ "​访客的微信ID"​ 
-  } 
-</​code>​ 
  
  
行 272: 行 173:
         }          } 
     }      } 
 +}
 +</​code>​
 +==== 坐席信息变更 ====
 +
 +事件名称:AgentUserChangeEvent
 +
 +触发条件:坐席/管理员修改个人信息,管理员修改其他坐席的信息
 +
 +消息内容示例:
 +
 +<code json>
 +{
 +    "​eventId":​ "​d0a31dd0-07b7-11e7-b1a7-eb03c0f01476", ​   //事件ID
 +    "​timestamp":​ 1489387172031, ​                          //​时间戳
 +    "​event":​ "​AgentUserChangeEvent", ​                     //​事件名称
 +    "​payload":​ {
 +        "​agent":​ {                                        //​变更后的坐席信息  ​
 +            "​id":​ "​eb524dc0-be91-47ac-b6e6-10d013d7d72b",​ //坐席ID
 +            "​username":​ "​713test4@qq.com", ​               //​坐席登录邮箱地址
 +            "​nickname":​ "​Leoli", ​                         //​坐席昵称
 +            "​name":​ "​leoli", ​                             //​坐席真实姓名
 +            "​roles":​ [                                    //​坐席角色,值为["​agent"​](普通坐席)、["​agent","​admin"​](管理员)
 +                "​admin",​
 +                "​agent"​
 +            ],
 +            "​phone":​ "​18612389889", ​                      //​坐席电话号码
 +            "​business_id":​ "​1001", ​                       //​坐席工号
 +            "​created_at":​ 1453900968000, ​                 //​坐席创建时间
 +            "​updated_at":​ 1489128601000 ​                  //​坐席信息更新时间
 +        },
 +        "​old_agent":​ {                                    //​变更前的坐席信息
 +            "​id":​ "​eb524dc0-be91-47ac-b6e6-10d013d7d72b",​ //坐席ID
 +            "​username":​ "​713test4@qq.com", ​               //​坐席登录邮箱地址
 +            "​nickname":​ "​Leoli", ​                         //​坐席昵称
 +            "​name":​ "", ​                                  //​坐席真实姓名
 +            "​roles":​ [                                    //​坐席角色,值为["​agent"​](普通坐席)、["​agent","​admin"​](管理员)
 +                "​admin",​
 +                "​agent"​
 +            ],
 +            "​phone":​ "", ​                                 //​坐席电话号码
 +            "​created_at":​ 1453900968000, ​                 //​坐席创建时间
 +            "​updated_at":​ 1489128601000 ​                  //​坐席信息更新时间
 +        }
 +    }
 } }
 </​code>​ </​code>​
行 435: 行 380:
 } }
 </​code>​ </​code>​
-==== 坐席信息变更 ==== 
  
-事件名称:AgentUserChangeEvent 
- 
-触发条件:坐席/管理员修改个人信息,管理员修改其他坐席的信息 
- 
-消息内容示例: 
- 
-<code json> 
-{ 
-    "​eventId":​ "​d0a31dd0-07b7-11e7-b1a7-eb03c0f01476", ​   //事件ID 
-    "​timestamp":​ 1489387172031, ​                          //​时间戳 
-    "​event":​ "​AgentUserChangeEvent", ​                     //​事件名称 
-    "​payload":​ { 
-        "​agent":​ {                                        //​变更后的坐席信息  ​ 
-            "​id":​ "​eb524dc0-be91-47ac-b6e6-10d013d7d72b",​ //坐席ID 
-            "​username":​ "​713test4@qq.com", ​               //​坐席登录邮箱地址 
-            "​nickname":​ "​Leoli", ​                         //​坐席昵称 
-            "​name":​ "​leoli", ​                             //​坐席真实姓名 
-            "​roles":​ [                                    //​坐席角色,值为["​agent"​](普通坐席)、["​agent","​admin"​](管理员) 
-                "​admin",​ 
-                "​agent"​ 
-            ], 
-            "​phone":​ "​18612389889", ​                      //​坐席电话号码 
-            "​business_id":​ "​1001", ​                       //​坐席工号 
-            "​created_at":​ 1453900968000, ​                 //​坐席创建时间 
-            "​updated_at":​ 1489128601000 ​                  //​坐席信息更新时间 
-        }, 
-        "​old_agent":​ {                                    //​变更前的坐席信息 
-            "​id":​ "​eb524dc0-be91-47ac-b6e6-10d013d7d72b",​ //坐席ID 
-            "​username":​ "​713test4@qq.com", ​               //​坐席登录邮箱地址 
-            "​nickname":​ "​Leoli", ​                         //​坐席昵称 
-            "​name":​ "", ​                                  //​坐席真实姓名 
-            "​roles":​ [                                    //​坐席角色,值为["​agent"​](普通坐席)、["​agent","​admin"​](管理员) 
-                "​admin",​ 
-                "​agent"​ 
-            ], 
-            "​phone":​ "", ​                                 //​坐席电话号码 
-            "​created_at":​ 1453900968000, ​                 //​坐席创建时间 
-            "​updated_at":​ 1489128601000 ​                  //​坐席信息更新时间 
-        } 
-    } 
-} 
-</​code>​ 
 ==== 会话创建 ==== ==== 会话创建 ====
  
行 609: 行 511:
   }   }
 } }
 +</​code>​
 +
 +==== 会话结束 ====
 +
 +事件名称:ServiceSessionClosedEvent
 +
 +触发条件:坐席/管理员手动结束会话、会话超时自动结束
 +
 +消息内容示例:
 +
 +<code json>
 +{
 +    "​eventId":​ "​ca81ade0-6dc5-11e6-9c13-dfa1eed70626", ​   //事件ID
 +    "​timestamp":​ 1472460726612, ​                          //​时间戳
 +    "​event":​ "​ServiceSessionClosedEvent", ​                //​事件类型
 +    "​payload":​ {
 +        "​serviceSession":​ {
 +            "​id":​ "​4fe1b496-90ac-4412-8f40-0f6a13cbfc4b",​ //会话ID
 +            "​state":​ "​Terminal", ​                         //​会话状态
 +            "​origin_type":​ "​webim", ​                      //​渠道类型,值为app(App渠道)、webim(网页)、weixin(微信)、weibo(微博)、phone(呼叫中心)、rest(rest API渠道)
 +            "​timestamp":​ {
 +                "​create":​ 1472139263000, ​                 //​会话创建时间
 +                "​start":​ 1472139269000, ​                  //​会话接起时间
 +                "​stop":​ 1472460695000 ​                    //​会话结束时间
 +            }, 
 +            "​channel":​ {                                  //关联
 +                "​id":​ 3104,                               //​关联ID
 +                "​name":​ "​快速创建的关联", ​                  //​关联名称
 +                "​type":​ "​easemob" ​                        //​关联类型,easemob代表环信IM
 +            }, 
 +            "​visitor":​ {
 +                "​id":​ "​a6527ed1-e3f4-4537-aeef-ae35199e3765",​ //​系统内部访客ID
 +                "​name":​ "​webim-visitor-RY7KQK99XVGXBE3JKCHM",​ //​访客ID,显示在资料的ID字段
 +                "​channel_user":​ {                             //​访客所属关联信息(此处是APP渠道示例,其他渠道示例见下文)
 +                    "​app_name":​ "​sandbox", ​
 +                    "​channel_type":​ "​easemob", ​
 +                    "​im_id":​ "​webim-visitor-RY7KQK99XVGXBE3JKCHM",​ //​环信IM的环信ID
 +                    "​org_name":​ "​sipsoft"​
 +                }
 +            }, 
 +            "​agent":​ {
 +                "​id":​ "​b58b99c1-cd3b-44d9-9821-20fb6a0f2f49",​ //坐席ID
 +                "​name":​ "​Admin", ​                             //​坐席昵称
 +                "​type":​ "​Agent" ​                              //​坐席类型,机器人、普通坐席或管理员
 +            }, 
 +            "​agent_queue":​ {
 +                "​id":​ 2112,                                  //​技能组ID
 +                "​name":​ "​集体组" ​                             //​技能组名称
 +            }, 
 +            "​summary_category":​ [                            //​会话标签,数组,包含所有的标签ID
 +                {
 +                    "​id":​ 23976, ​
 +                    "​name":​ "​测试4-4"​
 +                }
 +            ], 
 +            "​comment":​ "", ​                                  //​会话备注
 +            "​enquiry":​{ ​                              
 +                "​score":​3, ​                                  //​满意度评分
 +                "​comment":"" ​                                //​满意度评价详情
 +            }
 +        }
 +    }
 +}
 +</​code>​
 +
 +访客所属关联信息结构示例:
 +
 +<code json>
 +# IM用户
 +"​channel_user":​ {
 +    "​app_name":​ "​sandbox",​
 +    "​channel_type":​ "​callcenter",​
 +    "​im_id":​ "​webim-visitor-RY7KQK99XVGXBE3JKCHM",​
 +    "​org_name":​ "​sipsoft"​
 +}
 +
 +# CallCenter用户
 +  "​channel_user":​ {
 +    "​channel_type":​ "​callcenter",​
 +    "​name":​ "​访客的名称",​
 +    "​phone":​ "​13112345678"​
 +  }
 +
 +# Rest 渠道用户
 +  "​channel_user":​ {
 +  }
 +
 +# weibo 渠道用户
 +  "​channel_user":​ {
 +    "​channel_type":​ "​weibo",​
 +    "​name":​ "​访客的微博名",​
 +    "​weibo_id":​ "​访客的微博ID"​
 +  }
 +
 +# 微信渠道用户
 +  "​channel_user":​ {
 +    "​channel_type":​ "​wechat_oauth2",​
 +    "​name":​ "​访客的微信名",​
 +    "​weixin_id":​ "​访客的微信ID"​
 +  }
 </​code>​ </​code>​