forked from xen0n/go-workwx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapis.md.go
703 lines (602 loc) · 22.7 KB
/
apis.md.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
// Code generated by sdkcodegen; DO NOT EDIT.
package workwx
// execGetAccessToken 获取access_token
func (c *WorkwxApp) execGetAccessToken(req reqAccessToken) (respAccessToken, error) {
var resp respAccessToken
err := c.executeQyapiGet("/cgi-bin/gettoken", req, &resp, false)
if err != nil {
return respAccessToken{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respAccessToken{}, bizErr
}
return resp, nil
}
// execGetJSAPITicket 获取企业的jsapi_ticket
func (c *WorkwxApp) execGetJSAPITicket(req reqJSAPITicket) (respJSAPITicket, error) {
var resp respJSAPITicket
err := c.executeQyapiGet("/cgi-bin/get_jsapi_ticket", req, &resp, true)
if err != nil {
return respJSAPITicket{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respJSAPITicket{}, bizErr
}
return resp, nil
}
// execGetJSAPITicketAgentConfig 获取应用的jsapi_ticket
func (c *WorkwxApp) execGetJSAPITicketAgentConfig(req reqJSAPITicketAgentConfig) (respJSAPITicket, error) {
var resp respJSAPITicket
err := c.executeQyapiGet("/cgi-bin/ticket/get", req, &resp, true)
if err != nil {
return respJSAPITicket{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respJSAPITicket{}, bizErr
}
return resp, nil
}
// execJSCode2Session 临时登录凭证校验code2Session
func (c *WorkwxApp) execJSCode2Session(req reqJSCode2Session) (respJSCode2Session, error) {
var resp respJSCode2Session
err := c.executeQyapiGet("/cgi-bin/miniprogram/jscode2session", req, &resp, true)
if err != nil {
return respJSCode2Session{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respJSCode2Session{}, bizErr
}
return resp, nil
}
// execUserGet 读取成员
func (c *WorkwxApp) execUserGet(req reqUserGet) (respUserGet, error) {
var resp respUserGet
err := c.executeQyapiGet("/cgi-bin/user/get", req, &resp, true)
if err != nil {
return respUserGet{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respUserGet{}, bizErr
}
return resp, nil
}
// execUserList 获取部门成员详情
func (c *WorkwxApp) execUserList(req reqUserList) (respUserList, error) {
var resp respUserList
err := c.executeQyapiGet("/cgi-bin/user/list", req, &resp, true)
if err != nil {
return respUserList{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respUserList{}, bizErr
}
return resp, nil
}
// execUserIDByMobile 手机号获取userid
func (c *WorkwxApp) execUserIDByMobile(req reqUserIDByMobile) (respUserIDByMobile, error) {
var resp respUserIDByMobile
err := c.executeQyapiJSONPost("/cgi-bin/user/getuserid", req, &resp, true)
if err != nil {
return respUserIDByMobile{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respUserIDByMobile{}, bizErr
}
return resp, nil
}
// execDeptList 获取部门列表
func (c *WorkwxApp) execDeptList(req reqDeptList) (respDeptList, error) {
var resp respDeptList
err := c.executeQyapiGet("/cgi-bin/department/list", req, &resp, true)
if err != nil {
return respDeptList{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respDeptList{}, bizErr
}
return resp, nil
}
// execUserInfoGet 获取访问用户身份
func (c *WorkwxApp) execUserInfoGet(req reqUserInfoGet) (respUserInfoGet, error) {
var resp respUserInfoGet
err := c.executeQyapiGet("/cgi-bin/user/getuserinfo", req, &resp, true)
if err != nil {
return respUserInfoGet{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respUserInfoGet{}, bizErr
}
return resp, nil
}
// execExternalContactList 获取客户列表
func (c *WorkwxApp) execExternalContactList(req reqExternalContactList) (respExternalContactList, error) {
var resp respExternalContactList
err := c.executeQyapiGet("/cgi-bin/externalcontact/list", req, &resp, true)
if err != nil {
return respExternalContactList{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respExternalContactList{}, bizErr
}
return resp, nil
}
// execExternalContactGet 获取客户详情
func (c *WorkwxApp) execExternalContactGet(req reqExternalContactGet) (respExternalContactGet, error) {
var resp respExternalContactGet
err := c.executeQyapiGet("/cgi-bin/externalcontact/get", req, &resp, true)
if err != nil {
return respExternalContactGet{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respExternalContactGet{}, bizErr
}
return resp, nil
}
// execExternalContactBatchList 批量获取客户详情
func (c *WorkwxApp) execExternalContactBatchList(req reqExternalContactBatchList) (respExternalContactBatchList, error) {
var resp respExternalContactBatchList
err := c.executeQyapiJSONPost("/cgi-bin/externalcontact/batch/get_by_user", req, &resp, true)
if err != nil {
return respExternalContactBatchList{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respExternalContactBatchList{}, bizErr
}
return resp, nil
}
// execExternalContactRemark 修改客户备注信息
func (c *WorkwxApp) execExternalContactRemark(req reqExternalContactRemark) (respExternalContactRemark, error) {
var resp respExternalContactRemark
err := c.executeQyapiJSONPost("/cgi-bin/externalcontact/remark", req, &resp, true)
if err != nil {
return respExternalContactRemark{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respExternalContactRemark{}, bizErr
}
return resp, nil
}
// execExternalContactListCorpTags 获取企业标签库
func (c *WorkwxApp) execExternalContactListCorpTags(req reqExternalContactListCorpTags) (respExternalContactListCorpTags, error) {
var resp respExternalContactListCorpTags
err := c.executeQyapiJSONPost("/cgi-bin/externalcontact/get_corp_tag_list", req, &resp, true)
if err != nil {
return respExternalContactListCorpTags{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respExternalContactListCorpTags{}, bizErr
}
return resp, nil
}
// execExternalContactAddCorpTag 添加企业客户标签
func (c *WorkwxApp) execExternalContactAddCorpTag(req reqExternalContactAddCorpTag) (respExternalContactAddCorpTag, error) {
var resp respExternalContactAddCorpTag
err := c.executeQyapiJSONPost("/cgi-bin/externalcontact/add_corp_tag", req, &resp, true)
if err != nil {
return respExternalContactAddCorpTag{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respExternalContactAddCorpTag{}, bizErr
}
return resp, nil
}
// execExternalContactEditCorpTag 编辑企业客户标签
func (c *WorkwxApp) execExternalContactEditCorpTag(req reqExternalContactEditCorpTag) (respExternalContactEditCorpTag, error) {
var resp respExternalContactEditCorpTag
err := c.executeQyapiJSONPost("/cgi-bin/externalcontact/edit_corp_tag", req, &resp, true)
if err != nil {
return respExternalContactEditCorpTag{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respExternalContactEditCorpTag{}, bizErr
}
return resp, nil
}
// execExternalContactDelCorpTag 删除企业客户标签
func (c *WorkwxApp) execExternalContactDelCorpTag(req reqExternalContactDelCorpTag) (respExternalContactDelCorpTag, error) {
var resp respExternalContactDelCorpTag
err := c.executeQyapiJSONPost("/cgi-bin/externalcontact/del_corp_tag", req, &resp, true)
if err != nil {
return respExternalContactDelCorpTag{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respExternalContactDelCorpTag{}, bizErr
}
return resp, nil
}
// execExternalContactMarkTag 标记客户企业标签
func (c *WorkwxApp) execExternalContactMarkTag(req reqExternalContactMarkTag) (respExternalContactMarkTag, error) {
var resp respExternalContactMarkTag
err := c.executeQyapiJSONPost("/cgi-bin/externalcontact/mark_tag", req, &resp, true)
if err != nil {
return respExternalContactMarkTag{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respExternalContactMarkTag{}, bizErr
}
return resp, nil
}
// execListUnassignedExternalContact 获取离职成员的客户列表
func (c *WorkwxApp) execListUnassignedExternalContact(req reqListUnassignedExternalContact) (respListUnassignedExternalContact, error) {
var resp respListUnassignedExternalContact
err := c.executeQyapiJSONPost("/cgi-bin/externalcontact/get_unassigned_list", req, &resp, true)
if err != nil {
return respListUnassignedExternalContact{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respListUnassignedExternalContact{}, bizErr
}
return resp, nil
}
// execTransferExternalContact 分配成员的客户
func (c *WorkwxApp) execTransferExternalContact(req reqTransferExternalContact) (respTransferExternalContact, error) {
var resp respTransferExternalContact
err := c.executeQyapiJSONPost("/cgi-bin/externalcontact/transfer", req, &resp, true)
if err != nil {
return respTransferExternalContact{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respTransferExternalContact{}, bizErr
}
return resp, nil
}
// execGetTransferExternalContactResult 查询客户接替结果
func (c *WorkwxApp) execGetTransferExternalContactResult(req reqGetTransferExternalContactResult) (respGetTransferExternalContactResult, error) {
var resp respGetTransferExternalContactResult
err := c.executeQyapiJSONPost("/cgi-bin/externalcontact/get_transfer_result", req, &resp, true)
if err != nil {
return respGetTransferExternalContactResult{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respGetTransferExternalContactResult{}, bizErr
}
return resp, nil
}
// execTransferGroupChatExternalContact 离职成员的群再分配
func (c *WorkwxApp) execTransferGroupChatExternalContact(req reqTransferGroupChatExternalContact) (respTransferGroupChatExternalContact, error) {
var resp respTransferGroupChatExternalContact
err := c.executeQyapiJSONPost("/cgi-bin/externalcontact/groupchat/transfer", req, &resp, true)
if err != nil {
return respTransferGroupChatExternalContact{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respTransferGroupChatExternalContact{}, bizErr
}
return resp, nil
}
// execAppchatListGet 获取客户群列表
func (c *WorkwxApp) execAppchatListGet(req reqAppchatList) (respAppchatList, error) {
var resp respAppchatList
err := c.executeQyapiJSONPost("/cgi-bin/externalcontact/groupchat/list", req, &resp, true)
if err != nil {
return respAppchatList{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respAppchatList{}, bizErr
}
return resp, nil
}
// execAppchatInfoGet 获取客户群详细
func (c *WorkwxApp) execAppchatInfoGet(req reqAppchatInfo) (respAppchatInfo, error) {
var resp respAppchatInfo
err := c.executeQyapiJSONPost("/cgi-bin/externalcontact/groupchat/get", req, &resp, true)
if err != nil {
return respAppchatInfo{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respAppchatInfo{}, bizErr
}
return resp, nil
}
// execAppchatCreate 创建群聊会话
func (c *WorkwxApp) execAppchatCreate(req reqAppchatCreate) (respAppchatCreate, error) {
var resp respAppchatCreate
err := c.executeQyapiJSONPost("/cgi-bin/appchat/create", req, &resp, true)
if err != nil {
return respAppchatCreate{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respAppchatCreate{}, bizErr
}
return resp, nil
}
// execAppchatGet 获取群聊会话
func (c *WorkwxApp) execAppchatGet(req reqAppchatGet) (respAppchatGet, error) {
var resp respAppchatGet
err := c.executeQyapiGet("/cgi-bin/appchat/get", req, &resp, true)
if err != nil {
return respAppchatGet{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respAppchatGet{}, bizErr
}
return resp, nil
}
// execMessageSend 发送应用消息
func (c *WorkwxApp) execMessageSend(req reqMessage) (respMessageSend, error) {
var resp respMessageSend
err := c.executeQyapiJSONPost("/cgi-bin/message/send", req, &resp, true)
if err != nil {
return respMessageSend{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respMessageSend{}, bizErr
}
return resp, nil
}
// execAppchatSend 应用推送消息
func (c *WorkwxApp) execAppchatSend(req reqMessage) (respMessageSend, error) {
var resp respMessageSend
err := c.executeQyapiJSONPost("/cgi-bin/appchat/send", req, &resp, true)
if err != nil {
return respMessageSend{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respMessageSend{}, bizErr
}
return resp, nil
}
// execMediaUpload 上传临时素材
func (c *WorkwxApp) execMediaUpload(req reqMediaUpload) (respMediaUpload, error) {
var resp respMediaUpload
err := c.executeQyapiMediaUpload("/cgi-bin/media/upload", req, &resp, true)
if err != nil {
return respMediaUpload{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respMediaUpload{}, bizErr
}
return resp, nil
}
// execMediaUploadImg 上传永久图片
func (c *WorkwxApp) execMediaUploadImg(req reqMediaUploadImg) (respMediaUploadImg, error) {
var resp respMediaUploadImg
err := c.executeQyapiMediaUpload("/cgi-bin/media/uploadimg", req, &resp, true)
if err != nil {
return respMediaUploadImg{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respMediaUploadImg{}, bizErr
}
return resp, nil
}
// execOAGetTemplateDetail 获取审批模板详情
func (c *WorkwxApp) execOAGetTemplateDetail(req reqOAGetTemplateDetail) (respOAGetTemplateDetail, error) {
var resp respOAGetTemplateDetail
err := c.executeQyapiJSONPost("/cgi-bin/oa/gettemplatedetail", req, &resp, true)
if err != nil {
return respOAGetTemplateDetail{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respOAGetTemplateDetail{}, bizErr
}
return resp, nil
}
// execOAApplyEvent 提交审批申请
func (c *WorkwxApp) execOAApplyEvent(req reqOAApplyEvent) (respOAApplyEvent, error) {
var resp respOAApplyEvent
err := c.executeQyapiJSONPost("/cgi-bin/oa/applyevent", req, &resp, true)
if err != nil {
return respOAApplyEvent{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respOAApplyEvent{}, bizErr
}
return resp, nil
}
// execOAGetApprovalInfo 批量获取审批单号
func (c *WorkwxApp) execOAGetApprovalInfo(req reqOAGetApprovalInfo) (respOAGetApprovalInfo, error) {
var resp respOAGetApprovalInfo
err := c.executeQyapiJSONPost("/cgi-bin/oa/getapprovalinfo", req, &resp, true)
if err != nil {
return respOAGetApprovalInfo{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respOAGetApprovalInfo{}, bizErr
}
return resp, nil
}
// execOAGetApprovalDetail 获取审批申请详情
func (c *WorkwxApp) execOAGetApprovalDetail(req reqOAGetApprovalDetail) (respOAGetApprovalDetail, error) {
var resp respOAGetApprovalDetail
err := c.executeQyapiJSONPost("/cgi-bin/oa/getapprovaldetail", req, &resp, true)
if err != nil {
return respOAGetApprovalDetail{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respOAGetApprovalDetail{}, bizErr
}
return resp, nil
}
// execMsgAuditListPermitUser 获取会话内容存档开启成员列表
func (c *WorkwxApp) execMsgAuditListPermitUser(req reqMsgAuditListPermitUser) (respMsgAuditListPermitUser, error) {
var resp respMsgAuditListPermitUser
err := c.executeQyapiJSONPost("/cgi-bin/msgaudit/get_permit_user_list", req, &resp, true)
if err != nil {
return respMsgAuditListPermitUser{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respMsgAuditListPermitUser{}, bizErr
}
return resp, nil
}
// execMsgAuditCheckSingleAgree 获取会话同意情况(单聊)
func (c *WorkwxApp) execMsgAuditCheckSingleAgree(req reqMsgAuditCheckSingleAgree) (respMsgAuditCheckSingleAgree, error) {
var resp respMsgAuditCheckSingleAgree
err := c.executeQyapiJSONPost("/cgi-bin/msgaudit/check_single_agree", req, &resp, true)
if err != nil {
return respMsgAuditCheckSingleAgree{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respMsgAuditCheckSingleAgree{}, bizErr
}
return resp, nil
}
// execMsgAuditCheckRoomAgree 获取会话同意情况(群聊)
func (c *WorkwxApp) execMsgAuditCheckRoomAgree(req reqMsgAuditCheckRoomAgree) (respMsgAuditCheckRoomAgree, error) {
var resp respMsgAuditCheckRoomAgree
err := c.executeQyapiJSONPost("/cgi-bin/msgaudit/check_room_agree", req, &resp, true)
if err != nil {
return respMsgAuditCheckRoomAgree{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respMsgAuditCheckRoomAgree{}, bizErr
}
return resp, nil
}
// execMsgAuditGetGroupChat 获取会话内容存档内部群信息
func (c *WorkwxApp) execMsgAuditGetGroupChat(req reqMsgAuditGetGroupChat) (respMsgAuditGetGroupChat, error) {
var resp respMsgAuditGetGroupChat
err := c.executeQyapiJSONPost("/cgi-bin/msgaudit/groupchat/get", req, &resp, true)
if err != nil {
return respMsgAuditGetGroupChat{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respMsgAuditGetGroupChat{}, bizErr
}
return resp, nil
}
// execListFollowUserExternalContact 获取配置了客户联系功能的成员列表
func (c *WorkwxApp) execListFollowUserExternalContact(req reqListFollowUserExternalContact) (respListFollowUserExternalContact, error) {
var resp respListFollowUserExternalContact
err := c.executeQyapiGet("/cgi-bin/externalcontact/get_follow_user_list", req, &resp, true)
if err != nil {
return respListFollowUserExternalContact{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respListFollowUserExternalContact{}, bizErr
}
return resp, nil
}
// execAddContactExternalContact 配置客户联系「联系我」方式
func (c *WorkwxApp) execAddContactExternalContact(req reqAddContactExternalContact) (respAddContactExternalContact, error) {
var resp respAddContactExternalContact
err := c.executeQyapiJSONPost("/cgi-bin/externalcontact/add_contact_way", req, &resp, true)
if err != nil {
return respAddContactExternalContact{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respAddContactExternalContact{}, bizErr
}
return resp, nil
}
// execGetContactWayExternalContact 获取企业已配置的「联系我」方式
func (c *WorkwxApp) execGetContactWayExternalContact(req reqGetContactWayExternalContact) (respGetContactWayExternalContact, error) {
var resp respGetContactWayExternalContact
err := c.executeQyapiJSONPost("/cgi-bin/externalcontact/get_contact_way", req, &resp, true)
if err != nil {
return respGetContactWayExternalContact{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respGetContactWayExternalContact{}, bizErr
}
return resp, nil
}
// execListContactWayChatExternalContact 获取企业已配置的「联系我」列表
func (c *WorkwxApp) execListContactWayChatExternalContact(req reqListContactWayExternalContact) (respListContactWayChatExternalContact, error) {
var resp respListContactWayChatExternalContact
err := c.executeQyapiJSONPost("/cgi-bin/externalcontact/list_contact_way", req, &resp, true)
if err != nil {
return respListContactWayChatExternalContact{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respListContactWayChatExternalContact{}, bizErr
}
return resp, nil
}
// execUpdateContactWayExternalContact 更新企业已配置的「联系我」成员配置
func (c *WorkwxApp) execUpdateContactWayExternalContact(req reqUpdateContactWayExternalContact) (respUpdateContactWayExternalContact, error) {
var resp respUpdateContactWayExternalContact
err := c.executeQyapiJSONPost("/cgi-bin/externalcontact/update_contact_way", req, &resp, true)
if err != nil {
return respUpdateContactWayExternalContact{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respUpdateContactWayExternalContact{}, bizErr
}
return resp, nil
}
// execDelContactWayExternalContact 删除企业已配置的「联系我」方式
func (c *WorkwxApp) execDelContactWayExternalContact(req reqDelContactWayExternalContact) (respDelContactWayExternalContact, error) {
var resp respDelContactWayExternalContact
err := c.executeQyapiJSONPost("/cgi-bin/externalcontact/del_contact_way", req, &resp, true)
if err != nil {
return respDelContactWayExternalContact{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respDelContactWayExternalContact{}, bizErr
}
return resp, nil
}
// execCloseTempChatExternalContact 结束临时会话
func (c *WorkwxApp) execCloseTempChatExternalContact(req reqCloseTempChatExternalContact) (respCloseTempChatExternalContact, error) {
var resp respCloseTempChatExternalContact
err := c.executeQyapiJSONPost("/cgi-bin/externalcontact/close_temp_chat", req, &resp, true)
if err != nil {
return respCloseTempChatExternalContact{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respCloseTempChatExternalContact{}, bizErr
}
return resp, nil
}
// execTransferCustomer 在职继承 分配在职成员的客户
func (c *WorkwxApp) execTransferCustomer(req reqTransferCustomer) (respTransferCustomer, error) {
var resp respTransferCustomer
err := c.executeQyapiJSONPost("/cgi-bin/externalcontact/transfer_customer", req, &resp, true)
if err != nil {
return respTransferCustomer{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respTransferCustomer{}, bizErr
}
return resp, nil
}
// execGetTransferCustomerResult 在职继承 查询客户接替状态
func (c *WorkwxApp) execGetTransferCustomerResult(req reqGetTransferCustomerResult) (respGetTransferCustomerResult, error) {
var resp respGetTransferCustomerResult
err := c.executeQyapiJSONPost("/cgi-bin/externalcontact/transfer_result", req, &resp, true)
if err != nil {
return respGetTransferCustomerResult{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respGetTransferCustomerResult{}, bizErr
}
return resp, nil
}
// execTransferResignedCustomer 离职继承 分配离职成员的客户
func (c *WorkwxApp) execTransferResignedCustomer(req reqTransferCustomer) (respTransferCustomer, error) {
var resp respTransferCustomer
err := c.executeQyapiJSONPost("/cgi-bin/externalcontact/resigned/transfer_customer", req, &resp, true)
if err != nil {
return respTransferCustomer{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respTransferCustomer{}, bizErr
}
return resp, nil
}
// execGetTransferResignedCustomerResult 离职继承 查询客户接替状态
func (c *WorkwxApp) execGetTransferResignedCustomerResult(req reqGetTransferCustomerResult) (respGetTransferCustomerResult, error) {
var resp respGetTransferCustomerResult
err := c.executeQyapiJSONPost("/cgi-bin/externalcontact/resigned/transfer_result", req, &resp, true)
if err != nil {
return respGetTransferCustomerResult{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respGetTransferCustomerResult{}, bizErr
}
return resp, nil
}
// execAddMsgTemplate 创建企业群发
func (c *WorkwxApp) execAddMsgTemplate(req reqAddMsgTemplateExternalContact) (respAddMsgTemplateExternalContact, error) {
var resp respAddMsgTemplateExternalContact
err := c.executeQyapiJSONPost("/cgi-bin/externalcontact/add_msg_template", req, &resp, true)
if err != nil {
return respAddMsgTemplateExternalContact{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return respAddMsgTemplateExternalContact{}, bizErr
}
return resp, nil
}