|
20 | 20 | `StopType` | `stop_type` | `int` | 接待人员的接待状态为「停止接待」的子类型。0:停止接待,1:暂时挂起
|
21 | 21 | `DepartmentID` | `department_id,omitempty` | `int64` | 接待人员部门的id
|
22 | 22 |
|
23 |
| -### `KfServicerResult` 客户群列表数据 |
| 23 | +### `KfServicerResult` 接待人员数据 |
24 | 24 |
|
25 | 25 | Name | JSON | Type | Doc
|
26 | 26 | :---------------|:--------------------------|:---------|:------------
|
|
29 | 29 | `ErrCode` | `errcode` | `int64` | 该条记录的结果
|
30 | 30 | `ErrMsg` | `errmsg` | `string` | 结果信息
|
31 | 31 |
|
| 32 | +### `KfMsg` 客服消息数据 |
| 33 | + |
| 34 | + Name | JSON | Type | Doc |
| 35 | +:---------------|:----------------------------|:--------------|:------------ |
| 36 | +`MsgID` | `msgid,omitempty` | `string` | 消息ID |
| 37 | +`OpenKfID`| `open_kfid,omitempty` | `string` |客服账号ID(msgtype为event,该字段不返回) |
| 38 | +`ExternalUserID`| `external_userid,omitempty` | `string` |客客户UserID(msgtype为event,该字段不返回) |
| 39 | +`SendTime` | `send_time,omitempty` | `int64` | 消息发送时间 |
| 40 | +`Origin` | `origin,omitempty` | `int` | 消息来源。3-微信客户发送的消息 4-系统推送的事件消息 5-接待人员在企业微信客户端发送的消息 |
| 41 | +`ServicerUserID`| `servicer_userid,omitempty` | `string` |从企业微信给客户发消息的接待人员userid(即仅origin为5才返回;msgtype为event,该字段不返回) |
| 42 | +`MsgType` | `msgtype` | `MessageType` | 消息类型 |
| 43 | +`Text` | `text,omitempty` | `Text` | 文本消息 |
| 44 | +`Image` | `image,omitempty` | `Image` | 图片消息 |
| 45 | +`Link` | `link,omitempty` | `Link` | 链接消息 |
| 46 | +`MiniProgram` | `mini_program,omitempty` | `MiniProgram` | 小程序消息 |
| 47 | +`Event` | `event,omitempty` | `KfEvent` | 事件类型 |
| 48 | + |
| 49 | +### `KfEvent` 客服会话事件 |
| 50 | + |
| 51 | +Name|JSON|Type|Doc |
| 52 | +:---|:--|:---|:-- |
| 53 | +`EventType`|`event_type`|`KfEventType`|事件类型 |
| 54 | +`OpenKfID`|`open_kfid`|`string`|客服账号ID |
| 55 | +`ExternalUserID`|`external_userid,omitempty`|`string`|客户UserID,注意不是企业成员的帐号 |
| 56 | +`ServicerUserID`|`servicer_userid,omitempty`|`string`|接待人员userid |
| 57 | +`Scene`|`scene,omitempty`|`string`|用户进入会话事件特有。进入会话的场景值,获取客服账号链接开发者自定义的场景值 |
| 58 | +`SceneParam`|`scene_param,omitempty`|`string`|用户进入会话事件特有。进入会话的自定义参数,获取客服账号链接返回的url,开发者按规范拼接的scene_param参数 |
| 59 | +`WelcomeCode`|`welcome_code,omitempty`|`string`|用户进入会话事件特有。如果满足发送欢迎语条件(条件为:用户在过去48小时里未收过欢迎语,且未向客服发过消息),会返回该字段。可用该welcome_code调用发送事件响应消息接口给客户发送欢迎语。 |
| 60 | +`WechatChannels`|`wechat_channels,omitempty`|`KfWechatChannels`|用户进入会话事件特有。进入会话的视频号信息,从视频号进入会话才有值 |
| 61 | +`FailMsgID`|`fail_msgid,omitempty`|`string`|消息发送失败事件特有。发送失败的消息msgid |
| 62 | +`FailType`|`fail_type,omitempty`|`int`|消息发送失败事件特有。失败类型。0-未知原因 1-客服账号已删除 2-应用已关闭 4-会话已过期,超过48小时 5-会话已关闭 6-超过5条限制 8-主体未验证 10-用户拒收 11-企业未有成员登录企业微信App(排查方法:企业至少一个成员通过手机号验证/微信授权登录企业微信App即可)12-发送的消息为客服组件禁发的消息类型 |
| 63 | +`Status`|`status,omitempty`|`int`|接待人员接待状态变更事件特有。状态类型。1-接待中 2-停止接待 |
| 64 | +`StopType`|`stop_type,omitempty`|`int`|接待人员接待状态变更事件特有。接待人员的状态为「停止接待」的子类型。0:停止接待,1:暂时挂起 |
| 65 | +`ChangeType`|`change_type,omitempty`|`KfServiceState`|会话状态变更事件特有。变更类型,均为接待人员在企业微信客户端操作触发。1-从接待池接入会话 2-转接会话 3-结束会话 4-重新接入已结束/已转接会话 |
| 66 | +`OldServicerUserID`|`old_servicer_userid,omitempty`|`string`|会话状态变更事件特有。老的接待人员userid。仅change_type为2、3和4有值 |
| 67 | +`NewServicerUserid`|`new_servicer_userid,omitempty`|`string`|会话状态变更事件特有。新的接待人员userid。仅change_type为1、2和4有值 |
| 68 | +`MsgCode`|`msg_code,omitempty`|`string`|会话状态变更事件特有。用于发送事件响应消息的code,仅change_type为1和3时,会返回该字段。可用该msg_code调用发送事件响应消息接口给客户发送回复语或结束语。 |
| 69 | +`RecallMsgID`|`recall_msgid,omitempty`|`string`|撤回消息事件特有。 撤回的消息msgid |
| 70 | +`RejectSwitch`|`reject_switch,omitempty`|`int`|拒收客户消息变更事件特有。 拒收客户消息,1表示接待人员拒收了客户消息,0表示接待人员取消拒收客户消息 |
| 71 | + |
| 72 | +### `KfWechatChannels` 进入会话的视频号信息,从视频号进入会话才有值 |
| 73 | + |
| 74 | + Name | JSON | Type | Doc |
| 75 | +:---------------|:--------------------------|:---------|:------------ |
| 76 | + `NickName` | `nickname,omitempty` | `string` | 视频号名称,视频号场景值为1、2、3时返回此项 |
| 77 | + `ShopNickName` | `shop_nickname,omitempty` | `string` | 视频号小店名称,视频号场景值为4、5时返回此项 |
| 78 | + `Scene` | `scene` | `int64` | 视频号场景值。1:视频号主页,2:视频号直播间商品列表页,3:视频号商品橱窗页,4:视频号小店商品详情页,5:视频号小店订单页 |
| 79 | + |
32 | 80 | ```go
|
| 81 | +// KfEventType 事件类型 |
| 82 | +type KfEventType string |
| 83 | + |
| 84 | +const ( |
| 85 | + // KfEventTypeEnterSession 用户进入会话事件 |
| 86 | + KfEventTypeEnterSession KfEventType = "enter_session" |
| 87 | + // KfEventTypeMsgSendFail 消息发送失败事件 |
| 88 | + KfEventTypeMsgSendFail KfEventType = "msg_send_fail" |
| 89 | + // KfEventTypeServicerStatusChange 接待人员接待状态变更事件 |
| 90 | + KfEventTypeServicerStatusChange KfEventType = "servicer_status_change" |
| 91 | + // KfEventTypeSessionStatusChange 会话状态变更事件 |
| 92 | + KfEventTypeSessionStatusChange KfEventType = "session_status_change" |
| 93 | + // KfEventTypeUserRecallMsg 用户撤回消息事件 |
| 94 | + KfEventTypeUserRecallMsg KfEventType = "user_recall_msg" |
| 95 | + // KfEventTypeServicerRecallMsg 接待人员撤回消息事件 |
| 96 | + KfEventTypeServicerRecallMsg KfEventType = "servicer_recall_msg" |
| 97 | + // KfEventTypeRejectCustomerMsgSwitchChange 拒收客户消息变更事件 |
| 98 | + KfEventTypeRejectCustomerMsgSwitchChange KfEventType = "reject_customer_msg_switch_change" |
| 99 | +) |
| 100 | + |
33 | 101 | // KfServiceState 客服会话状态
|
34 | 102 | //
|
35 | 103 | // 0 未处理 新会话接入
|
|
0 commit comments