Documentation
¶
Overview ¶
*
- 企业微信处理(发消息,服务于报警)
Index ¶
- func AGGetDetail(api *token.Api)
- func AuthGetInfoByTicket(api *token.Api, ticket string) (*structs.UserInfo, error)
- func AuthGetInfoWithCode(api *token.Api, code string) (*structs.UserInfoWithCode, error)
- func BatchUserIdToOpenUserId(api *token.Api, user *structs.UserIdReq) (*structs.OpenUserId, error)
- func DepartCreate(api *token.Api, dep *structs.Department) error
- func DepartDelete(api *token.Api, departId string) error
- func DepartGetDetail(api *token.Api, id string) (*structs.Department, error)
- func DepartGetList(api *token.Api, id string) ([]*structs.Department, error)
- func DepartGetSimpleList(api *token.Api, id string) ([]*structs.DepartmentId, error)
- func DepartUpdate(api *token.Api, dep *structs.Department) error
- func ExportDepartment(api *token.Api, req *structs.Export) (string, error)
- func ExportResult(api *token.Api, jobId string) (*structs.ExportResult, error)
- func ExportSimpleUser(api *token.Api, req *structs.Export) (string, error)
- func ExportTagUser(api *token.Api, req *structs.Export, tagId int) (string, error)
- func ExportUserDetail(api *token.Api, req *structs.Export) (string, error)
- func ExtContactAddMomentTask(corp *token.Api, req *structs.AddMomentTask) (string, error)
- func ExtContactAddMsgTemplate(corp *token.Api, req *structs.ExMsgTemplate) (*structs.MsgTemplateRes, error)
- func ExtContactAddStrategyTag(corp *token.Api, tag *structs.AddStrategyTagReq) (*structs.TagGroup, error)
- func ExtContactAddTag(corp *token.Api, req *structs.AddTagReq) ([]*structs.TagGroup, error)
- func ExtContactBatchDetail(corp *token.Api, batch *structs.BatchUserId) ([]*structs.ExternalContactDetail, string, error)
- func ExtContactCancelMomentTask(corp *token.Api, momentId string) error
- func ExtContactDeleteStrategyTag(corp *token.Api, tag *structs.TagId) error
- func ExtContactDeleteTag(corp *token.Api, tags *structs.TagId, agentId string) error
- func ExtContactEditStrategyTag(corp *token.Api, tag *structs.EditTagReq) error
- func ExtContactEditTag(corp *token.Api, req *structs.EditTagReq) error
- func ExtContactFollowUserList(corp *token.Api) ([]string, error)
- func ExtContactGetDetail(corp *token.Api, externalUserid string, cursor string) (*structs.ExternalContactDetail, string, error)
- func ExtContactGetGroupMsgList(corp *token.Api, req *structs.GroupMsgReq) ([]*structs.GroupMsg, string, error)
- func ExtContactGetList(corp *token.Api, userid string) ([]string, error)
- func ExtContactGetMomentList(corp *token.Api, req structs.MomentListReq) (*structs.MomentListResp, error)
- func ExtContactGetMomentTaskResult(corp *token.Api, jobId string) (*structs.MomentTaskResult, error)
- func ExtContactGetNewExternalUserId(corp *token.Api, externalUseridList []string) ([]*structs.NewExternalUserid, error)
- func ExtContactGetTagList(corp *token.Api, tags []string, groups []string) ([]*structs.TagGroup, error)
- func ExtContactGroupDetail(corp *token.Api, chatId string, needName int) (*structs.GroupChatDetail, error)
- func ExtContactGroupList(corp *token.Api, req *structs.ExternalGroupListReq) ([]*structs.GroupChat, string, error)
- func ExtContactGroupNewExternalUserId(corp *token.Api, chatId string, externalUseridList []string) ([]*structs.NewExternalUserid, error)
- func ExtContactMarkTag(corp *token.Api, tags *structs.MarkTagReq) error
- func ExtContactOpenGroupIdToChatId(corp *token.Api, groupId string) (string, error)
- func ExtContactRemark(corp *token.Api, remark *structs.ExternalRemark) error
- func ExtContactServiceToExternalUserId(corp *token.Api, externalUserid string) (string, error)
- func ExtContactStrategyTagList(corp *token.Api, tags *structs.TagId, strategyId string) ([]*structs.TagGroup, error)
- func ExtContactUnionIdToExternalUserId3rd(corp *token.Api, unionid, openId string) ([]*structs.ExternalUserIdInfo, error)
- func ExtContactUnionIdToExternalUserid(corp *token.Api, unionid, openId string) (string, error)
- func GetAccessToken(tk token.Token, d data.D) (access.Token, error)
- func GetCorpService() token.Service
- func GetJoinQrcode(api *token.Api, sizeType int) (string, error)
- func GetMsgAuditService() token.Service
- func GetProviderService() token.Service
- func GetService() token.Service
- func GetSuiteService() token.Service
- func IDCApplyMassCallTicket(api *token.Api, req ExtToPendingId) (string, error)
- func ImportBatchReplaceDepart(api *token.Api, req *structs.ImportReq) (string, error)
- func ImportBatchReplaceUser(api *token.Api, req *structs.ImportReq) (string, error)
- func ImportBatchResult(api *token.Api, jobId string) (*structs.ImportResult, error)
- func ImportBatchSYncUser(api *token.Api, req *structs.ImportReq) (string, error)
- func IsTokenExpired(code int32) bool
- func MACheckRoomAgree(api *token.Api, roomId string) ([]structs.AgreeInfo, error)
- func MACheckSingleAgree(api *token.Api, agrees []structs.SingleAgree) ([]structs.AgreeInfo, error)
- func MAGetGroupChat(api *token.Api, roomId string) (*structs.RoomInfo, error)
- func MAGetPermitUserList(api *token.Api, ty int) ([]string, error)
- func MigrateToCustomizedApp(api *token.Api, suiteAccessToken string) error
- func NewCorpToken(app token.App) token.Token
- func NewMessage(toWho structs.ToWho, msgType string, msg interface{}) structs.Message
- func NewMsgAuditToken(app token.App) token.Token
- func NewProviderToken(app token.App) token.Token
- func NewSuiteToken(app token.App) token.Token
- func NewToken(app token.App) token.Token
- func Notify(option *config.Options, content interface{}, call FillContentCallback) error
- func ProviderTokenUrl(acsKey string, uri string) string
- func SendMessage(api *token.Api, msg structs.Message) error
- func SuiteTokenUrl(acsKey string, uri string) string
- func TAGAddUser(api *token.Api, tag *UserTag) error
- func TAGCreate(api *token.Api, tag *Tag) (string, error)
- func TAGDelete(api *token.Api, tagId int64) error
- func TAGDeleteUser(api *token.Api, tag *UserTag) error
- func TAGUpdate(api *token.Api, tag *Tag) error
- func UserBatchDelete(api *token.Api, userid []string) error
- func UserCheckMemberAuth(api *token.Api, openUserId string) (bool, error)
- func UserCreate(api *token.Api, user *structs.DepMember) error
- func UserDelete(api *token.Api, userid string) error
- func UserGetByEmail(api *token.Api, email string, emailType int) (string, error)
- func UserGetByMobile(api *token.Api, mobile string) (string, error)
- func UserGetByUserId(api *token.Api, userid string) (*structs.DepMember, error)
- func UserGetDetailByDepartId(api *token.Api, departId string) ([]*structs.DepMember, error)
- func UserGetListId(api *token.Api, cursor string, limit int) ([]*structs.DepUser, string, error)
- func UserGetSimpleByDepartId(api *token.Api, departId string) ([]*structs.SimpleUser, error)
- func UserMemberAuthList(api *token.Api, cursor string, limit int) (*structs.MemberAuthResult, error)
- func UserSelectTicket(api *token.Api, selectedTicket string) (*structs.SelectedTicketResult, error)
- func UserUpdate(api *token.Api, user *structs.DepMember) error
- func UserUserId2OpenId(api *token.Api, userid string) (string, error)
- type AgentBase
- type AgentDetail
- type AllowPartys
- type AllowTags
- type AllowUser
- type AllowUserInfos
- type ExtToPendingId
- type ExtToPendingIdResult
- type FillContentCallback
- type KfIDResult
- type Tag
- type TagIDResult
- type TmpExternalUser
- type TmpExternalUserResult
- type UnionIdTo
- type UnionIdToResult
- type User
- type UserTag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AGGetDetail ¶ added in v1.0.23
AGGetDetail 获取指定的应用详情 对于互联企业的应用,如果需要获取应用可见范围内其他互联企业的部门与成员,请调用互联企业-获取应用可见范围接口 请求方式:GET(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/agent/get?access_token=ACCESS_TOKEN&agentid=AGENTID
func AuthGetInfoByTicket ¶ added in v1.8.4
AuthGetInfoByTicket 获取访问用户敏感信息 自建应用与代开发应用可通过该接口获取成员授权的敏感字段 对于自建应用与代开发应用,敏感字段需要管理员在应用详情里选择,且成员oauth2授权时确认后才返回。 敏感字段包括:性别、头像、员工个人二维码、手机、邮箱、企业邮箱、地址。 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/auth/getuserdetail?access_token=ACCESS_TOKEN
func AuthGetInfoWithCode ¶ added in v1.8.4
AuthGetInfoWithCode 获取访问用户身份 该接口用于根据code获取成员信息 请求方式:GET(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/auth/getuserinfo?access_token=ACCESS_TOKEN&code=CODE
func BatchUserIdToOpenUserId ¶ added in v1.0.0
BatchUserIdToOpenUserId userid的转换 doc: https://developer.work.weixin.qq.com/document/path/95435 将企业主体下的明文userid转换为服务商主体下的密文userid。 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/batch/userid_to_openuserid?access_token=ACCESS_TOKEN
func DepartCreate ¶ added in v1.8.4
func DepartCreate(api *token.Api, dep *structs.Department) error
DepartCreate 创建部门 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/department/create?access_token=ACCESS_TOKEN
func DepartDelete ¶ added in v1.8.4
DepartDelete 删除部门 请求方式:GET(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/department/delete?access_token=ACCESS_TOKEN&id=ID
func DepartGetDetail ¶ added in v1.8.4
DepartGetDetail 获取单个部门详情 企业通讯录安全特别重要,企业微信将持续升级加固通讯录接口的安全机制,以下是关键的变更点: 【重要】从2022年8月15日10点开始,“企业管理后台 - 管理工具 - 通讯录同步”的新增IP将不能再调用此接口,企业可通过「获取部门ID列表」接口获取部门ID列表。查看调整详情。 请求方式:GET(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/department/get?access_token=ACCESS_TOKEN&id=ID
func DepartGetList ¶ added in v1.8.4
DepartGetList 获取部门列表 企业通讯录安全特别重要,企业微信将持续升级加固通讯录接口的安全机制,以下是关键的变更点: 【重要】从2022年8月15日10点开始,“企业管理后台 - 管理工具 - 通讯录同步”的新增IP将不能再调用此接口,企业可通过「获取部门ID列表」接口获取部门ID列表。查看调整详情。 请求方式:GET(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/department/list?access_token=ACCESS_TOKEN&id=ID
func DepartGetSimpleList ¶ added in v1.8.4
DepartGetSimpleList 获取子部门ID列表 请求方式:GET(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/department/simplelist?access_token=ACCESS_TOKEN&id=ID
func DepartUpdate ¶ added in v1.8.4
func DepartUpdate(api *token.Api, dep *structs.Department) error
DepartUpdate 更新部门 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/department/update?access_token=ACCESS_TOKEN
func ExportDepartment ¶ added in v1.8.4
ExportDepartment 导出部门 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/export/user?access_token=ACCESS_TOKEN
func ExportResult ¶ added in v1.8.4
func ExportSimpleUser ¶ added in v1.8.4
ExportSimpleUser 导出成员 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/export/simple_user?access_token=ACCESS_TOKEN
func ExportTagUser ¶ added in v1.8.4
ExportTagUser 导出标签成员 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/export/taguser?access_token=ACCESS_TOKEN
func ExportUserDetail ¶ added in v1.8.4
ExportUserDetail 导出成员详情 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/export/user?access_token=ACCESS_TOKEN
func ExtContactAddMomentTask ¶ added in v1.8.4
ExtContactAddMomentTask 企业和第三方应用可通过该接口创建客户朋友圈的发表任务 企业可通过此接口,根据外部联系人的userid(如何获取?),拉取客户详情。 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/externalcontact/add_moment_task?access_token=ACCESS_TOKEN
func ExtContactAddMsgTemplate ¶ added in v1.8.4
func ExtContactAddMsgTemplate(corp *token.Api, req *structs.ExMsgTemplate) (*structs.MsgTemplateRes, error)
ExtContactAddMsgTemplate 添加企业群发消息模板 企业可通过此接口添加企业群发消息的模板并通知客服人员发送给相关客户。(注:企业微信终端需升级到2.7.5版本及以上) 注意:调用该接口并不会直接发送消息给客户,需要相关的客服人员操作以后才会实际发送(客服人员的企业微信需要升级到2.7.5及以上版本) 同一个企业对一个客户一个自然周内(周一至周日)至多只能发送一条消息,超过限制的用户将会被忽略。
func ExtContactAddStrategyTag ¶ added in v1.8.4
func ExtContactAddStrategyTag(corp *token.Api, tag *structs.AddStrategyTagReq) (*structs.TagGroup, error)
ExtContactAddStrategyTag 为指定规则组创建企业客户标签 企业可通过此接口向规则组中添加新的标签组和标签,每个企业的企业标签和规则组标签合计最多可配置3000个。注意,仅可在一级规则组下添加标签。 请求方式: POST(HTTP) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/externalcontact/add_strategy_tag?access_token=ACCESS_TOKEN
func ExtContactAddTag ¶ added in v1.8.4
ExtContactAddTag 添加企业客户标签 企业可通过此接口向客户标签库中添加新的标签组和标签,每个企业最多可配置3000个企业标签。 请求方式: POST(HTTP) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/externalcontact/add_corp_tag?access_token=ACCESS_TOKEN
func ExtContactBatchDetail ¶ added in v1.8.4
func ExtContactBatchDetail(corp *token.Api, batch *structs.BatchUserId) ([]*structs.ExternalContactDetail, string, error)
ExtContactBatchDetail 批量获取客户详情 企业/第三方可通过此接口获取指定成员添加的客户信息列表。 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/externalcontact/batch/get_by_user?access_token=ACCESS_TOKEN
func ExtContactCancelMomentTask ¶ added in v1.8.4
ExtContactCancelMomentTask 停止发表企业朋友圈
func ExtContactDeleteStrategyTag ¶ added in v1.8.4
ExtContactDeleteStrategyTag 删除指定规则组下的企业客户标签 企业可通过此接口删除某个规则组下的标签,或删除整个标签组。 请求方式: POST(HTTP) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/externalcontact/del_strategy_tag?access_token=ACCESS_TOKEN
func ExtContactDeleteTag ¶ added in v1.8.4
ExtContactDeleteTag 删除企业客户标签 企业可通过此接口删除客户标签库中的标签,或删除整个标签组。 请求方式: POST(HTTP) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/externalcontact/del_corp_tag?access_token=ACCESS_TOKEN
func ExtContactEditStrategyTag ¶ added in v1.8.4
func ExtContactEditStrategyTag(corp *token.Api, tag *structs.EditTagReq) error
ExtContactEditStrategyTag 编辑指定规则组下的企业客户标签 企业可通过此接口编辑指定规则组下的客户标签/标签组的名称或次序值,但不可重新指定标签/标签组所属规则组。 请求方式: POST(HTTP) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/externalcontact/edit_strategy_tag?access_token=ACCESS_TOKEN
func ExtContactEditTag ¶ added in v1.8.4
func ExtContactEditTag(corp *token.Api, req *structs.EditTagReq) error
ExtContactEditTag 编辑企业客户标签 企业可通过此接口编辑客户标签/标签组的名称或次序值。 请求方式: POST(HTTP) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/externalcontact/edit_corp_tag?access_token=ACCESS_TOKEN
func ExtContactFollowUserList ¶ added in v1.8.4
ExtContactFollowUserList 获取配置了客户联系功能的成员列表 企业和第三方服务商可通过此接口获取配置了客户联系功能的成员列表。 请求方式:GET(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get_follow_user_list?access_token=ACCESS_TOKEN
func ExtContactGetDetail ¶ added in v1.8.6
func ExtContactGetDetail(corp *token.Api, externalUserid string, cursor string) (*structs.ExternalContactDetail, string, error)
ExtContactGetDetail 获取客户详情 企业可通过此接口,根据外部联系人的userid(如何获取?),拉取客户详情。 请求方式:GET(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get?access_token=ACCESS_TOKEN&external_userid=EXTERNAL_USERID&cursor=CURSOR
func ExtContactGetGroupMsgList ¶ added in v1.8.4
func ExtContactGetGroupMsgList(corp *token.Api, req *structs.GroupMsgReq) ([]*structs.GroupMsg, string, error)
ExtContactGetGroupMsgList 获取群发记录列表 企业和第三方应用可通过此接口获取企业与成员的群发记录。 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get_groupmsg_list_v2?access_token=ACCESS_TOKEN
func ExtContactGetList ¶ added in v1.8.4
ExtContactGetList 获取外部联系人列表 企业可通过此接口获取指定成员添加的客户列表。客户是指配置了客户联系功能的成员所添加的外部联系人。
func ExtContactGetMomentList ¶ added in v1.8.4
func ExtContactGetMomentList(corp *token.Api, req structs.MomentListReq) (*structs.MomentListResp, error)
ExtContactGetMomentList 获取企业全部的发表列表
func ExtContactGetMomentTaskResult ¶ added in v1.8.4
func ExtContactGetMomentTaskResult(corp *token.Api, jobId string) (*structs.MomentTaskResult, error)
ExtContactGetMomentTaskResult 获取任务创建结果 请求方式:GET(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get_moment_task_result?access_token=ACCESS_TOKEN
func ExtContactGetNewExternalUserId ¶ added in v1.8.4
func ExtContactGetNewExternalUserId(corp *token.Api, externalUseridList []string) ([]*structs.NewExternalUserid, error)
ExtContactGetNewExternalUserId external_userid的转换 https://developer.work.weixin.qq.com/document/path/95435 将企业主体下的external_userid转换为服务商主体下的external_userid。 转换客户external_userid 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get_new_external_userid?access_token=ACCESS_TOKEN
func ExtContactGetTagList ¶ added in v1.8.4
func ExtContactGetTagList(corp *token.Api, tags []string, groups []string) ([]*structs.TagGroup, error)
ExtContactGetTagList 获取企业标签库 企业可通过此接口获取企业客户标签详情。 请求方式: POST(HTTP) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get_corp_tag_list?access_token=ACCESS_TOKEN
func ExtContactGroupDetail ¶ added in v1.8.4
func ExtContactGroupDetail(corp *token.Api, chatId string, needName int) (*structs.GroupChatDetail, error)
ExtContactGroupDetail 获取客户群详情 通过客户群ID,获取详情。包括群名、群成员列表、群成员入群时间、入群方式。(客户群是由具有客户群使用权限的成员创建的外部群) 需注意的是,如果发生群信息变动,会立即收到群变更事件,但是部分信息是异步处理,可能需要等一段时间调此接口才能得到最新结果 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/externalcontact/groupchat/get?access_token=ACCESS_TOKEN
func ExtContactGroupList ¶ added in v1.8.4
func ExtContactGroupList(corp *token.Api, req *structs.ExternalGroupListReq) ([]*structs.GroupChat, string, error)
ExtContactGroupList 获取客户群列表 该接口用于获取配置过客户群管理的客户群列表。 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/externalcontact/groupchat/list?access_token=ACCESS_TOKEN
func ExtContactGroupNewExternalUserId ¶ added in v1.8.4
func ExtContactGroupNewExternalUserId(corp *token.Api, chatId string, externalUseridList []string) ([]*structs.NewExternalUserid, error)
ExtContactGroupNewExternalUserId 转换客户群成员external_userid 转换客户external_userid接口不支持客户群的场景,如果需要转换客户群中无好友关系的群成员external_userid,需要调用本接口,调用时需要传入客户群的chat_id。 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/externalcontact/groupchat/get_new_external_userid?access_token=ACCESS_TOKEN
func ExtContactMarkTag ¶ added in v1.8.4
func ExtContactMarkTag(corp *token.Api, tags *structs.MarkTagReq) error
ExtContactMarkTag 编辑客户企业标签 企业可通过此接口为指定成员的客户添加上由企业统一配置的标签。 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/externalcontact/mark_tag?access_token=ACCESS_TOKEN
func ExtContactOpenGroupIdToChatId ¶ added in v1.8.4
ExtContactOpenGroupIdToChatId 客户群opengid转换 用户在微信里的客户群里打开小程序时,某些场景下可以获取到群的opengid,如果该群是企业微信的客户群,则企业或第三方可以调用此接口将一个opengid转换为客户群chat_id 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/externalcontact/opengid_to_chatid?access_token=ACCESS_TOKEN
func ExtContactRemark ¶ added in v1.8.4
func ExtContactRemark(corp *token.Api, remark *structs.ExternalRemark) error
ExtContactRemark 修改客户备注信息 企业可通过此接口修改指定用户添加的客户的备注信息。 请求方式: POST(HTTP) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/externalcontact/remark?access_token=ACCESS_TOKEN
func ExtContactServiceToExternalUserId ¶ added in v1.8.4
ExtContactServiceToExternalUserId 代开发应用external_userid转换 企业同时授权了服务商的第三方应用与代开发应用,服务商可使用该接口将代开发应用获取到的external_userid转换为第三方应用的external_userid, 从而进行关联映射。 若代开发自建应用已升级(升级说明见 代开发应用安全性升级),则获取到的external_userid与第三方应用一致,故无须调用该接口。 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/externalcontact/to_service_external_userid?access_token=ACCESS_TOKEN
func ExtContactStrategyTagList ¶ added in v1.8.4
func ExtContactStrategyTagList(corp *token.Api, tags *structs.TagId, strategyId string) ([]*structs.TagGroup, error)
ExtContactStrategyTagList 获取指定规则组下的企业客户标签 企业可通过此接口获取某个规则组内的企业客户标签详情。 请求方式: POST(HTTP) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get_strategy_tag_list?access_token=ACCESS_TOKEN
func ExtContactUnionIdToExternalUserId3rd ¶ added in v1.8.4
func ExtContactUnionIdToExternalUserId3rd(corp *token.Api, unionid, openId string) ([]*structs.ExternalUserIdInfo, error)
ExtContactUnionIdToExternalUserId3rd 第三方主体unionid转换为第三方external_userid 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/externalcontact/unionid_to_external_userid_3rd?suite_access_token=ACCESS_TOKEN
func ExtContactUnionIdToExternalUserid ¶ added in v1.8.4
ExtContactUnionIdToExternalUserid 企业主体unionid转换为第三方external_userid 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/externalcontact/unionid_to_external_userid?access_token=ACCESS_TOKEN
func GetCorpService ¶ added in v1.0.28
func GetJoinQrcode ¶ added in v1.0.49
GetJoinQrcode 获取加入企业二维码 支持企业用户获取实时成员加入二维码。 size_type 否 qrcode尺寸类型,1: 171 x 171; 2: 399 x 399; 3: 741 x 741; 4: 2052 x 2052 请求方式:GET(HTTPS) 请求地址: https://qyapi.weixin.qq.com/cgi-bin/corp/get_join_qrcode?access_token=ACCESS_TOKEN&size_type=SIZE_TYPE
func GetMsgAuditService ¶ added in v1.0.54
func GetProviderService ¶ added in v1.0.28
func GetService ¶ added in v1.0.28
func GetSuiteService ¶ added in v1.0.28
func IDCApplyMassCallTicket ¶ added in v1.8.12
func IDCApplyMassCallTicket(api *token.Api, req ExtToPendingId) (string, error)
IDCApplyMassCallTicket 获取接口高频调用凭据 权限说明: 仅限授权三个月内的企业获取,且每个企业最多仅能获取一次 该凭据获取成功后,有效期为7天,请在7天内完成企业的初始化操作 使用该凭据可以不受业务频率限制,但是依然受到基础频率限制 请求方式:GET(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/corp/apply_mass_call_ticket?access_token=ACCESS_TOKEN
func ImportBatchReplaceDepart ¶ added in v1.8.4
ImportBatchReplaceDepart 全量覆盖部门 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/batch/replaceparty?access_token=ACCESS_TOKEN
func ImportBatchReplaceUser ¶ added in v1.8.4
ImportBatchReplaceUser 全量覆盖成员 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/batch/replaceuser?access_token=ACCESS_TOKEN
func ImportBatchResult ¶ added in v1.8.4
ImportBatchResult 获取异步任务结果 请求方式:GET(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/batch/getresult?access_token=ACCESS_TOKEN&jobid=JOBID
func ImportBatchSYncUser ¶ added in v1.8.4
ImportBatchSYncUser 增量更新成员 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/batch/syncuser?access_token=ACCESS_TOKEN
func IsTokenExpired ¶
func MACheckRoomAgree ¶ added in v1.0.54
MACheckRoomAgree 群聊 请求地址:https://qyapi.weixin.qq.com/cgi-bin/msgaudit/check_room_agree?access_token=ACCESS_TOKEN 请求方式:POST(HTTPS)
func MACheckSingleAgree ¶ added in v1.0.54
MACheckSingleAgree 目前一次请求只支持最多100个查询条目 最后更新:2021/04/29 企业可通过下述接口,获取会话中外部成员的同意情况 单聊请求地址:https://qyapi.weixin.qq.com/cgi-bin/msgaudit/check_single_agree?access_token=ACCESS_TOKEN 请求方式:POST(HTTPS)
func MAGetGroupChat ¶ added in v1.0.54
MAGetGroupChat 获取会话内容存档内部群信息 最后更新:2021/01/07 企业可通过此接口,获取会话内容存档本企业的内部群信息,包括群名称、群主id、公告、群创建时间以及所有群成员的id与加入时间。 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/msgaudit/groupchat/get?access_token=ACCESS_TOKEN
func MAGetPermitUserList ¶ added in v1.0.54
MAGetPermitUserList 获取会话内容存档开启成员列表 最后更新:2020/08/27 企业可通过此接口,获取企业开启会话内容存档的成员列表 ty: 拉取对应版本的开启成员列表。1表示办公版;2表示服务版;3表示企业版。非必填,不填写的时候返回全量成员列表。 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/msgaudit/get_permit_user_list?access_token=ACCESS_TOKEN
func MigrateToCustomizedApp ¶ added in v1.0.0
MigrateToCustomizedApp 自建应用迁移成代开发自建应用 该API可以将企业的自建应用关联到服务商的代开发应用模版上,从而将自建应用转换成代开发应用。测试企业的任意自建应用均可调用该接口;若非测试企业,则仅服务商管理端“历史应用迁移”列表中的应用可调用。 请求方式:POST(HTTPS) 请求地址: https://qyapi.weixin.qq.com/cgi-bin/agent/migrate_to_customized_app?access_token=ACCESS_TOKEN
func NewMessage ¶
func Notify ¶ added in v1.8.4
func Notify(option *config.Options, content interface{}, call FillContentCallback) error
func ProviderTokenUrl ¶ added in v1.0.19
func SendMessage ¶
SendMessage 发送应用消息,群聊消息,客户欢迎语
func SuiteTokenUrl ¶ added in v1.0.19
func TAGAddUser ¶ added in v1.0.35
TAGAddUser 增加标签成员 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/tag/addtagusers?access_token=ACCESS_TOKEN
func TAGCreate ¶ added in v1.0.35
TAGCreate 创建标签 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/tag/create?access_token=ACCESS_TOKEN
func TAGDelete ¶ added in v1.0.35
TAGDelete 删除标签 请求方式:GET(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/tag/delete?access_token=ACCESS_TOKEN&tagid=TAGID
func TAGDeleteUser ¶ added in v1.0.35
TAGDeleteUser 删除标签成员 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/tag/deltagusers?access_token=ACCESS_TOKEN
func TAGUpdate ¶ added in v1.0.35
TAGUpdate 更新标签名字 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/tag/update?access_token=ACCESS_TOKEN
func UserBatchDelete ¶ added in v1.8.4
UserBatchDelete 批量删除成员 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/user/batchdelete?access_token=ACCESS_TOKEN
func UserCheckMemberAuth ¶ added in v1.8.4
UserCheckMemberAuth 查询成员用户是否已授权 当企业当前授权模式为成员授权时,可调用该接口查询成员用户是否已授权 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/user/check_member_auth?access_token=ACCESS_TOKEN
func UserCreate ¶ added in v1.8.4
UserCreate 创建成员 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/user/create?access_token=ACCESS_TOKEN
func UserDelete ¶ added in v1.8.4
UserDelete 删除成员 请求方式:GET(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/user/delete?access_token=ACCESS_TOKEN&userid=USERID
func UserGetByEmail ¶ added in v1.8.4
UserGetByEmail 邮箱获取userid 通过邮箱获取其所对应的userid。 emailType 邮箱类型:1-企业邮箱(默认);2-个人邮箱 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/user/get_userid_by_email?access_token=ACCESS_TOKEN
func UserGetByMobile ¶ added in v1.8.4
UserGetByMobile 手机号获取userid 通过手机号获取其所对应的userid。 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/user/getuserid?access_token=ACCESS_TOKEN
func UserGetByUserId ¶ added in v1.8.4
UserGetByUserId 读取成员 应用只能获取可见范围内的成员信息,且每种应用获取的字段有所不同,在返回结果说明中会逐个说明。企业通讯录安全特别重要,企业微信将持续升级加固通讯录接口的安全机制,以下是关键的变更点: 从2022年6月20号20点开始,除通讯录同步以外的基础应用(如客户联系、微信客服、会话存档、日程等),以及新创建的自建应用与代开发应用,调用该接口时,不再返回以下字段:头像、性别、手机、邮箱、企业邮箱、员工个人二维码、地址,应用需要通过oauth2手工授权的方式获取管理员与员工本人授权的字段。 【重要】从2022年8月15日10点开始,“企业管理后台 - 管理工具 - 通讯录同步”的新增IP将不能再调用此接口,企业可通过「获取成员ID列表」和「获取部门ID列表」接口获取userid和部门ID列表。查看调整详情。 请求方式:GET(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN&userid=USERID
func UserGetDetailByDepartId ¶ added in v1.8.4
UserGetDetailByDepartId 获取部门成员详情 应用只能获取可见范围内的成员信息,且每种应用获取的字段有所不同,在返回结果说明中会逐个说明。企业通讯录安全特别重要,企业微信持续升级加固通讯录接口的安全机制,以下是关键的变更点: 从2022年6月20号20点开始,除通讯录同步以外的基础应用(如客户联系、微信客服、会话存档、日程等),以及新创建的自建应用与代开发应用,调用该接口时,不再返回以下字段:头像、性别、手机、邮箱、企业邮箱、员工个人二维码、地址,应用需要通过oauth2手工授权的方式获取管理员与员工本人授权的字段。 【重要】从2022年8月15日10点开始,“企业管理后台 - 管理工具 - 通讯录同步”的新增IP将不能再调用此接口,企业可通过「获取成员ID列表」和「获取部门ID列表」接口获取userid和部门ID列表。查看调整详情。 请求方式:GET(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/user/list?access_token=ACCESS_TOKEN&department_id=DEPARTMENT_ID
func UserGetListId ¶ added in v1.8.4
UserGetListId 获取成员ID列表 获取企业成员的userid与对应的部门ID列表,预计于2022年8月8号发布。若需要获取其他字段,参见「适配建议」。 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/user/list_id?access_token=ACCESS_TOKEN
func UserGetSimpleByDepartId ¶ added in v1.8.4
UserGetSimpleByDepartId 获取部门成员 企业通讯录安全特别重要,企业微信将持续升级加固通讯录接口的安全机制,以下是关键的变更点: 【重要】从2022年8月15日10点开始,“企业管理后台 - 管理工具 - 通讯录同步”的新增IP将不能再调用此接口,企业可通过「获取成员ID列表」和「获取部门ID列表」接口获取userid和部门ID列表。查看调整详情。 请求方式:GET(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/user/simplelist?access_token=ACCESS_TOKEN&department_id=DEPARTMENT_ID
func UserMemberAuthList ¶ added in v1.8.4
func UserMemberAuthList(api *token.Api, cursor string, limit int) (*structs.MemberAuthResult, error)
UserMemberAuthList 获取成员授权列表 当企业当前授权模式为成员授权时,可调用该接口获取成员授权列表。 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/user/list_member_auth?access_token=ACCESS_TOKEN
func UserSelectTicket ¶ added in v1.8.4
UserSelectTicket 获取选人ticket对应的用户 当企业以成员授权的方式安装了第三方应用,成员在企业微信终端通过选人jsapi选择通讯录,应用获取到selectedTicket后,可调用该接口获取SelectedTicket对应的用户open_userid列表。 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/user/list_selected_ticket_user?access_token=ACCESS_TOKEN
func UserUpdate ¶ added in v1.8.4
UserUpdate 更新成员 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/user/update?access_token=ACCESS_TOKEN
func UserUserId2OpenId ¶ added in v1.8.4
UserUserId2OpenId userid转openid 该接口使用场景为企业支付,在使用企业红包和向员工付款时,需要自行将企业微信的userid转成openid。 注:需要成员使用微信登录企业微信或者关注微信插件(原企业号)才能转成openid; 如果是外部联系人,请使用外部联系人openid转换转换openid 请求方式:POST(HTTPS) 请求地址: https://qyapi.weixin.qq.com/cgi-bin/user/convert_to_openid?access_token=ACCESS_TOKEN
Types ¶
type AgentBase ¶ added in v1.0.23
type AgentDetail ¶ added in v1.0.23
type AgentDetail struct { AgentBase Description string `json:"description"` AllowUserInfos AllowUserInfos `json:"allow_userinfos"` AllowPartys AllowPartys `json:"allow_partys"` AllowTags AllowTags `json:"allow_tags"` Close int `json:"close"` RedirectDomain string `json:"redirect_domain"` ReportLocationFlag int `json:"report_location_flag"` Isreportenter int `json:"isreportenter"` HomeUrl string `json:"home_url"` CustomizedPublishStatus int `json:"customized_publish_status"` }
type AllowPartys ¶ added in v1.0.23
type AllowPartys struct {
Partyid []int `json:"partyid"`
}
type AllowUserInfos ¶ added in v1.2.9
type AllowUserInfos struct {
User []AllowUser `json:"user"`
}
type ExtToPendingId ¶ added in v1.8.12
type ExtToPendingIdResult ¶ added in v1.8.12
type ExtToPendingIdResult struct { PendingId string `json:"pending_id"` ExternalUserid string `json:"external_userid"` }
func IDCExternalUserIdToPendingId ¶ added in v1.8.12
func IDCExternalUserIdToPendingId(api *token.Api, req ExtToPendingId) ([]ExtToPendingIdResult, error)
IDCExternalUserIdToPendingId external_userid查询pending_id 该接口可用于当一个微信用户成为企业客户前已经使用过服务商服务(服务商侧曾经调用过unionid转换为第三方external_userid)的场景。 本接口获取到的pending_id可以维持unionid和external_userid的关联关系。 pending_id有效期为90天,超过有效期之后,将无法通过该接口将external_userid换取对应的pending_id。 仅认证企业可调用 该客户的跟进人或其所在客户群群主必须在应用的可见范围之内 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/idconvert/batch/external_userid_to_pending_id?access_token=ACCESS_TOKEN
type FillContentCallback ¶ added in v1.8.4
type KfIDResult ¶ added in v1.8.12
type KfIDResult struct { Items []struct { TmpExternalUserid string `json:"open_kfid"` ExternalUserid string `json:"new_open_kfid"` } `json:"items"` InvalidKfIdList []string `json:"invalid_open_kfid_list"` }
func IDCKfId ¶ added in v1.8.12
func IDCKfId(api *token.Api, id []string) (*KfIDResult, error)
IDCKfId 微信客服ID的转换 最后更新:2022/09/21 将企业主体下的微信客服ID转换成服务商主体下的微信客服ID。 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/idconvert/open_kfid?access_token=ACCESS_TOKEN
type Tag ¶ added in v1.0.35
func TAGGetList ¶ added in v1.0.35
TAGGetList 获取标签列表 请求方式:GET(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/tag/list?access_token=ACCESS_TOKEN
type TagIDResult ¶ added in v1.8.12
type TagIDResult struct { Items []struct { TmpExternalUserid string `json:"external_tagid"` ExternalUserid string `json:"open_external_tagid"` } `json:"items"` InvalidTagIdList []string `json:"invalid_external_tagid_list"` }
func IDCTagId ¶ added in v1.8.12
func IDCTagId(api *token.Api, tagId []string) (*TagIDResult, error)
IDCTagId 客户标签ID的转换 最后更新:2023/05/19 将企业主体下的客户标签ID(含标签组ID)转换成服务商主体下的客户标签ID。最多不超过1000个 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/idconvert/external_tagid?access_token=ACCESS_TOKEN
type TmpExternalUser ¶ added in v1.8.12
type TmpExternalUserResult ¶ added in v1.8.12
type TmpExternalUserResult struct { Results []struct { TmpExternalUserid string `json:"tmp_external_userid"` ExternalUserid string `json:"external_userid,omitempty"` CorpId string `json:"corpid,omitempty"` UserId string `json:"userid,omitempty"` } `json:"results"` InvalidTmpExternalUseridList []string `json:"invalid_tmp_external_userid_list"` }
TmpExternalUserResult results[].tmp_external_userid string 输入的tmp_external_userid results[].external_userid string 转换后的userid,user_type为1时返回 results[].corpid string userid对应的corpid,user_type为2、3、4时返回 results[].userid string 转换后的userid,user_type为2、3、4时返回 invalid_tmp_external_userid_list string[] 无法转换的tmp_external_userid。可能非法或没有权限
func IDCTmpExternalUserId ¶ added in v1.8.12
func IDCTmpExternalUserId(api *token.Api, req TmpExternalUser) (*TmpExternalUserResult, error)
IDCTmpExternalUserId tmp_external_userid的转换 将应用获取的外部用户临时idtmp_external_userid,转换为external_userid。
支持将以下业务类型(business_type)对应接口获取到的tmp_external_userid进行转换:
业务类型 描述 相关接口 1 会议 获取会议详情 2 收集表 收集表的统计信息查询 读取收集表答案 支持对以下用户类型(user_type)进行转换:
用户类型 描述 转换范围 1 客户 应用可见范围内,配置了客户联系功能的企业成员所添加的外部联系人 2 企业互联 共享应用配置共享范围内的成员 3 上下游 共享应用配置共享范围内的成员 4 互联企业(圈子) 管理后台配置的应用可见范围内的成员
请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/idconvert/convert_tmp_external_userid?access_token=ACCESS_TOKEN
type UnionIdToResult ¶ added in v1.8.12
type UnionIdToResult struct { ExternalUserId string `json:"external_userid"` PendingId string `json:"pending_id"` }
func IDCUnionIdToExternalUserId ¶ added in v1.8.12
func IDCUnionIdToExternalUserId(api *token.Api, req UnionIdTo) (*UnionIdToResult, error)
IDCUnionIdToExternalUserId unionid转换为第三方external_userid 当微信用户进入服务商的小程序或公众号时,服务商可通过此接口,将微信客户的unionid转为第三方主体的external_userid,若该微信用户尚未成为企业的客户,则返回pending_id。 小程序或公众号的主体名称可以是企业的,也可以是服务商的。 该接口有调用频率限制,当subject_type为0时,按企业作如下的限制:10万次/小时、48万次/天、750万次/月;(注意这里是所有服务商共用企业额度的) 当subject_type为1时,按服务商作如下的限制:10万次/小时、48万次/天、750万次/月。 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/idconvert/unionid_to_external_userid?access_token=ACCESS_TOKEN