workwx

package module
v1.0.0-alpha.2....-0fdc9a7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2021 License: MIT Imports: 19 Imported by: 0

README

go-workwx

Travis Build Status Go Report Card GoDoc

go
import (
    "github.com/xen0n/go-workwx" // package workwx
)

A Work Weixin (a.k.a. Wechat Work) client SDK for Golang, that happens to be battle-tested and pretty serious about its types.

In production since late 2018, pushing all kinds of notifications and alerts in at least 2 of Qiniu's internal systems.

一个 Golang 企业微信客户端 SDK;碰巧在生产环境试炼过,还对类型很严肃。

自 2018 年末以来,在七牛至少 2 个内部系统运转至今,推送各种通知、告警。

English translation TODO for now, as the service covered here is not available outside of China (AFAIK).

Why another wheel?

工作中需要用 Go 实现一个简单的消息推送,想着找个开源库算了,然而现有唯一的开源企业微信 Golang SDK 代码质量不佳。只好自己写一个。

Update: 自从这个库写出来,已经过了很久;现在(2019.08)已经有三四个同类项目了。 不过看了看这些“竞品”,发现自己这个库的类型设计、公开接口、access token 处理等方面还不赖。 为什么人们总是喜欢写死请求 Host、用全局量、为拆包而拆包甚至不惜公开内部方法呢?

Features

  • 支持最近 3 个 Go 版本
  • 包名短
  • 支持覆盖 API Host,用于自己拦一层网关、临时调试等等奇葩需求
  • 支持使用自定义 http.Client
  • access token 处理靠谱
    • 你可以直接就做 API 调用,会自动请求 access token
    • 你也可以一行代码起一个后台 access token 刷新 goroutine
    • 自带指数退避重试
  • 严肃对待类型、公开接口
    • 公开暴露接口最小化,两步构造出 WorkwxApp 对象,然后直接用
    • 刻意不暴露企业微信原始接口请求、响应类型
    • 后续可能会做一个 lowlevel 包暴露裸的 API 接口,但很可能不做
    • 不为多态而多态,宁可 SDK 内部重复代码,也保证一个接口一类动作,下游用户 static dispatch
    • 个别数据模型做了调整甚至重做(如 UserInfoRecipient),以鼓励 idiomatic Go 风格
    • 几乎不会越俎代庖,一言不合 panic现存的少数一些情况都是要修掉的。
  • 自带一个 workwxctl 命令行小工具帮助调试
    • 用起来不爽提 issue 让我知道你在想啥

详情看 godoc 文档,还提供 Examples 小段代码可以参考。

Supported APIs

  • 通讯录管理 (部分支持,见下) <<<<<<< HEAD
  • 外部联系人管理 =======
  • 客户联系

upstream/develop

  • 应用管理
  • 消息发送 (除修改群聊会话外全部支持)
  • 消息接收 (接口尚不稳定,极有可能做出不兼容改动,先不要用)
  • 素材管理 (支持上传, 见下)
  • OA
  • 会话内容存档
  • 企业微信登录接口 (code2Session)
通讯录管理 API
  • 成员管理
    • 创建成员
    • 读取成员 NOTE: 成员对外信息暂未实现
    • 更新成员
    • 删除成员
    • 批量删除成员
    • 获取部门成员
    • 获取部门成员详情
    • userid与openid互换
    • 二次验证
    • 邀请成员
  • 部门管理
    • 创建部门
    • 更新部门
    • 删除部门
    • 获取部门列表
  • 标签管理
    • 创建标签
    • 更新标签名字
    • 删除标签
    • 获取标签成员
    • 增加标签成员
    • 删除标签成员
    • 获取标签列表
  • 异步批量接口
    • 增量更新成员
    • 全量覆盖成员
    • 全量覆盖部门
    • 获取异步任务结果
  • 通讯录回调通知
    • 成员变更通知
    • 部门变更通知
    • 标签变更通知
    • 异步任务完成通知
<<<<<<< HEAD 外部联系人管理 API ======= 客户联系 API >>>>>>> upstream/develop
  • 成员对外信息
  • 客户管理
    • 获取客户列表
    • 获取客户详情 <<<<<<< HEAD =======
    • 批量获取客户详情

upstream/develop - [x] 修改客户备注信息

  • 客户标签管理
    • 管理企业标签
    • 编辑客户企业标签
  • 客户分配
    • 获取离职成员列表
    • 分配在职或离职成员的客户
    • 查询客户接替结果
    • 分配离职成员的客户群
  • 变更回调通知
    • 添加企业客户事件
    • 编辑企业客户事件
    • 外部联系人免验证添加成员事件
    • 删除企业客户事件
    • 删除跟进成员事件
    • 客户接替失败事件
    • 客户群变更事件
身份验证 API
  • 获取访问用户身份
应用管理 API
  • 获取应用
  • 设置应用
  • 自定义菜单
    • 创建菜单
    • 获取菜单
    • 删除菜单
消息发送 API
  • 发送应用消息
  • 接收消息
  • 发送消息到群聊会话
    • 创建群聊会话
    • 修改群聊会话
    • 获取群聊会话
    • 应用推送消息
消息类型
  • 文本消息
  • 图片消息
  • 语音消息
  • 视频消息
  • 文件消息
  • 文本卡片消息
  • 图文消息
  • 图文消息(mpnews)
  • markdown消息
  • 任务卡片消息
素材管理 API
  • 上传临时素材
  • 上传永久图片
  • 获取临时素材
  • 获取高清语音素材
OA API
  • 审批
    • 获取审批模板详情
    • 提交审批申请
    • 审批申请状态变化回调通知
    • 批量获取审批单号
    • 获取审批申请详情
    • 获取企业假期管理配置
    • 修改成员假期余额
会话内容存档 API
  • 获取会话内容存档开启成员列表
  • 获取会话同意情况
  • 客户同意进行聊天内容存档事件回调
  • 获取会话内容存档内部群信息

Notes

关于保密消息发送

Markdown 等类型消息目前不支持作为保密消息发送,强行发送会报错。 那么为何发送消息的方法还全部带着 isSafe 参数呢?

一方面,企业微信服务方完全可能在未来支持更多消息类型的保密发送,到时候不希望客户端代码重新编译; 另一方面,反正响应会报错,你也不会留着这种逻辑。因此不改了。

License

Documentation

Index

Examples

Constants

View Source
const (
	// MsgAuditAgreeStatusAgree 同意
	MsgAuditAgreeStatusAgree = "Agree"
	// MsgAuditAgreeStatusDisagree 不同意
	MsgAuditAgreeStatusDisagree = "Disagree"
	// MsgAuditAgreeStatusDefaultAgree 默认同意
	MsgAuditAgreeStatusDefaultAgree = "Default_Agree"
)
View Source
const DefaultQYAPIHost = "https://qyapi.weixin.qq.com"

DefaultQYAPIHost 默认企业微信 API Host

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchListExternalContactsResp

type BatchListExternalContactsResp struct {
	Result     []ExternalContactBatchInfo
	NextCursor string
}

BatchListExternalContactsResp 外部联系人信息

type ChangeType

type ChangeType string

ChangeType 变更类型

const ChangeTypeAddExternalContact ChangeType = "add_external_contact"

ChangeTypeAddExternalContact 添加企业客户事件

const ChangeTypeAddHalfExternalContact ChangeType = "add_half_external_contact"

ChangeTypeAddHalfExternalContact 外部联系人免验证添加成员事件

const ChangeTypeDelExternalContact ChangeType = "del_external_contact"

ChangeTypeDelExternalContact 删除企业客户事件

const ChangeTypeDelFollowUser ChangeType = "del_follow_user"

ChangeTypeDelFollowUser 删除跟进成员事件

const ChangeTypeEditExternalContact ChangeType = "edit_external_contact"

ChangeTypeEditExternalContact 编辑企业客户事件

const ChangeTypeTransferFail ChangeType = "transfer_fail"

ChangeTypeTransferFail 客户接替失败事件

type ChatInfo

type ChatInfo struct {
	// ChatID 群聊唯一标志
	ChatID string `json:"chatid"`
	// Name 群聊名
	Name string `json:"name"`
	// OwnerUserID 群主id
	OwnerUserID string `json:"owner"`
	// MemberUserIDs 群成员id列表
	MemberUserIDs []string `json:"userlist"`
}

ChatInfo 群聊信息

type CheckMsgAuditRoomAgreeInfo

type CheckMsgAuditRoomAgreeInfo struct {
	// StatusChangeTime 同意状态改变的具体时间
	StatusChangeTime time.Time
	// AgreeStatus 同意:”Agree”,不同意:”Disagree”,默认同意:”Default_Agree”
	AgreeStatus MsgAuditAgreeStatus
	// ExternalOpenID 群内外部联系人的externalopenid
	ExternalOpenID string
}

CheckMsgAuditRoomAgreeInfo 获取会话同意情况(群聊)同意信息

type CheckMsgAuditSingleAgreeInfo

type CheckMsgAuditSingleAgreeInfo struct {
	CheckMsgAuditSingleAgreeUserInfo
	// AgreeStatus 同意:”Agree”,不同意:”Disagree”,默认同意:”Default_Agree”
	AgreeStatus MsgAuditAgreeStatus
	// StatusChangeTime 同意状态改变的具体时间
	StatusChangeTime time.Time
}

CheckMsgAuditSingleAgreeInfo 获取会话同意情况(单聊)同意信息

type CheckMsgAuditSingleAgreeUserInfo

type CheckMsgAuditSingleAgreeUserInfo struct {
	// UserID 内部成员的userid
	UserID string `json:"userid"`
	// ExternalOpenID 外部成员的externalopenid
	ExternalOpenID string `json:"exteranalopenid"`
}

CheckMsgAuditSingleAgreeUserInfo 获取会话同意情况(单聊)内外成员

type CtorOption

type CtorOption interface {
	// contains filtered or unexported methods
}

CtorOption 客户端对象构造参数

func WithHTTPClient

func WithHTTPClient(client *http.Client) CtorOption

WithHTTPClient 使用给定的 http.Client 作为 HTTP 客户端

func WithQYAPIHost

func WithQYAPIHost(host string) CtorOption

WithQYAPIHost 覆盖默认企业微信 API 域名

type DeptInfo

type DeptInfo struct {
	// ID 部门 ID
	ID int64 `json:"id"`
	// Name 部门名称
	Name string `json:"name"`
	// ParentID 父亲部门id。根部门为1
	ParentID int64 `json:"parentid"`
	// Order 在父部门中的次序值。order值大的排序靠前。值范围是[0, 2^32)
	Order uint32 `json:"order"`
}

DeptInfo 部门信息

type EventAddExternalContact

type EventAddExternalContact interface {

	// GetUserID 企业服务人员的UserID
	GetUserID() string

	// GetExternalUserID 外部联系人的userid,注意不是企业成员的帐号
	GetExternalUserID() string

	// GetState 添加此用户的「联系我」方式配置的state参数,可用于识别添加此用户的渠道
	GetState() string

	// GetWelcomeCode 欢迎语code,可用于发送欢迎语
	GetWelcomeCode() string
	// contains filtered or unexported methods
}

EventAddExternalContact 添加企业客户事件的参数。

type EventAddHalfExternalContact

type EventAddHalfExternalContact interface {

	// GetUserID 企业服务人员的UserID
	GetUserID() string

	// GetExternalUserID 外部联系人的userid,注意不是企业成员的帐号
	GetExternalUserID() string

	// GetState 添加此用户的「联系我」方式配置的state参数,可用于识别添加此用户的渠道
	GetState() string
	// contains filtered or unexported methods
}

EventAddHalfExternalContact 外部联系人免验证添加成员事件。

type EventChangeExternalChat

type EventChangeExternalChat interface {

	// GetChatID 群ID
	GetChatID() string

	// GetToUserName 企业微信CorpID
	GetToUserName() string

	// GetFromUserName 此事件该值固定为sys,表示该消息由系统生成
	GetFromUserName() string

	// GetFailReason 接替失败的原因, customer_refused-客户拒绝, customer_limit_exceed-接替成员的客户数达到上限
	GetFailReason() string
	// contains filtered or unexported methods
}

EventChangeExternalChat 客户群变更事件

type EventDelExternalContact

type EventDelExternalContact interface {

	// GetUserID 企业服务人员的UserID
	GetUserID() string

	// GetExternalUserID 外部联系人的userid,注意不是企业成员的帐号
	GetExternalUserID() string
	// contains filtered or unexported methods
}

EventDelExternalContact 删除企业客户事件

type EventDelFollowUser

type EventDelFollowUser interface {

	// GetUserID 企业服务人员的UserID
	GetUserID() string

	// GetExternalUserID 外部联系人的userid,注意不是企业成员的帐号
	GetExternalUserID() string
	// contains filtered or unexported methods
}

EventDelFollowUser 删除跟进成员事件

type EventEditExternalContact

type EventEditExternalContact interface {

	// GetUserID 企业服务人员的UserID
	GetUserID() string

	// GetExternalUserID 外部联系人的userid,注意不是企业成员的帐号
	GetExternalUserID() string

	// GetState 添加此用户的「联系我」方式配置的state参数,可用于识别添加此用户的渠道
	GetState() string
	// contains filtered or unexported methods
}

EventEditExternalContact 编辑企业客户事件的参数。

type EventSysApprovalChange

type EventSysApprovalChange interface {

	// GetApprovalInfo 获取审批模板详情
	GetApprovalInfo() OAApprovalInfo
	// contains filtered or unexported methods
}

EventSysApprovalChange 审批申请状态变化回调通知

type EventTransferFail

type EventTransferFail interface {

	// GetUserID 企业服务人员的UserID
	GetUserID() string

	// GetExternalUserID 外部联系人的userid,注意不是企业成员的帐号
	GetExternalUserID() string

	// GetFailReason 接替失败的原因, customer_refused-客户拒绝, customer_limit_exceed-接替成员的客户数达到上限
	GetFailReason() string
	// contains filtered or unexported methods
}

EventTransferFail 客户接替失败事件

type EventType

type EventType string

EventType 事件类型

const EventTypeChangeExternalChat EventType = "change_external_chat"

EventTypeChangeExternalChat 客户群变更事件

const EventTypeChangeExternalContact EventType = "change_external_contact"

EventTypeChangeExternalContact 企业客户事件

const EventTypeSysApprovalChange EventType = "sys_approval_change"

EventTypeSysApprovalChange 审批申请状态变化回调通知

type ExternalAttr

type ExternalAttr struct {
	// Type 属性类型: 0-文本 1-网页 2-小程序
	Type int `json:"type"`
	// Name 属性名称: 需要先确保在管理端有创建该属性,否则会忽略
	Name string `json:"name"`
	// Text 文本类型的属性 ,type为0时必填
	Text ExternalAttrText `json:"text"`
	// Web 网页类型的属性,url和title字段要么同时为空表示清除该属性,要么同时不为空 ,type为1时必填
	Web ExternalAttrWeb `json:"web"`
	// Miniprogram 小程序类型的属性,appid和title字段要么同时为空表示清除改属性,要么同时不为空 ,type为2时必填
	Miniprogram ExternalAttrMiniprogram `json:"miniprogram"`
}

ExternalAttr 属性列表,目前支持文本、网页、小程序三种类型

type ExternalAttrMiniprogram

type ExternalAttrMiniprogram struct {
	// Appid 小程序appid,必须是有在本企业安装授权的小程序,否则会被忽略
	Appid string `json:"appid"`
	// Pagepath 小程序的页面路径
	Pagepath string `json:"pagepath"`
	// Title 企业对外简称,需从已认证的企业简称中选填。可在“我的企业”页中查看企业简称认证状态。
	Title string `json:"title"`
}

ExternalAttrMiniprogram 小程序类型的属性,appid和title字段要么同时为空表示清除改属性,要么同时不为空 ,type为2时必填

type ExternalAttrText

type ExternalAttrText struct {
	// Value 文本属性内容,长度限制12个UTF8字符
	Value string `json:"value"`
}

ExternalAttrText 文本类型的属性

type ExternalAttrWeb

type ExternalAttrWeb struct {
	// Url 网页的url,必须包含http或者https头
	Url string `json:"url"`
	// Title 网页的展示标题,长度限制12个UTF8字符
	Title string `json:"title"`
}

ExternalAttrWeb 网页类型的属性,url和title字段要么同时为空表示清除该属性,要么同时不为空 ,type为1时必填

type ExternalContact

type ExternalContact struct {
	// ExternalUserid 外部联系人的userid
	ExternalUserid string `json:"external_userid"`
	// Name 外部联系人的名称,如果外部联系人为微信用户,则返回外部联系人的名称为其微信昵称;如果外部联系人为企业微信用户,则会按照以下优先级顺序返回:此外部联系人或管理员设置的昵称、认证的实名和账号名称。
	Name string `json:"name"`
	// Position 外部联系人的职位,如果外部企业或用户选择隐藏职位,则不返回,仅当联系人类型是企业微信用户时有此字段
	Position string `json:"position"`
	// Avatar 外部联系人头像,第三方不可获取
	Avatar string `json:"avatar"`
	// CorpName 外部联系人所在企业的简称,仅当联系人类型是企业微信用户时有此字段
	CorpName string `json:"corp_name"`
	// Type 外部联系人的类型,1表示该外部联系人是微信用户,2表示该外部联系人是企业微信用户
	Type ExternalUserType `json:"type"`
	// Gender 外部联系人性别 0-未知 1-男性 2-女性
	Gender UserGender `json:"gender"`
	// Unionid 外部联系人在微信开放平台的唯一身份标识(微信unionid),通过此字段企业可将外部联系人与公众号/小程序用户关联起来。仅当联系人类型是微信用户,且企业或第三方服务商绑定了微信开发者ID有此字段。查看绑定方法 关于返回的unionid,如果是第三方应用调用该接口,则返回的unionid是该第三方服务商所关联的微信开放者帐号下的unionid。也就是说,同一个企业客户,企业自己调用,与第三方服务商调用,所返回的unionid不同;不同的服务商调用,所返回的unionid也不同。
	Unionid string `json:"unionid"`
	// ExternalProfile 成员对外信息
	ExternalProfile ExternalProfile `json:"external_profile"`
}

ExternalContact 外部联系人

type ExternalContactBatchInfo

type ExternalContactBatchInfo struct {
	ExternalContact ExternalContact `json:"external_contact"`
	FollowInfo      FollowInfo      `json:"follow_info"`
}

ExternalContactBatchInfo 外部联系人信息

type ExternalContactCorpTag

type ExternalContactCorpTag struct {
	// ID 标签id
	ID string `json:"id"`
	// Name 标签名称
	Name string `json:"name"`
	// CreateTime 标签创建时间
	CreateTime int `json:"create_time"`
	// Order 标签排序的次序值,order值大的排序靠前。有效的值范围是[0, 2^32)
	Order uint32 `json:"order"`
	// Deleted 标签是否已经被删除,只在指定tag_id进行查询时返回
	Deleted bool `json:"deleted"`
}

ExternalContactCorpTag 企业客户标签

type ExternalContactCorpTagGroup

type ExternalContactCorpTagGroup struct {
	// GroupID 标签组id
	GroupID string `json:"group_id"`
	// GroupName 标签组名称
	GroupName string `json:"group_name"`
	// CreateTime 标签组创建时间
	CreateTime int `json:"create_time"`
	// Order 标签组排序的次序值,order值大的排序靠前。有效的值范围是[0, 2^32)
	Order uint32 `json:"order"`
	// Deleted 标签组是否已经被删除,只在指定tag_id进行查询时返回
	Deleted bool `json:"deleted"`
	// Tag 标签组内的标签列表
	Tag []ExternalContactCorpTag `json:"tag"`
}

ExternalContactCorpTagGroup 企业客户标签

type ExternalContactGroupChatTransferFailed

type ExternalContactGroupChatTransferFailed struct {
	// ChatID 没能成功继承的群ID
	ChatID string `json:"chat_id"`
	// ErrCode 没能成功继承的群,错误码
	ErrCode int `json:"errcode"`
	// ErrMsg 没能成功继承的群,错误描述
	ErrMsg string `json:"errmsg"`
}

ExternalContactGroupChatTransferFailed 离职成员的群再分配失败

type ExternalContactInfo

type ExternalContactInfo struct {
	ExternalContact ExternalContact `json:"external_contact"`
	FollowUser      []FollowUser    `json:"follow_user"`
}

ExternalContactInfo 外部联系人信息

type ExternalContactMarkTag

type ExternalContactMarkTag struct {
	// UserID 添加外部联系人的userid
	UserID string `json:"userid"`
	// ExternalUserID 外部联系人userid
	ExternalUserID string `json:"external_userid"`
	// AddTag 要标记的标签列表
	AddTag []string `json:"add_tag"`
	// RemoveTag 要移除的标签列表
	RemoveTag []string `json:"remove_tag"`
}

ExternalContactMarkTag 企业标记客户标签

type ExternalContactRemark

type ExternalContactRemark struct {
	// Userid 企业成员的userid
	Userid string `json:"userid"`
	// ExternalUserid 外部联系人userid
	ExternalUserid string `json:"external_userid"`
	// Remark 此用户对外部联系人的备注,最多20个字符,remark,description,remark_company,remark_mobiles和remark_pic_mediaid不可同时为空。
	Remark string `json:"remark"`
	// Description 此用户对外部联系人的描述,最多150个字符
	Description string `json:"description"`
	// RemarkCompany 此用户对外部联系人备注的所属公司名称,最多20个字符,remark_company只在此外部联系人为微信用户时有效。
	RemarkCompany string `json:"remark_company"`
	// RemarkMobiles 此用户对外部联系人备注的手机号,如果填写了remark_mobiles,将会覆盖旧的备注手机号。如果要清除所有备注手机号,请在remark_mobiles填写一个空字符串(“”)。
	RemarkMobiles []string `json:"remark_mobiles"`
	// RemarkPicMediaid 备注图片的mediaid,remark_pic_mediaid可以通过素材管理接口获得。
	RemarkPicMediaid string `json:"remark_pic_mediaid"`
}

ExternalContactRemark 客户备注信息

type ExternalContactTransferResult

type ExternalContactTransferResult struct {
	// Status 接替状态, 1-接替完毕 2-等待接替 3-客户拒绝 4-接替成员客户达到上限 5-无接替记录
	Status ExternalContactTransferStatus
	// TakeoverTime 接替客户的时间,如果是等待接替状态,则为未来的自动接替时间
	TakeoverTime time.Time
}

ExternalContactTransferResult 客户接替结果

type ExternalContactTransferStatus

type ExternalContactTransferStatus uint8

ExternalContactTransferStatus 客户接替结果状态

const (
	// ExternalContactTransferStatusSuccess 1-接替完毕
	ExternalContactTransferStatusSuccess ExternalContactTransferStatus = 1
	// ExternalContactTransferStatusWait 2-等待接替
	ExternalContactTransferStatusWait ExternalContactTransferStatus = 2
	// ExternalContactTransferStatusRefused 3-客户拒绝
	ExternalContactTransferStatusRefused ExternalContactTransferStatus = 3
	// ExternalContactTransferStatusExhausted 4-接替成员客户达到上限
	ExternalContactTransferStatusExhausted ExternalContactTransferStatus = 4
	// ExternalContactTransferStatusNoData 5-无接替记录
	ExternalContactTransferStatusNoData ExternalContactTransferStatus = 5
)

type ExternalContactUnassigned

type ExternalContactUnassigned struct {
	// HandoverUserID 离职成员的userid
	HandoverUserID string
	// ExternalUserID 外部联系人userid
	ExternalUserID string
	// DemissionTime 成员离职时间
	DemissionTime time.Time
}

ExternalContactUnassigned 离职成员的客户

type ExternalContactUnassignedList

type ExternalContactUnassignedList struct {
	// Info 离职成员的客户
	Info []ExternalContactUnassigned `json:"info"`
	// IsLast 是否是最后一条记录
	IsLast bool `json:"is_last"`
	// NextCursor 分页查询游标,已经查完则返回空("")
	NextCursor string `json:"next_cursor"`
}

ExternalContactUnassignedList 离职成员的客户列表

type ExternalProfile

type ExternalProfile struct {
	// ExternalCorpName 企业简称
	ExternalCorpName string `json:"external_corp_name"`
	// ExternalAttr 属性列表,目前支持文本、网页、小程序三种类型
	ExternalAttr []ExternalAttr `json:"external_attr"`
}

ExternalProfile 成员对外信息

type ExternalUserType

type ExternalUserType int

ExternalUserType 外部联系人的类型

1表示该外部联系人是微信用户 2表示该外部联系人是企业微信用户

const (
	// ExternalUserTypeWeChat 微信用户
	ExternalUserTypeWeChat ExternalUserType = 1
	// ExternalUserTypeWorkWeChat 企业微信用户
	ExternalUserTypeWorkWeChat ExternalUserType = 2
)

type FollowInfo

type FollowInfo struct {
	//  添加了外部联系人的企业成员
	FollowUserInfo
	// TagID 该成员添加此外部联系人所打标签
	TagID []string `json:"tag_id"`
}

FollowInfo 企业成员客户跟进信息,可以参考获取客户详情,但标签信息只会返回企业标签的tag_id,个人标签将不再返回

type FollowUser

type FollowUser struct {
	// Userid 外部联系人的userid
	Userid string `json:"userid"`
	//  添加了外部联系人的企业成员
	FollowUserInfo
	// Tags 该成员添加此外部联系人所打标签
	Tags []FollowUserTag `json:"tags"`
}

FollowUser 添加了外部联系人的企业成员

type FollowUserAddWay

type FollowUserAddWay int

FollowUserAddWay 该成员添加此客户的来源

具体含义详见[来源定义](https://work.weixin.qq.com/api/doc/90000/90135/92114#13878/%E6%9D%A5%E6%BA%90%E5%AE%9A%E4%B9%89)

const (
	// 未知来源
	FollowUserAddWayUnknown FollowUserAddWay = 0
	// 扫描二维码
	FollowUserAddWayQRCode FollowUserAddWay = 1
	// 搜索手机号
	FollowUserAddWayMobile FollowUserAddWay = 2
	// 名片分享
	FollowUserAddWayCard FollowUserAddWay = 3
	// 群聊
	FollowUserAddWayGroupChat FollowUserAddWay = 4
	// 手机通讯录
	FollowUserAddWayAddressBook FollowUserAddWay = 5
	// 微信联系人
	FollowUserAddWayWeChatContact FollowUserAddWay = 6
	// 来自微信的添加好友申请
	FollowUserAddWayWeChatFriendApply FollowUserAddWay = 7
	// 安装第三方应用时自动添加的客服人员
	FollowUserAddWayThirdParty FollowUserAddWay = 8
	// 搜索邮箱
	FollowUserAddWayEmail FollowUserAddWay = 9
	// 内部成员共享
	FollowUserAddWayInternalShare FollowUserAddWay = 201
	// 管理员/负责人分配
	FollowUserAddWayAdmin FollowUserAddWay = 202
)

type FollowUserInfo

type FollowUserInfo struct {
	// UserID 外部联系人的userid
	UserID string `json:"userid"`
	// Remark 该成员对此外部联系人的备注
	Remark string `json:"remark"`
	// Description 该成员对此外部联系人的描述
	Description string `json:"description"`
	// Createtime 该成员添加此外部联系人的时间
	Createtime int `json:"createtime"`
	// Tags 该成员添加此外部联系人所打标签
	Tags []FollowUserTag `json:"tags"`
	// RemarkCorpName 该成员对此客户备注的企业名称
	RemarkCorpName string `json:"remark_corp_name"`
	// RemarkMobiles 该成员对此客户备注的手机号码,第三方不可获取
	RemarkMobiles []string `json:"remark_mobiles"`
	// AddWay 该成员添加此客户的来源
	AddWay FollowUserAddWay `json:"add_way"`
	// OperUserID 发起添加的userid,如果成员主动添加,为成员的userid;如果是客户主动添加,则为客户的外部联系人userid;如果是内部成员共享/管理员分配,则为对应的成员/管理员userid
	OperUserID string `json:"oper_userid"`
	// State 企业自定义的state参数,用于区分客户具体是通过哪个「联系我」添加,由企业通过创建「联系我」方式指定
	State string `json:"state"`
}

FollowUserInfo 添加了外部联系人的企业成员

type FollowUserTag

type FollowUserTag struct {
	// GroupName 该成员添加此外部联系人所打标签的分组名称(标签功能需要企业微信升级到2.7.5及以上版本)
	GroupName string `json:"group_name"`
	// TagName 该成员添加此外部联系人所打标签名称
	TagName string `json:"tag_name"`
	// Type 该成员添加此外部联系人所打标签类型, 1-企业设置, 2-用户自定义
	Type FollowUserTagType `json:"type"`
}

FollowUserTag 该成员添加此外部联系人所打标签

type FollowUserTagType

type FollowUserTagType int

FollowUserTagType 该成员添加此外部联系人所打标签类型

1-企业设置 2-用户自定义

const (
	// 企业设置
	FollowUserTagTypeWork FollowUserTagType = 1
	// 用户自定义
	FollowUserTagTypeUser FollowUserTagType = 2
)

type GetOAApprovalInfoReq

type GetOAApprovalInfoReq struct {
	// StartTime 审批单提交的时间范围,开始时间,UNix时间戳
	StartTime time.Time
	// EndTime 审批单提交的时间范围,结束时间,Unix时间戳
	EndTime time.Time
	// Cursor 分页查询游标,默认为0,后续使用返回的next_cursor进行分页拉取
	Cursor int
	// Size 一次请求拉取审批单数量,默认值为100,上限值为100
	Size uint32
	// Filters 筛选条件,可对批量拉取的审批申请设置约束条件,支持设置多个条件
	Filters []OAApprovalInfoFilter
}

GetOAApprovalInfoReq 批量获取审批单号请求

type HTTPHandler

type HTTPHandler struct {
	// contains filtered or unexported fields
}

func NewHTTPHandler

func NewHTTPHandler(
	token string,
	encodingAESKey string,
	rxMessageHandler RxMessageHandler,
) (*HTTPHandler, error)

func (*HTTPHandler) ServeHTTP

func (h *HTTPHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type ImageMessageExtras

type ImageMessageExtras interface {

	// GetPicURL 返回图片消息的图片链接 URL。
	GetPicURL() string

	// GetMediaID 返回图片消息的图片媒体文件 ID。
	//
	// 可以调用【获取媒体文件】接口拉取,仅三天内有效。
	GetMediaID() string
	// contains filtered or unexported methods
}

ImageMessageExtras 图片消息的参数。

type JSCodeSession

type JSCodeSession struct {
	CorpID     string `json:"corpid"`
	UserID     string `json:"userid"`
	SessionKey string `json:"session_key"`
}

JSCodeSession 临时登录凭证

type LinkMessageExtras

type LinkMessageExtras interface {

	// GetTitle 返回链接消息的标题。
	GetTitle() string

	// GetDescription 返回链接消息的描述。
	GetDescription() string

	// GetURL 返回链接消息的跳转 URL。
	GetURL() string

	// GetPicURL 返回链接消息的封面缩略图 URL。
	GetPicURL() string
	// contains filtered or unexported methods
}

LinkMessageExtras 链接消息的参数。

type LocationMessageExtras

type LocationMessageExtras interface {

	// GetLatitude 返回位置消息的纬度(角度值;北纬为正)。
	GetLatitude() float64

	// GetLongitude 返回位置消息的经度(角度值;东经为正)。
	GetLongitude() float64

	// GetScale 返回位置消息的地图缩放大小。
	GetScale() int

	// GetLabel 返回位置消息的地理位置信息。
	GetLabel() string
	// contains filtered or unexported methods
}

LocationMessageExtras 位置消息的参数。

type Media

type Media struct {
	// contains filtered or unexported fields
}

Media 欲上传的素材

NOTE: 由于 Go `mime/multipart` 包的实现细节原因, 暂时不开放 Content-Type 定制,全部传 `application/octet-stream`。 如有需求,请去 GitHub 提 issue。

func NewMediaFromBuffer

func NewMediaFromBuffer(filename string, buf []byte) (*Media, error)

NewMediaFromBuffer 从内存创建一个欲上传的素材对象

func NewMediaFromFile

func NewMediaFromFile(f *os.File) (*Media, error)

NewMediaFromFile 从操作系统级文件创建一个欲上传的素材对象

type MediaUploadResult

type MediaUploadResult struct {
	// Type 媒体文件类型,分别有图片(image)、语音(voice)、视频(video),普通文件(file)
	Type string
	// MediaID 媒体文件上传后获取的唯一标识,3天内有效
	MediaID string
	// CreatedAt 媒体文件上传时间戳
	CreatedAt time.Time
}

MediaUploadResult 临时素材上传结果

type MessageType

type MessageType string

MessageType 消息类型

const MessageTypeEvent MessageType = "event"

MessageTypeEvent 事件消息

const MessageTypeImage MessageType = "image"

MessageTypeImage 图片消息

const MessageTypeLink MessageType = "link"

MessageTypeLink 链接消息

const MessageTypeLocation MessageType = "location"

MessageTypeLocation 位置消息

const MessageTypeText MessageType = "text"

MessageTypeText 文本消息

const MessageTypeVideo MessageType = "video"

MessageTypeVideo 视频消息

const MessageTypeVoice MessageType = "voice"

MessageTypeVoice 语音消息

type MsgAuditAgreeStatus

type MsgAuditAgreeStatus string

MsgAuditAgreeStatus 会话中外部成员的同意状态

type MsgAuditEdition

type MsgAuditEdition uint8

MsgAuditEdition 会话内容存档版本

const (
	// MsgAuditEditionOffice 会话内容存档办公版
	MsgAuditEditionOffice MsgAuditEdition = 1
	// MsgAuditEditionService 会话内容存档服务版
	MsgAuditEditionService MsgAuditEdition = 2
	// MsgAuditEditionEnterprise 会话内容存档企业版
	MsgAuditEditionEnterprise MsgAuditEdition = 3
)

type MsgAuditGroupChat

type MsgAuditGroupChat struct {
	// Members roomid对应的群成员列表
	Members []MsgAuditGroupChatMember
	// RoomName roomid对应的群名称
	RoomName string
	// Creator roomid对应的群创建者,userid
	Creator string
	// RoomCreateTime roomid对应的群创建时间
	RoomCreateTime time.Time
	// Notice roomid对应的群公告
	Notice string
}

MsgAuditGroupChat 获取会话内容存档内部群信息

type MsgAuditGroupChatMember

type MsgAuditGroupChatMember struct {
	// MemberID roomid群成员的id,userid
	MemberID int
	// JoinTime roomid群成员的入群时间
	JoinTime time.Time
}

MsgAuditGroupChatMember 获取会话内容存档内部群成员

type OAApplyEvent

type OAApplyEvent struct {
	// CreatorUserID 申请人userid,此审批申请将以此员工身份提交,申请人需在应用可见范围内
	CreatorUserID string `json:"creator_userid"`
	// TemplateID 模板id。可在“获取审批申请详情”、“审批状态变化回调通知”中获得,也可在审批模板的模板编辑页面链接中获得。暂不支持通过接口提交[打卡补卡][调班]模板审批单。
	TemplateID string `json:"template_id"`
	// UseTemplateApprover 审批人模式:0-通过接口指定审批人、抄送人(此时approver、notifyer等参数可用); 1-使用此模板在管理后台设置的审批流程,支持条件审批。默认为0
	UseTemplateApprover uint8 `json:"use_template_approver"`
	// Approver 审批流程信息,用于指定审批申请的审批流程,支持单人审批、多人会签、多人或签,可能有多个审批节点,仅use_template_approver为0时生效。
	Approver []OAApprover `json:"approver"`
	// Notifier 抄送人节点userid列表,仅use_template_approver为0时生效。
	Notifier []string `json:"notifyer"`
	// NotifyType 抄送方式:1-提单时抄送(默认值); 2-单据通过后抄送;3-提单和单据通过后抄送。仅use_template_approver为0时生效。
	NotifyType *uint8 `json:"notify_type"`
	// ApplyData 审批申请数据,可定义审批申请中各个控件的值,其中必填项必须有值,选填项可为空,数据结构同“获取审批申请详情”接口返回值中同名参数“apply_data”
	ApplyData OAContents `json:"apply_data"`
	// SummaryList 摘要信息,用于显示在审批通知卡片、审批列表的摘要信息,最多3行
	SummaryList []OASummaryList `json:"summary_list"`
}

OAApplyEvent 提交审批申请

type OAApprovalDetail

type OAApprovalDetail struct {
	// SpNo 审批编号
	SpNo string `json:"sp_no"`
	// SpName 审批申请类型名称(审批模板名称)
	SpName string `json:"sp_name"`
	// SpStatus 申请单状态:1-审批中;2-已通过;3-已驳回;4-已撤销;6-通过后撤销;7-已删除;10-已支付
	SpStatus uint8 `json:"sp_status"`
	// TemplateID 审批模板id。可在“获取审批申请详情”、“审批状态变化回调通知”中获得,也可在审批模板的模板编辑页面链接中获得。
	TemplateID string `json:"template_id"`
	// ApplyTime 审批申请提交时间,Unix时间戳
	ApplyTime int `json:"apply_time"`
	// Applicant 申请人信息
	Applicant OAApprovalDetailApplicant `json:"applyer"`
	// SpRecord 审批流程信息,可能有多个审批节点。
	SpRecord []OAApprovalDetailSpRecord `json:"sp_record"`
	// Notifier 抄送信息,可能有多个抄送节点
	Notifier []OAApprovalDetailNotifier `json:"notifyer"`
	// ApplyData 审批申请数据
	ApplyData OAContents `json:"apply_data"`
	// Comments 审批申请备注信息,可能有多个备注节点
	Comments []OAApprovalDetailComment `json:"comments"`
}

OAApprovalDetail 审批申请详情

type OAApprovalDetailApplicant

type OAApprovalDetailApplicant struct {
	// UserID 申请人userid
	UserID string `json:"userid"`
	// PartyID 申请人所在部门id
	PartyID string `json:"partyid"`
}

OAApprovalDetailApplicant 审批申请详情申请人信息

type OAApprovalDetailComment

type OAApprovalDetailComment struct {
	// CommentUserInfo 备注人信息
	CommentUserInfo OAApprovalDetailCommentUserInfo `json:"commentUserInfo"`
	// CommentTime 备注提交时间戳,Unix时间戳
	CommentTime int `json:"commenttime"`
	// CommentTontent 备注文本内容
	CommentTontent string `json:"commentcontent"`
	// CommentID 备注id
	CommentID string `json:"commentid"`
	// MediaID 备注附件id,可能有多个,media_id具体使用请参考:文档-获取临时素材
	MediaID []string `json:"media_id"`
}

OAApprovalDetailComment 审批申请备注信息,可能有多个备注节点

type OAApprovalDetailCommentUserInfo

type OAApprovalDetailCommentUserInfo struct {
	// UserID 备注人userid
	UserID string `json:"userid"`
}

OAApprovalDetailCommentUserInfo 备注人信息

type OAApprovalDetailNotifier

type OAApprovalDetailNotifier struct {
	// UserID 节点抄送人userid
	UserID string `json:"userid"`
}

OAApprovalDetailNotifier 抄送信息,可能有多个抄送节点

type OAApprovalDetailSpRecord

type OAApprovalDetailSpRecord struct {
	// SpStatus 审批节点状态:1-审批中;2-已同意;3-已驳回;4-已转审
	SpStatus uint8 `json:"sp_status"`
	// ApproverAttr 节点审批方式:1-或签;2-会签
	ApproverAttr uint8 `json:"approverattr"`
	// Details 审批节点详情,一个审批节点有多个审批人
	Details []OAApprovalDetailSpRecordDetail `json:"details"`
}

OAApprovalDetailSpRecord 审批流程信息,可能有多个审批节点。

type OAApprovalDetailSpRecordDetail

type OAApprovalDetailSpRecordDetail struct {
	// Approver 分支审批人
	Approver OAApprovalDetailSpRecordDetailApprover `json:"approver"`
	// Speech 审批意见
	Speech string `json:"speech"`
	// SpStatus 分支审批人审批状态:1-审批中;2-已同意;3-已驳回;4-已转审
	SpStatus uint8 `json:"sp_status"`
	// SpTime 节点分支审批人审批操作时间戳,0表示未操作
	SpTime int `json:"sptime"`
	// MediaID 节点分支审批人审批意见附件,media_id具体使用请参考:文档-获取临时素材
	MediaID []string `json:"media_id"`
}

OAApprovalDetailSpRecordDetail 审批节点详情,一个审批节点有多个审批人

type OAApprovalDetailSpRecordDetailApprover

type OAApprovalDetailSpRecordDetailApprover struct {
	// UserID 分支审批人userid
	UserID string `json:"userid"`
}

OAApprovalDetailSpRecordDetailApprover 分支审批人

type OAApprovalInfo

type OAApprovalInfo struct {
	// SpNo 审批编号
	SpNo string `xml:"SpNo"`
	// SpName 审批申请类型名称(审批模板名称)
	SpName string `xml:"SpName"`
	// SpStatus 申请单状态:1-审批中;2-已通过;3-已驳回;4-已撤销;6-通过后撤销;7-已删除;10-已支付
	SpStatus string `xml:"SpStatus"`
	// TemplateID 审批模板id。可在“获取审批申请详情”、“审批状态变化回调通知”中获得,也可在审批模板的模板编辑页面链接中获得。
	TemplateID string `xml:"TemplateId"`
	// ApplyTime 审批申请提交时间,Unix时间戳
	ApplyTime string `xml:"ApplyTime"`
	// Applicant 申请人信息
	Applicant OAApprovalInfoApplicant `xml:"Applyer"`
	// SpRecord 审批流程信息,可能有多个审批节点。
	SpRecord []OAApprovalInfoSpRecord `xml:"SpRecord"`
	// Notifier 抄送信息,可能有多个抄送节点
	Notifier OAApprovalInfoNotifier `xml:"Notifyer"`
	// Comments 审批申请备注信息,可能有多个备注节点
	Comments []OAApprovalInfoComment `xml:"Comments"`
	// StatusChangeEvent 审批申请状态变化类型:1-提单;2-同意;3-驳回;4-转审;5-催办;6-撤销;8-通过后撤销;10-添加备注
	StatusChangeEvent string `xml:"StatuChangeEvent"`
}

OAApprovalInfo 审批申请状态变化回调通知

type OAApprovalInfoApplicant

type OAApprovalInfoApplicant struct {
	// UserID 申请人userid
	UserID string `xml:"UserId"`
	// Party 申请人所在部门pid
	Party string `xml:"Party"`
}

OAApprovalInfoApplicant 申请人信息

type OAApprovalInfoComment

type OAApprovalInfoComment struct {
	// CommentUserInfo 备注人信息
	CommentUserInfo OAApprovalInfoCommentUserInfo `xml:"CommentUserInfo"`
	// CommentTime 备注提交时间
	CommentTime string `xml:"CommentTime"`
	// CommentContent 备注文本内容
	CommentContent string `xml:"CommentContent"`
	// CommentID 备注id
	CommentID string `xml:"CommentId"`
	// Attach 备注意见附件,值是附件media_id具体使用请参考:文档-获取临时素材
	Attach []string `xml:"Attach"`
}

OAApprovalInfoComment 审批申请备注信息,可能有多个备注节点

type OAApprovalInfoCommentUserInfo

type OAApprovalInfoCommentUserInfo struct {
	// UserID 备注人userid
	UserID string `xml:"UserId"`
}

OAApprovalInfoCommentUserInfo 备注人信息

type OAApprovalInfoFilter

type OAApprovalInfoFilter struct {
	// Key 筛选类型,包括:template_id - 模板类型/模板id;creator - 申请人;department - 审批单提单者所在部门;sp_status - 审批状态。注意:仅“部门”支持同时配置多个筛选条件。不同类型的筛选条件之间为“与”的关系,同类型筛选条件之间为“或”的关系
	Key OAApprovalInfoFilterKey `json:"key"`
	// Value 筛选值,对应为:template_id - 模板id;creator - 申请人userid;department - 所在部门id;sp_status - 审批单状态(1-审批中;2-已通过;3-已驳回;4-已撤销;6-通过后撤销;7-已删除;10-已支付)
	Value string `json:"value"`
}

OAApprovalInfoFilter 备注人信息

type OAApprovalInfoFilterKey

type OAApprovalInfoFilterKey string

OAApprovalInfoFilterKey 拉取审批筛选类型

const OAApprovalInfoFilterKeyCreator OAApprovalInfoFilterKey = "creator"

OAApprovalInfoFilterKeyCreator 申请人

const OAApprovalInfoFilterKeyDepartment OAApprovalInfoFilterKey = "department"

OAApprovalInfoFilterKeyDepartment 审批单提单者所在部门

const OAApprovalInfoFilterKeySpStatus OAApprovalInfoFilterKey = "sp_status"

OAApprovalInfoFilterKeySpStatus 审批状态

const OAApprovalInfoFilterKeyTemplateID OAApprovalInfoFilterKey = "template_id"

OAApprovalInfoFilterKeyTemplateID 模板类型

type OAApprovalInfoNotifier

type OAApprovalInfoNotifier struct {
	// UserID 节点抄送人userid
	UserID string `xml:"UserId"`
}

OAApprovalInfoNotifier 抄送信息,可能有多个抄送节点

type OAApprovalInfoSpRecord

type OAApprovalInfoSpRecord struct {
	// SpStatus 审批节点状态:1-审批中;2-已同意;3-已驳回;4-已转审
	SpStatus string `xml:"SpStatus"`
	// ApproverAttr 节点审批方式:1-或签;2-会签
	ApproverAttr string `xml:"ApproverAttr"`
	// Details 审批节点详情。当节点为标签或上级时,一个节点可能有多个分支
	Details []OAApprovalInfoSpRecordDetail `xml:"Details"`
}

OAApprovalInfoSpRecord 审批流程信息,可能有多个审批节点。

type OAApprovalInfoSpRecordDetail

type OAApprovalInfoSpRecordDetail struct {
	// Approver 分支审批人
	Approver OAApprovalInfoSpRecordDetailApprover `xml:"Approver"`
	// Speech 审批意见字段
	Speech string `xml:"Speech"`
	// SpStatus 分支审批人审批状态:1-审批中;2-已同意;3-已驳回;4-已转审
	SpStatus string `xml:"SpStatus"`
	// SpTime 节点分支审批人审批操作时间,0为尚未操作
	SpTime string `xml:"SpTime"`
	// Attach 节点分支审批人审批意见附件,赋值为media_id具体使用请参考:文档-获取临时素材
	Attach []string `xml:"Attach"`
}

OAApprovalInfoSpRecordDetail 审批节点详情。当节点为标签或上级时,一个节点可能有多个分支

type OAApprovalInfoSpRecordDetailApprover

type OAApprovalInfoSpRecordDetailApprover struct {
	// UserID 分支审批人userid
	UserID string `xml:"UserId"`
}

OAApprovalInfoSpRecordDetailApprover 分支审批人

type OAApprover

type OAApprover struct {
	// Attr 节点审批方式:1-或签;2-会签,仅在节点为多人审批时有效
	Attr uint8 `json:"attr"`
	// UserID 审批节点审批人userid列表,若为多人会签、多人或签,需填写每个人的userid
	UserID []string `json:"userid"`
}

OAApprover 审批流程信息

type OAContent

type OAContent struct {
	// Control 控件类型:Text-文本;Textarea-多行文本;Number-数字;Money-金额;Date-日期/日期+时间;Selector-单选/多选;;Contact-成员/部门;Tips-说明文字;File-附件;Table-明细;
	Control OAControl `json:"control"`
	// ID 控件id:控件的唯一id,可通过“获取审批模板详情”接口获取
	ID string `json:"id"`
	// Title 控件名称 ,若配置了多语言则会包含中英文的控件名称
	Title []OAText `json:"title"`
	// Value 控件值 ,需在此为申请人在各个控件中填写内容不同控件有不同的赋值参数,具体说明详见附录。模板配置的控件属性为必填时,对应value值需要有值。
	Value OAContentValue `json:"value"`
}

OAContent 审批申请详情,由多个表单控件及其内容组成,其中包含需要对控件赋值的信息

type OAContentDate

type OAContentDate struct {
	// Type 时间展示类型:day-日期;hour-日期+时间 ,和对应模板控件属性一致
	Type string `json:"type"`
	// Timestamp 时间戳-字符串类型,在此填写日期/日期+时间控件的选择值,以此为准
	Timestamp string `json:"s_timestamp"`
}

OAContentDate 日期/日期+时间内容

type OAContentDateRange

type OAContentDateRange struct {
	// NewBegin 开始时间,unix时间戳
	NewBegin int `json:"new_begin"`
	// NewEnd 结束时间,unix时间戳
	NewEnd int `json:"new_end"`
	// NewDuration 时长范围,单位秒
	NewDuration int `json:"new_duration"`
}

OAContentDateRange 时长组件

type OAContentDepartment

type OAContentDepartment struct {
	// OpenAPIID 所选部门id
	OpenAPIID string `json:"openapi_id"`
	// Name 所选部门名
	Name string `json:"name"`
}

OAContentDepartment 所选部门内容,即申请人在此控件选择的部门,多选模式下可能有多个

type OAContentFile

type OAContentFile struct {
	// FileID 文件id,该id为临时素材上传接口返回的的media_id,注:提单后将作为单据内容转换为长期文件存储;目前一个审批申请单,全局仅支持上传6个附件,否则将失败。
	FileID string `json:"file_id"`
}

OAContentFile 附件

type OAContentFormula

type OAContentFormula struct {
	// Value 公式的值,提交表单时无需填写,后台自动计算
	Value string `json:"value"`
}

OAContentFormula 公式控件

type OAContentLocation

type OAContentLocation struct {
	// Latitude 纬度,精确到6位小数
	Latitude string `json:"latitude"`
	// Longitude 经度,精确到6位小数
	Longitude string `json:"longitude"`
	// Title 地点标题
	Title string `json:"title"`
	// Address 地点详情地址
	Address string `json:"address"`
	// Time 选择地点的时间
	Time int `json:"time"`
}

OAContentLocation 位置控件

type OAContentMember

type OAContentMember struct {
	// UserID 所选成员的userid
	UserID string `json:"userid"`
	// Name 成员名
	Name string `json:"name"`
}

OAContentMember 所选成员内容,即申请人在此控件选择的成员,多选模式下可以有多个

type OAContentRelatedApproval

type OAContentRelatedApproval struct {
	// SpNo 关联审批单的审批单号
	SpNo string `json:"sp_no"`
}

OAContentRelatedApproval 关联审批单控件

type OAContentSelector

type OAContentSelector struct {
	// Type 选择方式:single-单选;multi-多选
	Type string `json:"type"`
	// Options 多选选项,多选属性的选择控件允许输入多个
	Options []OAContentSelectorOption `json:"options"`
}

OAContentSelector 类型标志,单选/多选控件的config中会包含此参数

type OAContentSelectorOption

type OAContentSelectorOption struct {
	// Key 选项key,可通过“获取审批模板详情”接口获得
	Key string `json:"key"`
}

OAContentSelectorOption 多选选项,多选属性的选择控件允许输入多个

type OAContentTableList

type OAContentTableList struct {
	// List 子明细列表,在此填写子明细的所有子控件的值,子控件的数据结构同一般控件
	List []OAContent `json:"list"`
}

OAContentTableList 子明细列表,在此填写子明细的所有子控件的值,子控件的数据结构同一般控件

type OAContentVacation

type OAContentVacation struct {
	// Selector 请假类型,所选选项与假期管理关联,为假期管理中的假期类型
	Selector OAContentSelector `json:"selector"`
	// Attendance 假勤组件
	Attendance OAContentVacationAttendance `json:"attendance"`
}

OAContentVacation 请假内容,即申请人在此组件内选择的请假信息

type OAContentVacationAttendance

type OAContentVacationAttendance struct {
	// DateRange 假勤组件时间选择范围
	DateRange OAContentVacationAttendanceDateRange `json:"date_range"`
	// Type 假勤组件类型:1-请假;3-出差;4-外出;5-加班
	Type uint8 `json:"type"`
}

OAContentVacationAttendance 假勤组件

type OAContentVacationAttendanceDateRange

type OAContentVacationAttendanceDateRange struct {
	// Type 时间展示类型:day-日期;hour-日期+时间
	Type string `json:"type"`
	//  时长范围
	OAContentDateRange
}

OAContentVacationAttendanceDateRange 假勤组件时间选择范围

type OAContentValue

type OAContentValue struct {
	// Text 文本/多行文本控件(control参数为Text或Textarea)
	Text string `json:"text"`
	// Number 数字控件(control参数为Number)
	Number string `json:"new_number"`
	// Money 金额控件(control参数为Money)
	Money string `json:"new_money"`
	// Date 日期/日期+时间控件(control参数为Date)
	Date OAContentDate `json:"date"`
	// Selector 单选/多选控件(control参数为Selector)
	Selector OAContentSelector `json:"selector"`
	// Members 成员控件(control参数为Contact,且value参数为members)
	Members []OAContentMember `json:"members"`
	// Departments 部门控件(control参数为Contact,且value参数为departments)
	Departments []OAContentDepartment `json:"departments"`
	// Files 附件控件(control参数为File,且value参数为files)
	Files []OAContentFile `json:"files"`
	// Table 明细控件(control参数为Table)
	Table []OAContentTableList `json:"children"`
	// Vacation 假勤组件-请假组件(control参数为Vacation)
	Vacation OAContentVacation `json:"vacation"`
	// Location 位置控件(control参数为Location,且value参数为location)
	Location OAContentLocation `json:"location"`
	// RelatedApproval 关联审批单控件(control参数为RelatedApproval,且value参数为related_approval)
	RelatedApproval []OAContentRelatedApproval `json:"related_approval"`
	// Formula 公式控件(control参数为Formula,且value参数为formula)
	Formula OAContentFormula `json:"formula"`
	// DateRange 时长组件(control参数为DateRange,且value参数为date_range)
	DateRange OAContentDateRange `json:"date_range"`
}

OAContentValue 控件值 ,需在此为申请人在各个控件中填写内容不同控件有不同的赋值参数,具体说明详见附录。模板配置的控件属性为必填时,对应value值需要有值。

type OAContents

type OAContents struct {
	// Contents 审批申请详情,由多个表单控件及其内容组成,其中包含需要对控件赋值的信息
	Contents []OAContent `json:"contents"`
}

OAContents 审批申请详情,由多个表单控件及其内容组成,其中包含需要对控件赋值的信息

type OAControl

type OAControl string

OAControl 控件类型

const OAControlAttendance OAControl = "Attendance"

OAControlAttendance 假勤组件-出差/外出/加班组件

const OAControlContact OAControl = "Contact"

OAControlContact 成员/部门控件

const OAControlDate OAControl = "Date"

OAControlDate 日期/日期+时间控件

const OAControlDateRange OAControl = "DateRange"

OAControlDateRange 时长控件

const OAControlFile OAControl = "File"

OAControlFile 附件控件

const OAControlFormula OAControl = "Formula"

OAControlFormula 公式控件

const OAControlLocation OAControl = "Location"

OAControlLocation 位置控件

const OAControlMoney OAControl = "Money"

OAControlMoney 金额

const OAControlNumber OAControl = "Number"

OAControlNumber 数字

const OAControlRelatedApproval OAControl = "RelatedApproval"

OAControlRelatedApproval 关联审批单控件

const OAControlSelector OAControl = "Selector"

OAControlSelector 单选/多选控件

const OAControlTable OAControl = "Table"

OAControlTable 明细控件

const OAControlText OAControl = "Text"

OAControlText 文本

const OAControlTextarea OAControl = "Textarea"

OAControlTextarea 多行文本

const OAControlTips OAControl = "Tips"

OAControlTips 说明文字控件

const OAControlVacation OAControl = "Vacation"

OAControlVacation 假勤组件-请假组件

type OASummaryList

type OASummaryList struct {
	// SummaryInfo 摘要行信息,用于定义某一行摘要显示的内容
	SummaryInfo []OAText `json:"summary_info"`
}

OASummaryList 摘要行信息,用于定义某一行摘要显示的内容

type OATemplateControl

type OATemplateControl struct {
	// Property 模板控件属性,包含了模板内控件的各种属性信息
	Property OATemplateControlProperty `json:"property"`
	// Config 模板控件配置,包含了部分控件类型的附加类型、属性,详见附录说明。目前有配置信息的控件类型有:Date-日期/日期+时间;Selector-单选/多选;Contact-成员/部门;Table-明细;Attendance-假勤组件(请假、外出、出差、加班)
	Config OATemplateControlConfig `json:"config"`
}

OATemplateControl 模板控件信息

type OATemplateControlConfig

type OATemplateControlConfig struct {
	// Date Date控件(日期/日期+时间控件)
	Date OATemplateControlConfigDate `json:"date"`
	// Selector Selector控件(单选/多选控件)
	Selector OATemplateControlConfigSelector `json:"selector"`
	// Contact Contact控件(成员/部门控件)
	Contact OATemplateControlConfigContact `json:"contact"`
	// Table Table(明细控件)
	Table OATemplateControlConfigTable `json:"table"`
	// Attendance Attendance控件(假勤控件)
	Attendance OATemplateControlConfigAttendance `json:"attendance"`
}

OATemplateControlConfig 模板控件配置

type OATemplateControlConfigAttendance

type OATemplateControlConfigAttendance struct {
	// DateRange 假期控件属性
	DateRange OATemplateControlConfigAttendanceDateRange `json:"date_range"`
	// Type 假勤控件类型:1-请假,3-出差,4-外出,5-加班
	Type uint8 `json:"type"`
}

OATemplateControlConfigAttendance 类型标志,假勤控件的config中会包含此参数

type OATemplateControlConfigAttendanceDateRange

type OATemplateControlConfigAttendanceDateRange struct {
	// Type 时间刻度:hour-精确到分钟, halfday—上午/下午
	Type string `json:"type"`
}

OATemplateControlConfigAttendanceDateRange 假期控件属性

type OATemplateControlConfigContact

type OATemplateControlConfigContact struct {
	// Type 选择类型:single-单选;multi-多选
	Type string `json:"type"`
	// Mode 选择对象:user-成员;department-部门
	Mode string `json:"mode"`
}

OATemplateControlConfigContact 类型标志,单选/多选控件的config中会包含此参数

type OATemplateControlConfigDate

type OATemplateControlConfigDate struct {
	// Type 时间展示类型:day-日期;hour-日期+时间
	Type string `json:"type"`
}

OATemplateControlConfigDate 类型标志,日期/日期+时间控件的config中会包含此参数

type OATemplateControlConfigSelector

type OATemplateControlConfigSelector struct {
	// Type 选择类型:single-单选;multi-多选
	Type string `json:"type"`
	// Options 选项,包含单选/多选控件中的所有选项,可能有多个
	Options []OATemplateControlConfigSelectorOption `json:"options"`
}

OATemplateControlConfigSelector 类型标志,单选/多选控件的config中会包含此参数

type OATemplateControlConfigSelectorOption

type OATemplateControlConfigSelectorOption struct {
	// Key 选项key,选项的唯一id,可用于发起审批申请,为单选/多选控件赋值
	Key string `json:"key"`
	// Value 选项值,若配置了多语言则会包含中英文的选项值,默认为zh_CN中文
	Value []OAText `json:"value"`
}

OATemplateControlConfigSelectorOption 选项,包含单选/多选控件中的所有选项,可能有多个

type OATemplateControlConfigTable

type OATemplateControlConfigTable struct {
	// Children 明细内的子控件,内部结构同controls
	Children []OATemplateControl `json:"children"`
}

OATemplateControlConfigTable 类型标志,明细控件的config中会包含此参数

type OATemplateControlConfigVacation

type OATemplateControlConfigVacation struct {
	// Item 单个假期类型属性
	Item []OATemplateControlConfigVacationItem `json:"item"`
}

OATemplateControlConfigVacation 类型标志,假勤控件的config中会包含此参数

type OATemplateControlConfigVacationItem

type OATemplateControlConfigVacationItem struct {
	// ID 假期类型标识id
	ID int `json:"id"`
	// Name 假期类型名称,默认zh_CN中文名称
	Name []OAText `json:"name"`
}

OATemplateControlConfigVacationItem 类型标志,假勤控件的config中会包含此参数

type OATemplateControlProperty

type OATemplateControlProperty struct {
	// Control 模板控件属性,包含了模板内控件的各种属性信息
	Control OAControl `json:"control"`
	// ID 模板控件配置,包含了部分控件类型的附加类型、属性,详见附录说明。目前有配置信息的控件类型有:Date-日期/日期+时间;Selector-单选/多选;Contact-成员/部门;Table-明细;Attendance-假勤组件(请假、外出、出差、加班)
	ID string `json:"id"`
	// Title 模板控件配置,包含了部分控件类型的附加类型、属性,详见附录说明。目前有配置信息的控件类型有:Date-日期/日期+时间;Selector-单选/多选;Contact-成员/部门;Table-明细;Attendance-假勤组件(请假、外出、出差、加班)
	Title []OAText `json:"title"`
	// Placeholder 模板控件配置,包含了部分控件类型的附加类型、属性,详见附录说明。目前有配置信息的控件类型有:Date-日期/日期+时间;Selector-单选/多选;Contact-成员/部门;Table-明细;Attendance-假勤组件(请假、外出、出差、加班)
	Placeholder []OAText `json:"placeholder"`
	// Require 是否必填:1-必填;0-非必填
	Require uint8 `json:"require"`
	// UnPrint 是否参与打印:1-不参与打印;0-参与打印
	UnPrint uint8 `json:"un_print"`
}

OATemplateControlProperty 模板控件属性

type OATemplateControls

type OATemplateControls struct {
	// Controls 模板名称,若配置了多语言则会包含中英文的模板名称,默认为zh_CN中文
	Controls []OATemplateControl `json:"controls"`
}

OATemplateControls 模板控件数组。模板详情由多个不同类型的控件组成,控件类型详细说明见附录。

type OATemplateDetail

type OATemplateDetail struct {
	// TemplateNames 模板名称,若配置了多语言则会包含中英文的模板名称,默认为zh_CN中文
	TemplateNames []OAText `json:"template_names"`
	// TemplateContent 模板控件信息
	TemplateContent OATemplateControls `json:"template_content"`
	// Vacation Vacation控件(假勤控件)
	Vacation OATemplateControlConfigVacation `json:"vacation_list"`
}

OATemplateDetail 审批模板详情

type OAText

type OAText struct {
	// Text 文字
	Text string `json:"text"`
	// Lang 语言
	Lang string `json:"lang"`
}

OAText 通用文本信息

type Recipient

type Recipient struct {
	// UserIDs 成员ID列表(消息接收者),最多支持1000个
	UserIDs []string
	// PartyIDs 部门ID列表,最多支持100个。
	PartyIDs []string
	// TagIDs 标签ID列表,最多支持100个
	TagIDs []string
	// ChatID 应用关联群聊ID,仅用于【发送消息到群聊会话】
	ChatID string
}

Recipient 消息收件人定义

type ReqAddContactWay

type ReqAddContactWay struct {
	Type          int                    `json:"type"`
	Scene         int                    `json:"scene"`
	Style         int                    `json:"style"`
	Remark        string                 `json:"remark"`
	SkipVerify    bool                   `json:"skip_verify"`
	State         string                 `json:"state"`
	User          []string               `json:"user"`
	Party         []int                  `json:"party"`
	IsTemp        bool                   `json:"is_temp"`
	ExpiresIn     int64                  `json:"expires_in"`
	ChatExpiresIn int64                  `json:"chat_expires_in"`
	Unionid       string                 `json:"unionid"`
	Conclusions   map[string]interface{} `json:"conclusions"`
}

add_contact_way 联系我请求参数

type ReqSendWelcomeMsg

type ReqSendWelcomeMsg struct {
	WelcomeCode string             `json:"welcome_code"`
	Text        SendWelcomeMsgText `json:"text,omitempty"`
	//Image       SendWelcomeMsgImage       `json:"image,omitempty"`
	//Link        SendWelcomeMsgLink        `json:"link,omitempty"`
	Miniprogram SendWelcomeMsgMiniprogram `json:"miniprogram,omitempty"`
}

send_welcome_msg 发送新客户欢迎语

type RespAddContactWay

type RespAddContactWay struct {
	ConfigId string `json:"config_id"`
	QrCode   string `json:"qr_code"`
	// contains filtered or unexported fields
}

func (*RespAddContactWay) IsOK

func (x *RespAddContactWay) IsOK() bool

IsOK 响应体是否为一次成功请求的响应

实现依据: https://work.weixin.qq.com/api/doc#10013

> 企业微信所有接口,返回包里都有errcode、errmsg。 > 开发者需根据errcode是否为0判断是否调用成功(errcode意义请见全局错误码)。 > 而errmsg仅作参考,后续可能会有变动,因此不可作为是否调用成功的判据。

func (*RespAddContactWay) TryIntoErr

func (x *RespAddContactWay) TryIntoErr() error

type RespSendWelcomeMsg

type RespSendWelcomeMsg struct {
	// contains filtered or unexported fields
}

func (*RespSendWelcomeMsg) IsOK

func (x *RespSendWelcomeMsg) IsOK() bool

IsOK 响应体是否为一次成功请求的响应

实现依据: https://work.weixin.qq.com/api/doc#10013

> 企业微信所有接口,返回包里都有errcode、errmsg。 > 开发者需根据errcode是否为0判断是否调用成功(errcode意义请见全局错误码)。 > 而errmsg仅作参考,后续可能会有变动,因此不可作为是否调用成功的判据。

func (*RespSendWelcomeMsg) TryIntoErr

func (x *RespSendWelcomeMsg) TryIntoErr() error

type RxMessage

type RxMessage struct {
	// FromUserID 发送者的 UserID
	FromUserID string
	// SendTime 消息发送时间
	SendTime time.Time
	// MsgType 消息类型
	MsgType MessageType
	// MsgID 消息 ID
	MsgID int64
	// AgentID 企业应用 ID,可在应用的设置页面查看
	AgentID int64
	// Event 事件类型 MsgType为event存在
	Event EventType
	// ChangeType 变更类型 Event为change_external_contact存在
	ChangeType ChangeType
	// contains filtered or unexported fields
}

RxMessage 一条接收到的消息

func (*RxMessage) EventAddExternalContact

func (m *RxMessage) EventAddExternalContact() (EventAddExternalContact, bool)

EventAddExternalContact 如果消息为添加企业客户事件,则拿出相应的消息参数,否则返回 nil, false

func (*RxMessage) EventAddHalfExternalContact

func (m *RxMessage) EventAddHalfExternalContact() (EventAddHalfExternalContact, bool)

EventAddHalfExternalContact 如果消息为外部联系人免验证添加成员事件,则拿出相应的消息参数,否则返回 nil, false

func (*RxMessage) EventChangeExternalChat

func (m *RxMessage) EventChangeExternalChat() (EventChangeExternalChat, bool)

EventChangeExternalChat 如果消息为客户群变更事件,则拿出相应的消息参数,否则返回 nil, false

func (*RxMessage) EventDelExternalContact

func (m *RxMessage) EventDelExternalContact() (EventDelExternalContact, bool)

EventDelExternalContact 如果消息为删除企业客户事件,则拿出相应的消息参数,否则返回 nil, false

func (*RxMessage) EventDelFollowUser

func (m *RxMessage) EventDelFollowUser() (EventDelFollowUser, bool)

EventDelFollowUser 如果消息为删除跟进成员事件,则拿出相应的消息参数,否则返回 nil, false

func (*RxMessage) EventEditExternalContact

func (m *RxMessage) EventEditExternalContact() (EventEditExternalContact, bool)

EventEditExternalContact 如果消息为编辑企业客户事件,则拿出相应的消息参数,否则返回 nil, false

func (*RxMessage) EventSysApprovalChange

func (m *RxMessage) EventSysApprovalChange() (EventSysApprovalChange, bool)

EventSysApprovalChange 如果消息为审批申请状态变化回调通知,则拿出相应的消息参数,否则返回 nil, false

func (*RxMessage) EventTransferFail

func (m *RxMessage) EventTransferFail() (EventTransferFail, bool)

EventTransferFail 如果消息为客户接替失败事件,则拿出相应的消息参数,否则返回 nil, false

func (*RxMessage) Image

func (m *RxMessage) Image() (ImageMessageExtras, bool)

Image 如果消息为图片类型,则拿出相应的消息参数,否则返回 nil, false

func (m *RxMessage) Link() (LinkMessageExtras, bool)

Link 如果消息为链接类型,则拿出相应的消息参数,否则返回 nil, false

func (*RxMessage) Location

func (m *RxMessage) Location() (LocationMessageExtras, bool)

Location 如果消息为位置类型,则拿出相应的消息参数,否则返回 nil, false

func (*RxMessage) String

func (m *RxMessage) String() string

func (*RxMessage) Text

func (m *RxMessage) Text() (TextMessageExtras, bool)

Text 如果消息为文本类型,则拿出相应的消息参数,否则返回 nil, false

func (*RxMessage) Video

func (m *RxMessage) Video() (VideoMessageExtras, bool)

Video 如果消息为视频类型,则拿出相应的消息参数,否则返回 nil, false

func (*RxMessage) Voice

func (m *RxMessage) Voice() (VoiceMessageExtras, bool)

Voice 如果消息为语音类型,则拿出相应的消息参数,否则返回 nil, false

type RxMessageHandler

type RxMessageHandler interface {
	// OnIncomingMessage 一条消息到来时的回调。
	OnIncomingMessage(msg *RxMessage) error
}

RxMessageHandler 用来接收消息的接口。

type SendWelcomeMsgImage

type SendWelcomeMsgImage struct {
	MediaId string `json:"media_id"` //图片的media_id,可以通过素材管理接口获得
	PicUrl  string `json:"pic_url"`  //图片的链接,仅可使用上传图片接口得到的链接
}
type SendWelcomeMsgLink struct {
	Title  string `json:"title"`  //图文消息标题,最长为128字节
	Picurl string `json:"picurl"` //图文消息封面的url
	Desc   string `json:"desc"`   //图文消息的描述,最长为512字节
	Url    string `json:"url"`    //图文消息的链接
}

type SendWelcomeMsgMiniprogram

type SendWelcomeMsgMiniprogram struct {
	// Appid 小程序appid,必须是有在本企业安装授权的小程序,否则会被忽略
	Appid string `json:"appid"`
	// page 小程序的页面路径
	Page string `json:"page"`
	// Title 企业对外简称,需从已认证的企业简称中选填。可在“我的企业”页中查看企业简称认证状态。
	Title      string `json:"title"`
	PicMediaId string `json:"pic_media_id"` //小程序消息封面的mediaid,封面图建议尺寸为520*416
}

type SendWelcomeMsgText

type SendWelcomeMsgText struct {
	Content string `json:"content"`
}

type TaskCardBtn

type TaskCardBtn struct {
	// Key 按钮key值,用户点击后,会产生任务卡片回调事件,回调事件会带上该key值,只能由数字、字母和“_-@”组成,最长支持128字节
	Key string `json:"key"`
	// Name 按钮名称
	Name string `json:"name"`
	// ReplaceName 点击按钮后显示的名称,默认为“已处理”
	ReplaceName string `json:"replace_name"`
	// Color 按钮字体颜色,可选“red”或者“blue”,默认为“blue”
	Color string `json:"color"`
	// IsBold 按钮字体是否加粗,默认false
	IsBold bool `json:"is_bold"`
}

TaskCardBtn 任务卡片消息按钮

type TextMessageExtras

type TextMessageExtras interface {

	// GetContent 返回文本消息的内容。
	GetContent() string
	// contains filtered or unexported methods
}

TextMessageExtras 文本消息的参数。

type UserDeptInfo

type UserDeptInfo struct {
	// DeptID 部门 ID
	DeptID int64
	// Order 部门内的排序值,默认为0,数值越大排序越前面
	Order uint32
	// IsLeader 在所在的部门内是否为上级
	IsLeader bool
}

UserDeptInfo 用户部门信息

type UserGender

type UserGender int

UserGender 用户性别

const (
	// UserGenderUnspecified 性别未定义
	UserGenderUnspecified UserGender = 0
	// UserGenderMale 男性
	UserGenderMale UserGender = 1
	// UserGenderFemale 女性
	UserGenderFemale UserGender = 2
)

type UserIdentityInfo

type UserIdentityInfo struct {
	// UserID 成员UserID。若需要获得用户详情信息,可调用通讯录接口:读取成员。如果是互联企业,则返回的UserId格式如:CorpId/userid
	UserID string `json:"UserId"`
	// OpenID 非企业成员的标识,对当前企业唯一。不超过64字节
	OpenID string `json:"OpenId"`
	// DeviceID 手机设备号(由企业微信在安装时随机生成,删除重装会改变,升级不受影响)
	DeviceID string `json:"DeviceId"`
}

UserIdentityInfo 访问用户身份信息

type UserInfo

type UserInfo struct {
	// UserID 成员UserID
	//
	// 对应管理端的账号,企业内必须唯一。不区分大小写,长度为1~64个字节
	UserID string
	// Name 成员名称
	Name string
	// Position 职务信息;第三方仅通讯录应用可获取
	Position string
	// Departments 成员所属部门信息
	Departments []UserDeptInfo
	// Mobile 手机号码;第三方仅通讯录应用可获取
	Mobile string
	// Gender 性别
	Gender UserGender
	// Email 邮箱;第三方仅通讯录应用可获取
	Email string
	// AvatarURL 头像 URL;第三方仅通讯录应用可获取
	//
	// NOTE:如果要获取小图将url最后的”/0”改成”/100”即可。
	AvatarURL string
	// Telephone 座机;第三方仅通讯录应用可获取
	Telephone string
	// IsEnabled 成员的启用状态
	IsEnabled bool
	// Alias 别名;第三方仅通讯录应用可获取
	Alias string
	// Status 成员激活状态
	Status UserStatus
	// QRCodeURL 员工个人二维码;第三方仅通讯录应用可获取
	//
	// 扫描可添加为外部联系人
	QRCodeURL string
}

UserInfo 用户信息

type UserStatus

type UserStatus int

UserStatus 用户激活信息

已激活代表已激活企业微信或已关注微工作台(原企业号)。 未激活代表既未激活企业微信又未关注微工作台(原企业号)。

const (
	// UserStatusActivated 已激活
	UserStatusActivated UserStatus = 1
	// UserStatusDeactivated 已禁用
	UserStatusDeactivated UserStatus = 2
	// UserStatusUnactivated 未激活
	UserStatusUnactivated UserStatus = 4
)

type VideoMessageExtras

type VideoMessageExtras interface {

	// GetMediaID 返回视频消息的视频媒体文件 ID。
	//
	// 可以调用【获取媒体文件】接口拉取,仅三天内有效。
	GetMediaID() string

	// GetThumbMediaID 返回视频消息缩略图的媒体 ID。
	//
	// 可以调用【获取媒体文件】接口拉取,仅三天内有效。
	GetThumbMediaID() string
	// contains filtered or unexported methods
}

VideoMessageExtras 视频消息的参数。

type VoiceMessageExtras

type VoiceMessageExtras interface {

	// GetMediaID 返回语音消息的语音媒体文件 ID。
	//
	// 可以调用【获取媒体文件】接口拉取,仅三天内有效。
	GetMediaID() string

	// GetFormat 返回语音消息的语音格式,如 "amr"、"speex" 等。
	GetFormat() string
	// contains filtered or unexported methods
}

VoiceMessageExtras 语音消息的参数。

type Workwx

type Workwx struct {

	// CorpID 企业 ID,必填
	CorpID string
	// contains filtered or unexported fields
}

Workwx 企业微信客户端

Example
agentID := int64(1234567)

client := workwx.New(corpID)

// there're advanced options
_ = workwx.New(
	corpID,
	workwx.WithQYAPIHost("http://localhost:8888"),
	workwx.WithHTTPClient(&http.Client{}),
)

// work with individual apps
app := client.WithApp(corpSecret, agentID)
app.SpawnAccessTokenRefresher()

// see other examples for more details
Output:

func New

func New(corpID string, opts ...CtorOption) *Workwx

New 构造一个 Workwx 客户端对象,需要提供企业 ID

func (*Workwx) WithApp

func (c *Workwx) WithApp(corpSecret string, agentID int64) *WorkwxApp

WithApp 构造本企业下某自建 app 的客户端

type WorkwxApp

type WorkwxApp struct {
	*Workwx

	// CorpSecret 应用的凭证密钥,必填
	CorpSecret string
	// AgentID 应用 ID,必填
	AgentID int64
	// contains filtered or unexported fields
}

WorkwxApp 企业微信客户端(分应用)

func (*WorkwxApp) AddExternalContactCorpTag

func (c *WorkwxApp) AddExternalContactCorpTag(req ExternalContactCorpTagGroup) ([]ExternalContactCorpTagGroup, error)

AddExternalContactCorpTag 添加企业客户标签

func (*WorkwxApp) ApplyOAEvent

func (c *WorkwxApp) ApplyOAEvent(applyInfo OAApplyEvent) (string, error)

ApplyOAEvent 提交审批申请

Example
agentID := int64(1234567)

client := workwx.New(corpID)

app := client.WithApp(corpSecret, agentID)
app.SpawnAccessTokenRefresher()

appInfo := workwx.OAApplyEvent{
	CreatorUserID:       "your_userid",
	TemplateID:          "your_templateid",
	UseTemplateApprover: 1,
	ApplyData: workwx.OAContents{
		Contents: []workwx.OAContent{
			{
				Control: workwx.OAControlText,
				ID:      "Text-1608628829793",
				Value: workwx.OAContentValue{
					Text: "文本",
				},
			},
			{
				Control: workwx.OAControlTextarea,
				ID:      "Textarea-1608628832640",
				Value: workwx.OAContentValue{
					Text: "多行文本\n可换行",
				},
			},
			{
				Control: workwx.OAControlNumber,
				ID:      "Number-1608632495498",
				Value: workwx.OAContentValue{
					Number: "123.45",
				},
			},
			{
				Control: workwx.OAControlMoney,
				ID:      "Money-1608632497034",
				Value: workwx.OAContentValue{
					Money: "678.90",
				},
			},
			{
				Control: workwx.OAControlFormula,
				ID:      "Formula-1608632498148",
				Value: workwx.OAContentValue{
					Formula: workwx.OAContentFormula{Value: "5.0"},
				},
			},
			{
				Control: workwx.OAControlDate,
				ID:      "Date-1608632499227",
				Value: workwx.OAContentValue{
					Date: workwx.OAContentDate{Type: "day", Timestamp: strconv.FormatInt(time.Now().Unix(), 10)},
				},
			},
			{
				Control: workwx.OAControlDate,
				ID:      "Date-1608632500394",
				Value: workwx.OAContentValue{
					Date: workwx.OAContentDate{Type: "hour", Timestamp: strconv.FormatInt(time.Now().Unix(), 10)},
				},
			},
			{
				Control: workwx.OAControlDateRange,
				ID:      "DateRange-1608632502131",
				Value: workwx.OAContentValue{
					DateRange: workwx.OAContentDateRange{
						NewBegin:    int(time.Now().Unix()),
						NewEnd:      int(time.Now().Add(time.Hour * 24).Unix()),
						NewDuration: 60 * 60 * 24,
					},
				},
			},
			{
				Control: workwx.OAControlSelector,
				ID:      "Selector-1608632503203",
				Value: workwx.OAContentValue{
					Selector: workwx.OAContentSelector{
						Type: "single",
						Options: []workwx.OAContentSelectorOption{
							{Key: "option-1608632503204"},
						},
					},
				},
			},
			{
				Control: workwx.OAControlSelector,
				ID:      "Selector-1608632504330",
				Value: workwx.OAContentValue{
					Selector: workwx.OAContentSelector{
						Type: "multi",
						Options: []workwx.OAContentSelectorOption{
							{Key: "option-1608632504330"},
							{Key: "option-1608632504331"},
						},
					},
				},
			},
			{
				Control: workwx.OAControlContact,
				ID:      "Contact-1608632505579",
				Value: workwx.OAContentValue{
					Members: []workwx.OAContentMember{{
						UserID: "your_userid",
						Name:   "your_name",
					}},
				},
			},
			{
				Control: workwx.OAControlContact,
				ID:      "Contact-1608632506635",
				Value: workwx.OAContentValue{
					Departments: []workwx.OAContentDepartment{{
						OpenAPIID: "39",
						Name:      "xx部门1",
					}, {
						OpenAPIID: "40",
						Name:      "xx部门2",
					}},
				},
			},
			{
				Control: workwx.OAControlLocation,
				ID:      "Location-1608632507748",
				Value: workwx.OAContentValue{
					Location: workwx.OAContentLocation{
						Latitude:  "30.547239",
						Longitude: "104.063291",
						Title:     "腾讯科技(成都)有限公司(腾讯成都大厦)",
						Address:   "四川省成都市武侯区天府三街198号腾讯成都大厦A座",
						Time:      int(time.Now().Unix()),
					},
				},
			},
			{
				Control: workwx.OAControlRelatedApproval,
				ID:      "RelatedApproval-1608632509930",
				Value: workwx.OAContentValue{
					RelatedApproval: []workwx.OAContentRelatedApproval{
						{SpNo: "202012220021"},
					},
				},
			},
			{
				Control: workwx.OAControlTable,
				ID:      "Table-1608632511066",
				Value: workwx.OAContentValue{
					Table: []workwx.OAContentTableList{
						{
							List: []workwx.OAContent{
								{
									Control: workwx.OAControlText,
									ID:      "Text-1608632519610",
									Value: workwx.OAContentValue{
										Text: "第一行第一列",
									},
								}, {
									Control: workwx.OAControlText,
									ID:      "Text-1608632521106",
									Value: workwx.OAContentValue{
										Text: "第一行第二列",
									},
								},
							},
						},
						{
							List: []workwx.OAContent{
								{
									Control: workwx.OAControlText,
									ID:      "Text-1608632519610",
									Value: workwx.OAContentValue{
										Text: "第二行第一列",
									},
								}, {
									Control: workwx.OAControlText,
									ID:      "Text-1608632521106",
									Value: workwx.OAContentValue{
										Text: "第二行第二列",
									},
								},
							},
						},
					},
				},
			},
			{
				Control: workwx.OAControlVacation,
				ID:      "Vacation-1608715577151",
				Value: workwx.OAContentValue{
					Vacation: workwx.OAContentVacation{
						Selector: workwx.OAContentSelector{
							Type: "single",
							Options: []workwx.OAContentSelectorOption{
								{
									Key: "3",
								},
							},
						},
						Attendance: workwx.OAContentVacationAttendance{
							DateRange: workwx.OAContentVacationAttendanceDateRange{
								Type: "hour",
								OAContentDateRange: workwx.OAContentDateRange{
									NewBegin:    int(time.Now().Unix()),
									NewEnd:      int(time.Now().Add(time.Hour * 72).Unix()),
									NewDuration: 60 * 60 * 72,
								},
							},
							Type: 1,
						},
					},
				},
			},
		},
	},
	SummaryList: []workwx.OASummaryList{{SummaryInfo: []workwx.OAText{{
		Text: "摘要第1行",
	}}}, {SummaryInfo: []workwx.OAText{{
		Text: "摘要第2行",
	}}}},
}
_, _ = app.ApplyOAEvent(appInfo)
Output:

func (*WorkwxApp) BatchListExternalContact

func (c *WorkwxApp) BatchListExternalContact(userID string, cursor string, limit int) (*BatchListExternalContactsResp, error)

BatchListExternalContact 批量获取客户详情

func (*WorkwxApp) CheckMsgAuditRoomAgree

func (c *WorkwxApp) CheckMsgAuditRoomAgree(roomId string) ([]CheckMsgAuditRoomAgreeInfo, error)

CheckMsgAuditRoomAgree 获取会话同意情况(群聊)

func (*WorkwxApp) CheckMsgAuditSingleAgree

func (c *WorkwxApp) CheckMsgAuditSingleAgree(infos []CheckMsgAuditSingleAgreeUserInfo) ([]CheckMsgAuditSingleAgreeInfo, error)

CheckMsgAuditSingleAgree 获取会话同意情况(单聊)

func (*WorkwxApp) CreateAppchat

func (c *WorkwxApp) CreateAppchat(chatInfo *ChatInfo) (chatid string, err error)

CreateAppchat 创建群聊会话

func (*WorkwxApp) DelExternalContactCorpTag

func (c *WorkwxApp) DelExternalContactCorpTag(tagID, groupID []string) error

DelExternalContactCorpTag 删除企业客户标签

func (*WorkwxApp) EditExternalContactCorpTag

func (c *WorkwxApp) EditExternalContactCorpTag(id, name string, order uint32) error

EditExternalContactCorpTag 编辑企业客户标签

func (*WorkwxApp) ExecExternalContactAddContactWay

func (c *WorkwxApp) ExecExternalContactAddContactWay(req *ReqAddContactWay) (resp RespAddContactWay, err error)

func (*WorkwxApp) ExecExternalContactSendWelcomeMsg

func (c *WorkwxApp) ExecExternalContactSendWelcomeMsg(req *ReqSendWelcomeMsg) (resp RespSendWelcomeMsg, err error)

func (*WorkwxApp) GetAppchat

func (c *WorkwxApp) GetAppchat(chatid string) (*ChatInfo, error)

GetAppchat 获取群聊会话

func (*WorkwxApp) GetExternalContact

func (c *WorkwxApp) GetExternalContact(externalUserid string) (*ExternalContactInfo, error)

GetExternalContact 获取客户详情

func (*WorkwxApp) GetJSAPITicket

func (c *WorkwxApp) GetJSAPITicket() (string, error)

GetJSAPITicket 获取 JSAPI_ticket

func (*WorkwxApp) GetJSAPITicketAgentConfig

func (c *WorkwxApp) GetJSAPITicketAgentConfig() (string, error)

GetJSAPITicketAgentConfig 获取 JSAPI_ticket_agent_config

func (*WorkwxApp) GetMsgAuditGroupChat

func (c *WorkwxApp) GetMsgAuditGroupChat(roomID string) (*MsgAuditGroupChat, error)

GetMsgAuditGroupChat 获取会话内容存档内部群信息

func (*WorkwxApp) GetOAApprovalDetail

func (c *WorkwxApp) GetOAApprovalDetail(spNo string) (*OAApprovalDetail, error)

GetOAApprovalDetail 提交审批申请

func (*WorkwxApp) GetOAApprovalInfo

func (c *WorkwxApp) GetOAApprovalInfo(req GetOAApprovalInfoReq) ([]string, error)

GetOAApprovalInfo 批量获取审批单号

func (*WorkwxApp) GetOATemplateDetail

func (c *WorkwxApp) GetOATemplateDetail(templateID string) (*OATemplateDetail, error)

GetOATemplateDetail 获取审批模板详情

func (*WorkwxApp) GetTransferExternalContactResult

func (c *WorkwxApp) GetTransferExternalContactResult(externalUserID, handoverUserID, takeoverUserID string) (*ExternalContactTransferResult, error)

GetTransferExternalContactResult 查询客户接替结果

func (*WorkwxApp) GetUser

func (c *WorkwxApp) GetUser(userid string) (*UserInfo, error)

GetUser 读取成员

func (*WorkwxApp) GetUserIDByMobile

func (c *WorkwxApp) GetUserIDByMobile(mobile string) (string, error)

GetUserIDByMobile 通过手机号获取 userid

func (*WorkwxApp) GetUserInfoByCode

func (c *WorkwxApp) GetUserInfoByCode(code string) (*UserIdentityInfo, error)

GetUserInfoByCode 获取访问用户身份,根据code获取成员信息

func (*WorkwxApp) JSCode2Session

func (c *WorkwxApp) JSCode2Session(jscode string) (*JSCodeSession, error)

JSCode2Session 临时登录凭证校验

func (*WorkwxApp) ListAllDepts

func (c *WorkwxApp) ListAllDepts() ([]*DeptInfo, error)

ListAllDepts 获取全量组织架构。

func (*WorkwxApp) ListDepts

func (c *WorkwxApp) ListDepts(id int64) ([]*DeptInfo, error)

ListDepts 获取指定部门及其下的子部门。

func (*WorkwxApp) ListExternalContact

func (c *WorkwxApp) ListExternalContact(userID string) ([]string, error)

ListExternalContact 获取客户列表

func (*WorkwxApp) ListExternalContactCorpTags

func (c *WorkwxApp) ListExternalContactCorpTags(tagIDs ...string) ([]ExternalContactCorpTagGroup, error)

ListExternalContactCorpTags 获取企业标签库

func (*WorkwxApp) ListMsgAuditPermitUser

func (c *WorkwxApp) ListMsgAuditPermitUser(msgAuditEdition MsgAuditEdition) ([]string, error)

ListMsgAuditPermitUser 获取会话内容存档开启成员列表

func (*WorkwxApp) ListUnassignedExternalContact

func (c *WorkwxApp) ListUnassignedExternalContact(pageID, pageSize uint32, cursor string) (*ExternalContactUnassignedList, error)

ListUnassignedExternalContact 获取离职成员的客户列表

func (*WorkwxApp) ListUsersByDeptID

func (c *WorkwxApp) ListUsersByDeptID(deptID int64, fetchChild bool) ([]*UserInfo, error)

ListUsersByDeptID 获取部门成员详情

func (*WorkwxApp) MarkExternalContactTag

func (c *WorkwxApp) MarkExternalContactTag(userID, externalUserID string, addTag, removeTag []string) error

MarkExternalContactTag 标记客户企业标签

func (*WorkwxApp) RemarkExternalContact

func (c *WorkwxApp) RemarkExternalContact(req *ExternalContactRemark) error

RemarkExternalContact 修改客户备注信息

func (*WorkwxApp) SendFileMessage

func (c *WorkwxApp) SendFileMessage(
	recipient *Recipient,
	mediaID string,
	isSafe bool,
) error

SendFileMessage 发送文件消息

收件人参数如果仅设置了 `ChatID` 字段,则为【发送消息到群聊会话】接口调用; 否则为单纯的【发送应用消息】接口调用。

func (*WorkwxApp) SendImageMessage

func (c *WorkwxApp) SendImageMessage(
	recipient *Recipient,
	mediaID string,
	isSafe bool,
) error

SendImageMessage 发送图片消息

收件人参数如果仅设置了 `ChatID` 字段,则为【发送消息到群聊会话】接口调用; 否则为单纯的【发送应用消息】接口调用。

func (*WorkwxApp) SendMPNewsMessage

func (c *WorkwxApp) SendMPNewsMessage(
	recipient *Recipient,
	title string,
	thumbMediaID string,
	author string,
	sourceContentURL string,
	content string,
	digest string,
	isSafe bool,
) error

SendMPNewsMessage 发送 mpnews 类型的图文消息

收件人参数如果仅设置了 `ChatID` 字段,则为【发送消息到群聊会话】接口调用; 否则为单纯的【发送应用消息】接口调用。

func (*WorkwxApp) SendMarkdownMessage

func (c *WorkwxApp) SendMarkdownMessage(
	recipient *Recipient,
	content string,
	isSafe bool,
) error

SendMarkdownMessage 发送 Markdown 消息

仅支持 Markdown 的子集,详见[官方文档](https://work.weixin.qq.com/api/doc#90002/90151/90854/%E6%94%AF%E6%8C%81%E7%9A%84markdown%E8%AF%AD%E6%B3%95)。

收件人参数如果仅设置了 `ChatID` 字段,则为【发送消息到群聊会话】接口调用; 否则为单纯的【发送应用消息】接口调用。

func (*WorkwxApp) SendNewsMessage

func (c *WorkwxApp) SendNewsMessage(
	recipient *Recipient,
	title string,
	description string,
	url string,
	picURL string,
	isSafe bool,
) error

SendNewsMessage 发送图文消息

收件人参数如果仅设置了 `ChatID` 字段,则为【发送消息到群聊会话】接口调用; 否则为单纯的【发送应用消息】接口调用。

func (*WorkwxApp) SendTaskCardMessage

func (c *WorkwxApp) SendTaskCardMessage(
	recipient *Recipient,
	title string,
	description string,
	url string,
	taskid string,
	btn []TaskCardBtn,
	isSafe bool,
) error

SendTaskCardMessage 发送 任务卡片 消息

func (*WorkwxApp) SendTextCardMessage

func (c *WorkwxApp) SendTextCardMessage(
	recipient *Recipient,
	title string,
	description string,
	url string,
	buttonText string,
	isSafe bool,
) error

SendTextCardMessage 发送文本卡片消息

收件人参数如果仅设置了 `ChatID` 字段,则为【发送消息到群聊会话】接口调用; 否则为单纯的【发送应用消息】接口调用。

func (*WorkwxApp) SendTextMessage

func (c *WorkwxApp) SendTextMessage(
	recipient *Recipient,
	content string,
	isSafe bool,
) error

SendTextMessage 发送文本消息

收件人参数如果仅设置了 `ChatID` 字段,则为【发送消息到群聊会话】接口调用; 否则为单纯的【发送应用消息】接口调用。

Example
agentID := int64(1234567)

client := workwx.New(corpID)

app := client.WithApp(corpSecret, agentID)
// preferably do this at app initialization
app.SpawnAccessTokenRefresher()

// send to user(s)
to1 := workwx.Recipient{
	UserIDs: []string{"testuser"},
}
_ = app.SendTextMessage(&to1, "send to user(s)", false)

// "safe" message
to2 := workwx.Recipient{
	UserIDs: []string{"testuser"},
}
_ = app.SendTextMessage(&to2, "safe message", true)

// send to party(parties)
to3 := workwx.Recipient{
	PartyIDs: []string{"testdept"},
}
_ = app.SendTextMessage(&to3, "send to party(parties)", false)

// send to tag(s)
to4 := workwx.Recipient{
	TagIDs: []string{"testtag"},
}
_ = app.SendTextMessage(&to4, "send to tag(s)", false)

// send to chatid
to5 := workwx.Recipient{
	ChatID: "testchat",
}
_ = app.SendTextMessage(&to5, "send to chatid", false)
Output:

func (*WorkwxApp) SendVideoMessage

func (c *WorkwxApp) SendVideoMessage(
	recipient *Recipient,
	mediaID string,
	description string,
	title string,
	isSafe bool,
) error

SendVideoMessage 发送视频消息

收件人参数如果仅设置了 `ChatID` 字段,则为【发送消息到群聊会话】接口调用; 否则为单纯的【发送应用消息】接口调用。

func (*WorkwxApp) SendVoiceMessage

func (c *WorkwxApp) SendVoiceMessage(
	recipient *Recipient,
	mediaID string,
	isSafe bool,
) error

SendVoiceMessage 发送语音消息

收件人参数如果仅设置了 `ChatID` 字段,则为【发送消息到群聊会话】接口调用; 否则为单纯的【发送应用消息】接口调用。

func (*WorkwxApp) SpawnAccessTokenRefresher

func (c *WorkwxApp) SpawnAccessTokenRefresher()

SpawnAccessTokenRefresher 启动该 app 的 access token 刷新 goroutine

NOTE: 该 goroutine 本身没有 keep-alive 逻辑,需要自助保活

func (*WorkwxApp) SpawnAccessTokenRefresherWithContext

func (c *WorkwxApp) SpawnAccessTokenRefresherWithContext(ctx context.Context)

SpawnAccessTokenRefresherWithContext 启动该 app 的 access token 刷新 goroutine 可以通过 context cancellation 停止此 goroutine

NOTE: 该 goroutine 本身没有 keep-alive 逻辑,需要自助保活

func (*WorkwxApp) SpawnJSAPITicketAgentConfigRefresher

func (c *WorkwxApp) SpawnJSAPITicketAgentConfigRefresher()

SpawnJSAPITicketAgentConfigRefresher 启动该 app 的 JSAPI_ticket_agent_config 刷新 goroutine

NOTE: 该 goroutine 本身没有 keep-alive 逻辑,需要自助保活

func (*WorkwxApp) SpawnJSAPITicketAgentConfigRefresherWithContext

func (c *WorkwxApp) SpawnJSAPITicketAgentConfigRefresherWithContext(ctx context.Context)

SpawnJSAPITicketAgentConfigRefresherWithContext 启动该 app 的 JSAPI_ticket_agent_config 刷新 goroutine 可以通过 context cancellation 停止此 goroutine

NOTE: 该 goroutine 本身没有 keep-alive 逻辑,需要自助保活

func (*WorkwxApp) SpawnJSAPITicketRefresher

func (c *WorkwxApp) SpawnJSAPITicketRefresher()

SpawnJSAPITicketRefresher 启动该 app 的 JSAPI_ticket 刷新 goroutine

NOTE: 该 goroutine 本身没有 keep-alive 逻辑,需要自助保活

func (*WorkwxApp) SpawnJSAPITicketRefresherWithContext

func (c *WorkwxApp) SpawnJSAPITicketRefresherWithContext(ctx context.Context)

SpawnJSAPITicketRefresherWithContext 启动该 app 的 JSAPI_ticket 刷新 goroutine 可以通过 context cancellation 停止此 goroutine

NOTE: 该 goroutine 本身没有 keep-alive 逻辑,需要自助保活

func (*WorkwxApp) TransferExternalContact

func (c *WorkwxApp) TransferExternalContact(externalUserID, handoverUserID, takeoverUserID, transferSuccessMsg string) error

TransferExternalContact 分配成员的客户

func (*WorkwxApp) TransferGroupChatExternalContact

func (c *WorkwxApp) TransferGroupChatExternalContact(chatIDList []string, newOwner string) ([]ExternalContactGroupChatTransferFailed, error)

TransferGroupChatExternalContact 离职成员的群再分配

func (*WorkwxApp) UploadPermanentImageMedia

func (c *WorkwxApp) UploadPermanentImageMedia(media *Media) (url string, err error)

UploadPermanentImageMedia 上传永久图片素材

func (*WorkwxApp) UploadTempFileMedia

func (c *WorkwxApp) UploadTempFileMedia(media *Media) (*MediaUploadResult, error)

UploadTempFileMedia 上传临时文件素材

func (*WorkwxApp) UploadTempImageMedia

func (c *WorkwxApp) UploadTempImageMedia(media *Media) (*MediaUploadResult, error)

UploadTempImageMedia 上传临时图片素材

func (*WorkwxApp) UploadTempVideoMedia

func (c *WorkwxApp) UploadTempVideoMedia(media *Media) (*MediaUploadResult, error)

UploadTempVideoMedia 上传临时视频素材

func (*WorkwxApp) UploadTempVoiceMedia

func (c *WorkwxApp) UploadTempVoiceMedia(media *Media) (*MediaUploadResult, error)

UploadTempVoiceMedia 上传临时语音素材

type WorkwxClientError

type WorkwxClientError struct {
	// Code 错误码,0表示成功,非0表示调用失败。
	//
	// 开发者需根据errcode是否为0判断是否调用成功(errcode意义请见全局错误码)。
	Code errcodes.ErrCode
	// Msg 错误信息,调用失败会有相关的错误信息返回。
	//
	// 仅作参考,后续可能会有变动,因此不可作为是否调用成功的判据。
	Msg string
}

WorkwxClientError 企业微信客户端 SDK 的响应错误

func (*WorkwxClientError) Error

func (e *WorkwxClientError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL