@@ -33,6 +33,7 @@ type AccountAddSchema struct {
33
33
}
34
34
35
35
// AccountAdd 添加客服账号
36
+ // see https://developer.work.weixin.qq.com/document/path/94662
36
37
func (r * Client ) AccountAdd (options AccountAddOptions ) (info AccountAddSchema , err error ) {
37
38
var (
38
39
accessToken string
@@ -59,6 +60,7 @@ type AccountDelOptions struct {
59
60
}
60
61
61
62
// AccountDel 删除客服账号
63
+ // see https://developer.work.weixin.qq.com/document/path/94663
62
64
func (r * Client ) AccountDel (options AccountDelOptions ) (info util.CommonError , err error ) {
63
65
var (
64
66
accessToken string
@@ -86,7 +88,8 @@ type AccountUpdateOptions struct {
86
88
MediaID string `json:"media_id"` // 客服头像临时素材。可以调用上传临时素材接口获取, 不多于128个字节
87
89
}
88
90
89
- // AccountUpdate 修复客服账号
91
+ // AccountUpdate 修改客服账号
92
+ // see https://developer.work.weixin.qq.com/document/path/94664
90
93
func (r * Client ) AccountUpdate (options AccountUpdateOptions ) (info util.CommonError , err error ) {
91
94
var (
92
95
accessToken string
@@ -109,9 +112,10 @@ func (r *Client) AccountUpdate(options AccountUpdateOptions) (info util.CommonEr
109
112
110
113
// AccountInfoSchema 客服详情
111
114
type AccountInfoSchema struct {
112
- OpenKFID string `json:"open_kfid"` // 客服帐号ID
113
- Name string `json:"name"` // 客服帐号名称
114
- Avatar string `json:"avatar"` // 客服头像URL
115
+ OpenKFID string `json:"open_kfid"` // 客服帐号ID
116
+ Name string `json:"name"` // 客服帐号名称
117
+ Avatar string `json:"avatar"` // 客服头像URL
118
+ ManagePrivilege bool `json:"manage_privilege"` // 当前调用接口的应用身份,是否有该客服账号的管理权限(编辑客服账号信息、分配会话和收发消息)
115
119
}
116
120
117
121
// AccountListSchema 获取客服账号列表响应内容
@@ -141,6 +145,31 @@ func (r *Client) AccountList() (info AccountListSchema, err error) {
141
145
return info , nil
142
146
}
143
147
148
+ // AccountPagingRequest 分页获取客服账号列表请求
149
+ type AccountPagingRequest struct {
150
+ Offset int `json:"offset"`
151
+ Limit int `json:"limit"`
152
+ }
153
+
154
+ // AccountPaging 分页获取客服账号列表
155
+ // see https://developer.work.weixin.qq.com/document/path/94661
156
+ func (r * Client ) AccountPaging (req * AccountPagingRequest ) (* AccountListSchema , error ) {
157
+ var (
158
+ accessToken string
159
+ err error
160
+ )
161
+ if accessToken , err = r .ctx .GetAccessToken (); err != nil {
162
+ return nil , err
163
+ }
164
+ var response []byte
165
+ if response , err = util .PostJSON (fmt .Sprintf (accountListAddr , accessToken ), req ); err != nil {
166
+ return nil , err
167
+ }
168
+ result := & AccountListSchema {}
169
+ err = util .DecodeWithError (response , result , "AccountPaging" )
170
+ return result , err
171
+ }
172
+
144
173
// AddContactWayOptions 获取客服账号链接
145
174
// 1.若scene非空,返回的客服链接开发者可拼接scene_param=SCENE_PARAM参数使用,用户进入会话事件会将SCENE_PARAM原样返回。其中SCENE_PARAM需要urlencode,且长度不能超过128字节。
146
175
// 如 https://work.weixin.qq.com/kf/kfcbf8f8d07ac7215f?enc_scene=ENCGFSDF567DF&scene_param=a%3D1%26b%3D2
@@ -158,6 +187,7 @@ type AddContactWaySchema struct {
158
187
}
159
188
160
189
// AddContactWay 获取客服账号链接
190
+ // see https://developer.work.weixin.qq.com/document/path/94665
161
191
func (r * Client ) AddContactWay (options AddContactWayOptions ) (info AddContactWaySchema , err error ) {
162
192
var (
163
193
accessToken string
0 commit comments