客户联系

企业服务人员管理

获取配置了客户联系功能的成员列表

  1. WeComContactApp.ExternalContact.GetFollowUsers(ctx)

微信官方文档

客户联系「联系我」管理

配置客户联系「联系我」方式

  1. options := &request.RequestAddContactWay{
  2. Type: 1,
  3. Scene: 1,
  4. Style: 1,
  5. Remark: "渠道客户",
  6. SkipVerify: true,
  7. State: "teststate",
  8. User: []string{"zhangsan", "lisi", "wangwu"},
  9. Party: []int{2, 3},
  10. IsTemp: true,
  11. ExpiresIn: 86400,
  12. ChatExpiresIn: 86400,
  13. UnionID: "oxTWIuGaIt6gTKsQRLau2M0AAAA",
  14. Conclusions: &power.HashMap{
  15. "text": power.HashMap{
  16. "content": "文本消息内容",
  17. },
  18. "image": power.HashMap{
  19. "media_id": "MEDIA_ID",
  20. },
  21. "link": power.HashMap{
  22. "title": "消息标题",
  23. "picurl": "https://example.pic.com/path",
  24. "desc": "消息描述",
  25. "url": "https://example.link.com/path",
  26. },
  27. "miniprogram": power.HashMap{
  28. "title": "消息标题",
  29. "pic_media_id": "MEDIA_ID",
  30. "appid": "wx8bd80126147dfAAA",
  31. "page": "/path/index.html",
  32. },
  33. },
  34. }
  35. WeComContactApp.ExternalContactContactWay.Add(ctx,options)

获取企业已配置的「联系我」方式

  1. WeComContactApp.ExternalContactContactWay.Get(ctx,"[config_id]")

获取企业已配置的「联系我」列表

  1. options := &request.RequestListContactWay{
  2. 1622476800,
  3. 1625068800,
  4. "CURSOR",
  5. 1000,
  6. }
  7. WeComContactApp.ExternalContactContactWay.List(ctx,options)

更新企业已配置的「联系我」方式

  1. configID := c.DefaultQuery("configID", "42b34949e138eb6e027c123cba77fAAA")
  2. options := &request.RequestUpdateContactWay{
  3. ConfigID: configID,
  4. RequestAddContactWay: request.RequestAddContactWay{
  5. Type: 1,
  6. Scene: 1,
  7. Style: 1,
  8. Remark: "渠道客户",
  9. SkipVerify: true,
  10. State: "teststate",
  11. User: []string{"zhangsan", "lisi", "wangwu"},
  12. Party: []int{2, 3},
  13. IsTemp: true,
  14. ExpiresIn: 86400,
  15. ChatExpiresIn: 86400,
  16. UnionID: "oxTWIuGaIt6gTKsQRLau2M0AAAA",
  17. Conclusions: &power.HashMap{
  18. "text": power.HashMap{
  19. "content": "文本消息内容",
  20. },
  21. "image": power.HashMap{
  22. "media_id": "MEDIA_ID",
  23. },
  24. "link": power.HashMap{
  25. "title": "消息标题",
  26. "picurl": "https://example.pic.com/path",
  27. "desc": "消息描述",
  28. "url": "https://example.link.com/path",
  29. },
  30. "miniprogram": power.HashMap{
  31. "title": "消息标题",
  32. "pic_media_id": "MEDIA_ID",
  33. "appid": "wx8bd80126147dfAAA",
  34. "page": "/path/index.html",
  35. },
  36. },
  37. },
  38. }
  39. WeComContactApp.ExternalContactContactWay.Update(ctx,options)

删除企业已配置的「联系我」方式

  1. WeComContactApp.ExternalContactContactWay.Delete(ctx,"[configID]")

结束临时会话

  1. WeComContactApp.ExternalContactContactWay.CloseTempChat(ctx,"[userid]", "[external_userid]")

客户联系「联系我」管理的官方文档是同一页面

微信官方文档

客户管理

获取客户列表

企业可通过此接口获取指定成员添加的客户列表。客户是指配置了客户联系功能的成员所添加的外部联系人。没有配置客户联系功能的成员,所添加的外部联系人将不会作为客户返回。

  1. WeComContactApp.ExternalContact.List(ctx,"[userid]")

微信官方文档

获取客户详情

企业可通过此接口,根据外部联系人的userid(如何获取?),拉取客户详情。

  1. cursor := "" // 上次请求返回的next_cursor
  2. WeComContactApp.ExternalContact.Get(ctx,"[userid]", cursor)

微信官方文档

批量获取客户详情

  1. userIDs := []string{c.DefaultQuery(ctx,"walle", "matrix-x")}
  2. cursor := "" // 上次请求返回的next_cursor
  3. WeComContactApp.ExternalContact.BatchGet(userIDs, cursor, 100)

微信官方文档

修改客户备注信息

  1. options := &request.RequestExternalContactRemark{
  2. UserID: "matrix-x",
  3. ExternalUserID: "woAJ2GCAAAd1asdasdjO4wKmE8Aabj9AAA",
  4. Remark: "备注信息",
  5. Description: "描述信息",
  6. RemarkCompany: "腾讯科技",
  7. RemarkMobiles: []string{
  8. "13800000001",
  9. "13800000002",
  10. },
  11. RemarkPicMediaID: "MEDIAID",
  12. }
  13. WeComContactApp.ExternalContact.Remark(ctx,options)

微信官方文档

客户联系规则组管理

获取规则组列表

  1. cursor := "" // 上次请求返回的next_cursor
  2. limit := 1000
  3. WeComContactApp.ExternalContactCustomerStrategy.List(ctx,cursor, limit)

获取规则组详情

  1. WeComContactApp.ExternalContactCustomerStrategy.Get(ctx,1) // strategy_id: 规则组id

获取规则组管理范围

  1. // strategy_id: 规则组id
  2. // cursor: 分页游标,可为空
  3. // limit: 每个分页的成员/部门节点数,默认为1000,最大为1000
  4. WeComContactApp.ExternalContactCustomerStrategy.GetRange(ctx,1, cursor, 1000)

创建新的规则组

  1. options := &request2.RequestCustomerStrategyCreate{
  2. ParentID: 0,
  3. StrategyName: "NAME",
  4. AdminList: []string{
  5. "zhangsan",
  6. "lisi",
  7. },
  8. Privilege: request2.RequestCustomerStrategyCreatePrivilege{
  9. ViewCustomerList: true,
  10. ViewCustomerData: true,
  11. ViewRoomList: true,
  12. ContactMe: true,
  13. JoinRoom: true,
  14. ShareCustomer: true,
  15. OperResignCustomer: true,
  16. SendCustomerMsg: true,
  17. EditWelcomeMsg: true,
  18. ViewBehaviorData: true,
  19. ViewRoomData: true,
  20. SendGroupMsg: true,
  21. RoomDeduplication: true,
  22. RapidReply: true,
  23. OnjobCustomerTransfer: true,
  24. EditAntiSpamRule: true,
  25. ExportCustomerList: true,
  26. ExportCustomerData: true,
  27. ExportCustomerGroupList: true,
  28. ManageCustomerTag: true,
  29. },
  30. Range: []request2.RequestCustomerStrategyCreateRange{
  31. {
  32. Type: 1,
  33. UserID: "zhangsan",
  34. },
  35. {
  36. Type: 2,
  37. PartyID: 1,
  38. },
  39. },
  40. }
  41. WeComContactApp.ExternalContactCustomerStrategy.Create(ctx,options)

编辑规则组及其管理范围

  1. options := &request2.RequestCustomerStrategyEdit{
  2. StrategyID: 1,
  3. StrategyName: "NAME",
  4. AdminList: []string{
  5. "zhangsan",
  6. "lisi",
  7. },
  8. Privilege: request2.RequestCustomerStrategyPrivilege{
  9. ViewCustomerList: true,
  10. ViewCustomerData: true,
  11. ViewRoomList: true,
  12. ContactMe: true,
  13. JoinRoom: true,
  14. ShareCustomer: true,
  15. OperResignCustomer: true,
  16. SendCustomerMsg: true,
  17. EditWelcomeMsg: true,
  18. ViewBehaviorData: true,
  19. ViewRoomData: true,
  20. SendGroupMsg: true,
  21. RoomDeduplication: true,
  22. RapidReply: true,
  23. OnjobCustomerTransfer: true,
  24. EditAntiSpamRule: true,
  25. ExportCustomerList: true,
  26. ExportCustomerData: true,
  27. ExportCustomerGroupList: true,
  28. ManageCustomerTag: true,
  29. },
  30. RangeAdd: []request2.RequestCustomerStrategyRange{
  31. {
  32. Type: 1,
  33. UserID: "zhangsan",
  34. },
  35. {
  36. Type: 2,
  37. PartyID: 1,
  38. },
  39. },
  40. RangeDel: []request2.RequestCustomerStrategyRange{
  41. {
  42. Type: 1,
  43. UserID: "lisi",
  44. },
  45. {
  46. Type: 2,
  47. PartyID: 2,
  48. },
  49. },
  50. }
  51. WeComContactApp.ExternalContactCustomerStrategy.Edit(ctx,options)

删除规则组

  1. WeComContactApp.ExternalContactCustomerStrategy.Del(ctx,1) // strategy_id

客户联系规则组的官方文档都在同一页面

微信官方文档

客户标签管理

管理企业标签

获取企业标签库

  1. tagIDs := []string{
  2. "etXXXXXXXXXX",
  3. "etYYYYYYYYYY",
  4. }
  5. groupIDs := []string{
  6. "etZZZZZZZZZZZZZ",
  7. "etYYYYYYYYYYYYY",
  8. }
  9. WeComContactApp.ExternalContactTag.GetCorpTagList(tagIDs, groupIDs)

添加企业客户标签

  1. options := &request.RequestTagAddCorpTag{
  2. GroupID: "GROUP_ID",
  3. GroupName: "GROUP_NAME",
  4. Order: 1,
  5. Tag: []request.RequestTagAddCorpTagFieldTag{
  6. {
  7. Name: "TAG_NAME_1",
  8. Order: 1,
  9. },
  10. {
  11. Name: "TAG_NAME_2",
  12. Order: 2,
  13. },
  14. },
  15. }
  16. WeComContactApp.ExternalContactTag.AddCorpTag(options)

编辑企业客户标签

  1. options := &request.RequestTagEditCorpTag{
  2. ID: "TAG_ID",
  3. GroupName: "NEW_TAG_NAME",
  4. Order: 1,
  5. AgentID: 1000014, // 授权方安装的应用agentid。仅旧的第三方多应用套件需要填此参数
  6. }
  7. WeComContactApp.ExternalContactTag.EditCorpTag(options)

删除企业客户标签

  1. options := &request.RequestTagDelCorpTag{
  2. TagID: []string{"TAG_ID_1", "TAG_ID_2"},
  3. GroupID: []string{"GROUP_ID_1", "GROUP_ID_2"},
  4. AgentID: 1000014, // 授权方安装的应用agentid。仅旧的第三方多应用套件需要填此参数
  5. }
  6. WeComContactApp.ExternalContactTag.DelCorpTag(options)

微信官方文档

管理企业规则组下的客户标签

获取指定规则组下的企业客户标签

  1. options := &request.RequestTagGetStrategyTagList{
  2. TagID: []string{
  3. "etXXXXXXXXXX",
  4. "etYYYYYYYYYY"
  5. },
  6. GroupID: []string{
  7. "etZZZZZZZZZZZZZ",
  8. "etYYYYYYYYYYYYY"
  9. },
  10. StrategyID: 1,
  11. }
  12. WeComContactApp.ExternalContactTag.GetStrategyTagList(options)

为指定规则组创建企业客户标签

  1. options := &request.RequestTagAddStrategyTag{
  2. StrategyID: 1,
  3. GroupID: "GROUP_ID",
  4. GroupName: "GROUP_NAME",
  5. Order: 1,
  6. Tag: []request.RequestTagAddStrategyTagFieldTag{
  7. {
  8. Name: "TAG_NAME_1",
  9. Order: 1,
  10. },
  11. {
  12. Name: "TAG_NAME_2",
  13. Order: 2,
  14. },
  15. },
  16. }
  17. WeComContactApp.ExternalContactTag.AddStrategyTag(options)

编辑指定规则组下的企业客户标签

  1. options := &request.RequestTagEditStrategyTag{
  2. ID: "GROUP_ID",
  3. Name: "GROUP_NAME",
  4. Order: 1,
  5. }
  6. WeComContactApp.ExternalContactTag.EditStrategyTag(options)

删除指定规则组下的企业客户标签

  1. options := &request.RequestTagDelStrategyTag{
  2. TagID: []string{
  3. "TAG_ID_1",
  4. "TAG_ID_2",
  5. },
  6. GroupID: []string{
  7. "GROUP_ID_1",
  8. "GROUP_ID_2",
  9. },
  10. }
  11. WeComContactApp.ExternalContactTag.DelStrategyTag(options)

微信官方文档

编辑客户企业标签

  1. options := &request.RequestTagMarkTag{
  2. UserID: "",
  3. ExternalUserID: "",
  4. AddTag: []string{
  5. "TAG_ID_1",
  6. "TAG_ID_2",
  7. },
  8. RemoveTag: []string{
  9. "GROUP_ID_3",
  10. "GROUP_ID_4",
  11. },
  12. }
  13. WeComContactApp.ExternalContactTag.MarkTag(options)

微信官方文档

在职继承

分配在职成员的客户

  1. options := &request.RequestTransferCustomer{
  2. HandoverUserID: "walle", // 原跟进成员的userid
  3. TakeoverUserID: "matrix-x", // 接替成员的userid
  4. ExternalUserID: []string{"woAJ2GCAAAXtWyujaWJHDDGi0mACAAAA"},
  5. TransferSuccessMsg: "您好,您的服务已升级,后续将由我的同事李四@腾讯接替我的工作,继续为您服务。",
  6. }
  7. WeComContactApp.ExternalContactTransfer.TransferCustomer(options)

微信官方文档

查询客户接替状态

  1. options := &request.RequestTransferResult{
  2. HandoverUserID: "walle",
  3. TakeoverUserID: "matrix-x",
  4. Cursor: "",
  5. }
  6. WeComContactApp.ExternalContactTransfer.TransferResult(options)

微信官方文档

离职继承

获取待分配的离职成员列表

  1. pageID := 1
  2. pageSize := 1000
  3. cursor := ""
  4. WeComContactApp.ExternalContactTransfer.GetUnassignedList(pageID, cursor, pageSize)

微信官方文档

分配离职成员的客户

  1. options := &request.RequestResignedTransferCustomer{
  2. HandoverUserID: "walle",
  3. TakeoverUserID: "matrix-x",
  4. ExternalUserID: []string{"woAJ2GCAAAXtWyujaWJHDDGi0mACBBBB"},
  5. }
  6. WeComContactApp.ExternalContactTransfer.ResignedTransferCustomer(options)

微信官方文档

查询客户接替状态

  1. options := &request.RequestResignedTransferResult{
  2. HandoverUserID: "walle",
  3. TakeoverUserID: "matrix-x",
  4. Cursor: "",
  5. }
  6. WeComContactApp.ExternalContactTransfer.ResignedTransferResult(options)

微信官方文档

分配离职成员的客户群

  1. options := &request.RequestGroupChatTransfer{
  2. ChatIDList: []string{
  3. "wrOgQhDgAAcwMTB7YmDkbeBsgT_AAAA",
  4. "wrOgQhDgAAMYQiS5ol9G7gK9JVQUAAAA"
  5. },
  6. NewOwner: "walle",
  7. }
  8. WeComContactApp.ExternalContactTransfer.GroupChatTransfer(options)

微信官方文档

客户群管理

获取客户群列表

  1. options := &request.RequestGroupChatList{
  2. StatusFilter: 0,
  3. OwnerFilter: &power.HashMap{
  4. "userid_list": []string{"abel"},
  5. },
  6. Cursor: "r9FqSqsI8fgNbHLHE5QoCP50UIg2cFQbfma3l2QsmwI",
  7. Limit: 10,
  8. }
  9. WeComContactApp.ExternalContactGroupChat.List(options)

微信官方文档

获取客户群详情

  1. chatID := "wrOgQhDgAAMYQiS5ol9G7gK9JVAAAA"
  2. // 是否需要返回群成员的名字group_chat.member_list.name。0-不返回;1-返回。默认不返回
  3. bNeedName := 1
  4. WeComContactApp.ExternalContactGroupChat.Get(chatID, bNeedName)

微信官方文档

客户群opengid转换

  1. openID := "oAAAAAAA"
  2. WeComContactApp.ExternalContactGroupChat.OpenGIDToChatID(openID)

微信官方文档

客户朋友圈

概述

微信官方文档

获取客户朋友圈全部的发表记录

获取企业全部的发表列表

  1. options := &request.RequestGetMomentList{
  2. StartTime: 1605000000,
  3. EndTime: 1605172726,
  4. Creator: "walle",
  5. FilterType: 1,
  6. Cursor: "",
  7. Limit: 10,
  8. }
  9. WeComContactApp.ExternalContactMoment.GetMomentList(options)

获取客户朋友圈企业发表的列表

  1. momentID := "wrOgQhDgAAMYQiS5ol9G7gK9JVAAAA"
  2. cursor := ""
  3. limit := 100
  4. WeComContactApp.ExternalContactMoment.GetMomentTask(momentID, cursor, limit)

获取客户朋友圈发表时选择的可见范围

  1. momentID := "wrOgQhDgAAMYQiS5ol9G7gK9JVAAAA"
  2. cursor := ""
  3. limit := 100
  4. userID := "matrix-x"
  5. WeComContactApp.ExternalContactMoment.GetMomentCustomerList(momentID, userID, cursor, limit)

获取客户朋友圈发表后的可见客户列表

  1. momentID := "wrOgQhDgAAMYQiS5ol9G7gK9JVAAAA"
  2. cursor := ""
  3. limit := 100
  4. userID := "matrix-x"
  5. WeComContactApp.ExternalContactMoment.GetMomentCustomerList(momentID, userID, cursor, limit)

获取客户朋友圈的互动数据

  1. momentID := "wrOgQhDgAAMYQiS5ol9G7gK9JVAAAA"
  2. userID := "matrix-x"
  3. WeComContactApp.ExternalContactMoment.GetMomentComments(momentID, userID)

微信官方文档

客户朋友圈规则组管理

获取规则组列表

  1. cursor := ""
  2. limit := 100
  3. WeComContactApp.ExternalContactMomentStrategy.List(cursor, limit)

获取规则组详情

  1. strategyID := 0
  2. WeComContactApp.ExternalContactMomentStrategy.Get(strategyID)

获取规则组管理范围

  1. strategyID := 0
  2. cursor := ""
  3. limit := 100
  4. WeComContactApp.ExternalContactMomentStrategy.GetRange(strategyID, cursor, limit)

创建新的规则组

  1. options := &request2.RequestMomentStrategyCreate{
  2. ParentID: 0,
  3. StrategyName: "NAME",
  4. AdminList: []string{
  5. "zhangsan",
  6. "lisi",
  7. },
  8. Privilege: &power.HashMap{
  9. "send_moment": true,
  10. "view_moment_list": true,
  11. "manage_moment_cover_and_sign": true,
  12. },
  13. Range: []*power.HashMap{
  14. &power.HashMap{
  15. "type": 1,
  16. "userid": "zhangsan",
  17. },
  18. &power.HashMap{
  19. "type": 2,
  20. "partyid": 1,
  21. },
  22. },
  23. }
  24. WeComContactApp.ExternalContactMomentStrategy.Create(options)

编辑规则组及其管理范围

  1. options := &request2.RequestMomentStrategyEdit{
  2. StrategyID: 1,
  3. StrategyName: "NAME",
  4. AdminList: []string{
  5. "zhangsan",
  6. "lisi",
  7. },
  8. Privilege: &power.HashMap{
  9. "send_moment": true,
  10. "view_moment_list": true,
  11. "manage_moment_cover_and_sign": true,
  12. },
  13. RangeAdd: []*power.HashMap{
  14. &power.HashMap{
  15. "type": 1,
  16. "userid": "zhangsan",
  17. },
  18. &power.HashMap{
  19. "type": 2,
  20. "partyid": 1,
  21. },
  22. },
  23. RangeDel: []*power.HashMap{
  24. &power.HashMap{
  25. "type": 1,
  26. "userid": "lisi",
  27. },
  28. &power.HashMap{
  29. "type": 2,
  30. "partyid": 2,
  31. },
  32. },
  33. }
  34. WeComContactApp.ExternalContactMomentStrategy.Edit(options)

删除规则组

  1. strategyID := 0
  2. WeComContactApp.ExternalContactMomentStrategy.Del(strategyID)

微信官方文档

消息推送

创建企业群发

  1. options := &request.RequestSendWelcomeMsg{
  2. WelcomeCode: c.DefaultQuery("welcomeCode", "CALLBACK_CODE"),
  3. Text: &request.TextOfMessage{
  4. "文本消息内容",
  5. },
  6. Attachments: []*power.HashMap{
  7. &power.HashMap{
  8. "msgtype": "image",
  9. "image": power.HashMap{
  10. "media_id": "MEDIA_ID",
  11. "pic_url": "http://p.qpic.cn/pic_wework/3474110808/7a6344sdadfwehe42060/0",
  12. },
  13. }, &power.HashMap{
  14. "msgtype": "link",
  15. "link": power.HashMap{
  16. "title": "消息标题",
  17. "picurl": "https://example.pic.com/path",
  18. "desc": "消息描述",
  19. "url": "https://example.link.com/path",
  20. },
  21. }, &power.HashMap{
  22. "msgtype": "miniprogram",
  23. "miniprogram": power.HashMap{
  24. "title": "消息标题",
  25. "pic_media_id": "MEDIA_ID",
  26. "appid": "wx8bd80126147dfAAA",
  27. "page": "/path/index.html",
  28. },
  29. }, &power.HashMap{
  30. "msgtype": "video",
  31. "video": power.HashMap{
  32. "media_id": "MEDIA_ID",
  33. },
  34. }, &power.HashMap{
  35. "msgtype": "file",
  36. "file":
  37. power.HashMap{
  38. "media_id": "MEDIA_ID",
  39. },
  40. },
  41. },
  42. }
  43. WeComContactApp.ExternalContactMessageTemplate.SendWelcomeMsg(options)

微信官方文档

获取企业的全部群发记录

获取群发记录列表

  1. options := &request.RequestGetGroupMsgListV2{
  2. ChatType: "single",
  3. StartTime: 1605171726,
  4. EndTime: 1605172726,
  5. Creator: "matrix-x",
  6. FilterType: 1,
  7. Limit: 50,
  8. Cursor: "CURSOR",
  9. }
  10. WeComContactApp.ExternalContactMessageTemplate.GetGroupMsgListV2(options)

获取群发成员发送任务列表

  1. msgID := "wrOgQhDgAAMYQiS5ol9G7gK9JVAAAA"
  2. limit := 1000
  3. cursor := ""
  4. WeComContactApp.ExternalContactMessageTemplate.GetGroupMsgTask(msgID, limit, cursor)

获取企业群发成员执行结果

  1. msgID := "wrOgQhDgAAMYQiS5ol9G7gK9JVAAAA"
  2. userID := "wrOgQhDgAAMYQiS5ol9G7gK9JVAAAA"
  3. limit := 1000
  4. cursor := "wrOgQhDgAAMYQiS5ol9G7gK9JVAAAA"
  5. WeComContactApp.ExternalContactMessageTemplate.GetGroupMsgSendResult(msgID, userID, limit, cursor)

微信官方文档

发送新客户欢迎语

  1. options := &request.RequestSendWelcomeMsg{
  2. WelcomeCode: c.DefaultQuery("welcomeCode", "CALLBACK_CODE"),
  3. Text: &request.TextOfMessage{
  4. "文本消息内容",
  5. },
  6. Attachments: []*power.HashMap{
  7. &power.HashMap{
  8. "msgtype": "image",
  9. "image": power.HashMap{
  10. "media_id": "MEDIA_ID",
  11. "pic_url": "http://p.qpic.cn/pic_wework/3474110808/7a6344sdadfwehe42060/0",
  12. },
  13. }, &power.HashMap{
  14. "msgtype": "link",
  15. "link": power.HashMap{
  16. "title": "消息标题",
  17. "picurl": "https://example.pic.com/path",
  18. "desc": "消息描述",
  19. "url": "https://example.link.com/path",
  20. },
  21. }, &power.HashMap{
  22. "msgtype": "miniprogram",
  23. "miniprogram": power.HashMap{
  24. "title": "消息标题",
  25. "pic_media_id": "MEDIA_ID",
  26. "appid": "wx8bd80126147dfAAA",
  27. "page": "/path/index.html",
  28. },
  29. }, &power.HashMap{
  30. "msgtype": "video",
  31. "video": power.HashMap{
  32. "media_id": "MEDIA_ID",
  33. },
  34. }, &power.HashMap{
  35. "msgtype": "file",
  36. "file":
  37. power.HashMap{
  38. "media_id": "MEDIA_ID",
  39. },
  40. },
  41. },
  42. }
  43. WeComContactApp.ExternalContactMessageTemplate.SendWelcomeMsg(options)

微信官方文档

入群欢迎语素材管理

添加入群欢迎语素材

  1. options := &request2.RequestGroupWelcomeTemplateAdd{
  2. Text: &request.TextOfMessage{
  3. "亲爱的%NICKNAME%用户,你好",
  4. },
  5. Image: &request.Image{
  6. "MEDIA_ID",
  7. "http://p.qpic.cn/pic_wework/3474110808/7a6344sdadfwehe42060/0",
  8. },
  9. Link: &request.Link{
  10. "消息标题",
  11. "https://example.pic.com/path",
  12. "消息描述",
  13. "https://example.link.com/path",
  14. },
  15. MiniProgram: &request.MiniProgram{
  16. "消息标题",
  17. "MEDIA_ID",
  18. "wx8bd80126147dfAAA",
  19. "/path/index",
  20. },
  21. File: &request.File{
  22. "1Yv-zXfHjSjU-7LH-GwtYqDGS-zz6w22KmWAT5COgP7o",
  23. },
  24. Video: &request.Video{
  25. "MEDIA_ID",
  26. },
  27. AgentID: 1000014,
  28. Notify: 1,
  29. }
  30. WeComContactApp.ExternalContactGroupWelcomeTemplate.AddGroupWelcomeTemplate(options)

编辑入群欢迎语素材

  1. options := &request2.RequestGroupWelcomeTemplateEdit{
  2. TemplateID: c.DefaultQuery("templateID", "TEMPLATEID"),
  3. Text: &request.TextOfMessage{
  4. "亲爱的%NICKNAME%用户,你好",
  5. },
  6. Image: &request.Image{
  7. "MEDIA_ID",
  8. "http://p.qpic.cn/pic_wework/3474110808/7a6344sdadfwehe42060/0",
  9. },
  10. Link: &request.Link{
  11. "消息标题",
  12. "https://example.pic.com/path",
  13. "消息描述",
  14. "https://example.link.com/path",
  15. },
  16. MiniProgram: &request.MiniProgram{
  17. "消息标题",
  18. "MEDIA_ID",
  19. "wx8bd80126147dfAAA",
  20. "/path/index",
  21. },
  22. File: &request.File{
  23. "1Yv-zXfHjSjU-7LH-GwtYqDGS-zz6w22KmWAT5COgP7o",
  24. },
  25. Video: &request.Video{
  26. "MEDIA_ID",
  27. },
  28. AgentID: 1000014,
  29. Notify: 1,
  30. }
  31. WeComContactApp.ExternalContactGroupWelcomeTemplate.EditGroupWelcomeTemplate(options)

获取入群欢迎语素材

  1. templateID := "TEMPLATEID"
  2. WeComContactApp.ExternalContactGroupWelcomeTemplate.GetGroupWelcomeTemplate(templateID)

删除入群欢迎语素材

  1. templateID := "TEMPLATEID"
  2. agentID, _ := 100001
  3. services.WeComContactApp.ExternalContactGroupWelcomeTemplate.DelGroupWelcomeTemplate(templateID, int64(agentID))

微信官方文档

统计管理

获取「联系客户统计」数据

微信官方文档

获取「群聊数据统计」数据

微信官方文档

变更回调

概述

微信官方文档

事件格式

微信官方文档

使用示例

参考:PowerWechatTutorial