Documentation
¶
Index ¶
- Constants
- type ActionList
- type ActionMenu
- type AddMsgTemplateDetail
- type AddMsgTemplateExternalContact
- type Article
- type AttachmentMsgType
- type Attachments
- type AuthCodeUserInfo
- type BatchListExternalContactsResp
- type Button
- type ButtonSelection
- type CardAction
- type CardImage
- type ChangeType
- type ChatAdminList
- type ChatInfo
- type ChatMemberList
- type ChatMemberListInvitor
- type ChatType
- type CheckBox
- type CheckMsgAuditRoomAgreeInfo
- type CheckMsgAuditSingleAgreeInfo
- type CheckMsgAuditSingleAgreeUserInfo
- type Conclusions
- type CorpVacationConf
- type CorpVacationConfDate
- type CorpVacationConfExpireRule
- type CorpVacationConfQuotaAttr
- type CorpVacationConfQuotaRule
- type CorpVacationConfQuotaRules
- type CtorOption
- func WithAccessTokenProvider(provider ITokenProvider) CtorOption
- func WithHTTPClient(client *http.Client) CtorOption
- func WithJSAPITicketAgentConfigProvider(provider ITokenProvider) CtorOption
- func WithJSAPITicketProvider(provider ITokenProvider) CtorOption
- func WithQYAPIHost(host string) CtorOption
- type CustomerTransferResult
- type DeptInfo
- type EmailType
- type EmphasisContent
- type EventAddExternalContact
- type EventAddHalfExternalContact
- type EventChangeExternalChat
- type EventDelExternalContact
- type EventDelFollowUser
- type EventEditExternalContact
- type EventKfMsgOrEvent
- type EventSysApprovalChange
- type EventTransferFail
- type EventType
- type ExternalAttr
- type ExternalAttrMiniprogram
- type ExternalAttrText
- type ExternalAttrWeb
- type ExternalContact
- type ExternalContactAddContact
- type ExternalContactAddCorpTag
- type ExternalContactAddCorpTagGroup
- type ExternalContactBatchInfo
- type ExternalContactContactWay
- type ExternalContactCorpTag
- type ExternalContactCorpTagGroup
- type ExternalContactFollowUserList
- type ExternalContactGroupChatJoinWay
- type ExternalContactGroupChatTransferFailed
- type ExternalContactInfo
- type ExternalContactListContactWayChat
- type ExternalContactMarkTag
- type ExternalContactRemark
- type ExternalContactTransferResult
- type ExternalContactTransferStatus
- type ExternalContactUnassigned
- type ExternalContactUnassignedList
- type ExternalContactWay
- type ExternalGroupChatJoinWay
- type ExternalProfile
- type ExternalUserType
- type File
- type FollowInfo
- type FollowUser
- type FollowUserAddWay
- type FollowUserInfo
- type FollowUserTag
- type FollowUserTagType
- type GetOAApprovalInfoReq
- type GroupChatList
- type HTTPHandler
- type HorizontalContentList
- type ITokenProvider
- type Image
- type ImageMessageExtras
- type ImageTextArea
- type JSCodeSession
- type JumpList
- type KfAccount
- type KfEvent
- type KfEventType
- type KfMsg
- type KfServiceState
- type KfServicer
- type KfServicerResult
- type KfWechatChannels
- type Link
- type LinkMessageExtras
- type LocationMessageExtras
- type MPArticle
- type MainTitle
- type Media
- type MediaUploadResult
- type Mentions
- type MessageType
- type MiniProgram
- type MsgAuditAgreeStatus
- type MsgAuditEdition
- type MsgAuditGroupChat
- type MsgAuditGroupChatMember
- type OAApplyEvent
- type OAApprovalDetail
- type OAApprovalDetailApplicant
- type OAApprovalDetailComment
- type OAApprovalDetailCommentUserInfo
- type OAApprovalDetailNotifier
- type OAApprovalDetailSpRecord
- type OAApprovalDetailSpRecordDetail
- type OAApprovalDetailSpRecordDetailApprover
- type OAApprovalInfo
- type OAApprovalInfoApplicant
- type OAApprovalInfoComment
- type OAApprovalInfoCommentUserInfo
- type OAApprovalInfoFilter
- type OAApprovalInfoFilterKey
- type OAApprovalInfoNotifier
- type OAApprovalInfoSpRecord
- type OAApprovalInfoSpRecordDetail
- type OAApprovalInfoSpRecordDetailApprover
- type OAApprover
- type OAContent
- type OAContentBankAccount
- type OAContentBankAccountBank
- type OAContentDate
- type OAContentDateRange
- type OAContentDateRangeTimezoneInfo
- type OAContentDepartment
- type OAContentFile
- type OAContentFormula
- type OAContentLocation
- type OAContentMember
- type OAContentPunchCorrection
- type OAContentRelatedApproval
- type OAContentSelector
- type OAContentSelectorOption
- type OAContentTableList
- type OAContentVacation
- type OAContentVacationAttendance
- type OAContentVacationAttendanceDateRange
- type OAContentVacationAttendanceSliceInfo
- type OAContentVacationAttendanceSliceInfoDayItem
- type OAContentValue
- type OAContents
- type OAControl
- type OASetOneUserVacationQuota
- type OASummaryList
- type OATemplateControl
- type OATemplateControlConfig
- type OATemplateControlConfigAttendance
- type OATemplateControlConfigAttendanceDateRange
- type OATemplateControlConfigContact
- type OATemplateControlConfigDate
- type OATemplateControlConfigSelector
- type OATemplateControlConfigSelectorOption
- type OATemplateControlConfigTable
- type OATemplateControlConfigTips
- type OATemplateControlConfigTipsContent
- type OATemplateControlConfigTipsContentSubText
- type OATemplateControlConfigTipsContentSubTextContent
- type OATemplateControlConfigTipsContentSubTextContentLink
- type OATemplateControlConfigTipsContentSubTextContentPlain
- type OATemplateControlConfigTipsContentText
- type OATemplateControlConfigVacation
- type OATemplateControlConfigVacationItem
- type OATemplateControlProperty
- type OATemplateControls
- type OATemplateDetail
- type OAText
- type OptionList
- type QuoteArea
- type Recipient
- type ReqChatList
- type ReqChatListOwnerFilter
- type RespAppChatInfo
- type RespAppchatList
- type RespGroupChatInfo
- type RespGroupChatList
- type RxMessage
- func (m *RxMessage) EventAddExternalContact() (EventAddExternalContact, bool)
- func (m *RxMessage) EventAddHalfExternalContact() (EventAddHalfExternalContact, bool)
- func (m *RxMessage) EventAppMenuClick() (*rxEventAppMenuClick, bool)
- func (m *RxMessage) EventAppMenuView() (*rxEventAppMenuView, bool)
- func (m *RxMessage) EventAppSubscribe() (*rxEventAppSubscribe, bool)
- func (m *RxMessage) EventAppUnsubscribe() (*rxEventAppUnsubscribe, bool)
- func (m *RxMessage) EventChangeExternalChat() (EventChangeExternalChat, bool)
- func (m *RxMessage) EventChangeTypeCreateUser() (*rxEventChangeTypeCreateUser, bool)
- func (m *RxMessage) EventChangeTypeUpdateUser() (*rxEventChangeTypeUpdateUser, bool)
- func (m *RxMessage) EventDelExternalContact() (EventDelExternalContact, bool)
- func (m *RxMessage) EventDelFollowUser() (EventDelFollowUser, bool)
- func (m *RxMessage) EventEditExternalContact() (EventEditExternalContact, bool)
- func (m *RxMessage) EventKfMsgOrEvent() (*rxEventKfMsgOrEvent, bool)
- func (m *RxMessage) EventSysApprovalChange() (EventSysApprovalChange, bool)
- func (m *RxMessage) EventTransferFail() (EventTransferFail, bool)
- func (m *RxMessage) EventUnknown() (*rxEventUnknown, bool)
- func (m *RxMessage) Image() (ImageMessageExtras, bool)
- func (m *RxMessage) Link() (LinkMessageExtras, bool)
- func (m *RxMessage) Location() (LocationMessageExtras, bool)
- func (m *RxMessage) String() string
- func (m *RxMessage) Text() (TextMessageExtras, bool)
- func (m *RxMessage) Video() (VideoMessageExtras, bool)
- func (m *RxMessage) Voice() (VoiceMessageExtras, bool)
- type RxMessageHandler
- type SelectList
- type SendWelcomeMsgExternalContact
- type SizeType
- type Source
- type SubmitButton
- type TaskCardBtn
- type TemplateCard
- type TemplateCardType
- type TemplateCardUpdateMessage
- type Text
- type TextMessageExtras
- type TransferCustomerResult
- type UserDeptInfo
- type UserDetail
- type UserGender
- type UserIdentityInfo
- type UserInfo
- type UserStatus
- type UserVacationQuota
- type Video
- type VideoMessageExtras
- type VoiceMessageExtras
- type WebhookClient
- type Workwx
- type WorkwxApp
- func (c *WorkwxApp) AddExternalContactCorpTag(req ExternalContactAddCorpTagGroup) (ExternalContactCorpTagGroup, error)
- func (c *WorkwxApp) AddKfContact(openKfID, scene string) (url string, err error)
- func (c *WorkwxApp) AddMsgTemplate(chatType ChatType, sender string, externalUserID []string, text Text, ...) (*AddMsgTemplateDetail, error)
- func (c *WorkwxApp) ApplyOAEvent(applyInfo OAApplyEvent) (string, error)
- func (c *WorkwxApp) AuthCode2UserInfo(code string) (*AuthCodeUserInfo, error)
- func (c *WorkwxApp) BatchListExternalContact(userID string, cursor string, limit int) (*BatchListExternalContactsResp, error)
- func (c *WorkwxApp) CheckMsgAuditRoomAgree(roomID string) ([]CheckMsgAuditRoomAgreeInfo, error)
- func (c *WorkwxApp) CheckMsgAuditSingleAgree(infos []CheckMsgAuditSingleAgreeUserInfo) ([]CheckMsgAuditSingleAgreeInfo, error)
- func (c *WorkwxApp) ConvertOpenGIDToChatID(openGID string) (string, error)
- func (c *WorkwxApp) ConvertOpenIDToUserID(openID string) (string, error)
- func (c *WorkwxApp) ConvertUserIDToOpenID(userID string) (string, error)
- func (c *WorkwxApp) CreateAppchat(chatInfo *ChatInfo) (chatID string, err error)
- func (c *WorkwxApp) CreateDept(deptInfo *DeptInfo) (deptID int64, err error)
- func (c *WorkwxApp) CreateKfAccount(name, mediaID string) (openKfID string, err error)
- func (c *WorkwxApp) CreateKfServicer(openKfID string, userIDs []string, departmentIDs []int64) (resultList []*KfServicerResult, err error)
- func (c *WorkwxApp) DelExternalContactCorpTag(tagID, groupID []string) error
- func (c *WorkwxApp) DeleteKfAccount(openKfID string) (err error)
- func (c *WorkwxApp) DeleteKfServicer(openKfID string, userIDs []string, departmentIDs []int64) (resultList []*KfServicerResult, err error)
- func (c *WorkwxApp) EditExternalContactCorpTag(id, name string, order uint32) error
- func (c *WorkwxApp) ExternalContactAddContact(t int, scene int, style int, remark string, skipVerify bool, state string, ...) (*ExternalContactAddContact, error)
- func (c *WorkwxApp) ExternalContactAddGroupChatJoinWay(externalGroupChatJoinWay ExternalGroupChatJoinWay) (string, error)
- func (c *WorkwxApp) ExternalContactCloseTempChat(userID, externalUserID string) error
- func (c *WorkwxApp) ExternalContactDelContactWay(configID string) error
- func (c *WorkwxApp) ExternalContactDelGroupChatJoinWay(configID string) error
- func (c *WorkwxApp) ExternalContactGetContactWay(configID string) (*ExternalContactContactWay, error)
- func (c *WorkwxApp) ExternalContactGetGroupChatJoinWay(configID string) (*ExternalContactGroupChatJoinWay, error)
- func (c *WorkwxApp) ExternalContactListContactWayChat(startTime int, endTime int, cursor string, limit int) (*ExternalContactListContactWayChat, error)
- func (c *WorkwxApp) ExternalContactListFollowUser() (*ExternalContactFollowUserList, error)
- func (c *WorkwxApp) ExternalContactTransferGroupChat(chatIDList []string, newOwner string) ([]ExternalContactGroupChatTransferFailed, error)
- func (c *WorkwxApp) ExternalContactUpdateContactWay(configID string, remark string, skipVerify bool, style int, state string, ...) error
- func (c *WorkwxApp) ExternalContactUpdateGroupChatJoinWay(configID string, externalGroupChatJoinWay ExternalGroupChatJoinWay) error
- func (c *WorkwxApp) GetAppChatInfo(chatID string) (*RespAppChatInfo, error)
- func (c *WorkwxApp) GetAppChatList(req ReqChatList) (*RespAppchatList, error)
- func (c *WorkwxApp) GetAppchat(chatID string) (*ChatInfo, error)
- func (c *WorkwxApp) GetExternalContact(externalUserID string) (*ExternalContactInfo, error)
- func (c *WorkwxApp) GetGroupChatInfo(chatID string, chatNeedName int64) (*RespGroupChatInfo, error)
- func (c *WorkwxApp) GetGroupChatList(req ReqChatList) (*RespGroupChatList, error)
- func (c *WorkwxApp) GetJSAPITicket() (string, error)
- func (c *WorkwxApp) GetJSAPITicketAgentConfig() (string, error)
- func (c *WorkwxApp) GetKfServiceState(openKfID, externalUserID string) (KfServiceState, string, error)
- func (c *WorkwxApp) GetMsgAuditGroupChat(roomID string) (*MsgAuditGroupChat, error)
- func (c *WorkwxApp) GetOAApprovalDetail(spNo string) (*OAApprovalDetail, error)
- func (c *WorkwxApp) GetOAApprovalInfo(req GetOAApprovalInfoReq) ([]string, error)
- func (c *WorkwxApp) GetOAGetCorpVacationConf() ([]CorpVacationConf, error)
- func (c *WorkwxApp) GetOAGetUserVacationQuota(userID string) ([]UserVacationQuota, error)
- func (c *WorkwxApp) GetOATemplateDetail(templateID string) (*OATemplateDetail, error)
- func (c *WorkwxApp) GetTransferCustomerResult(handoverUserID, takeoverUserID, cursor string) (*CustomerTransferResult, error)
- func (c *WorkwxApp) GetTransferExternalContactResult(externalUserID, handoverUserID, takeoverUserID string) (*ExternalContactTransferResult, error)
- func (c *WorkwxApp) GetTransferResignedCustomerResult(handoverUserID, takeoverUserID, cursor string) (*CustomerTransferResult, error)
- func (c *WorkwxApp) GetUser(userid string) (*UserInfo, error)
- func (c *WorkwxApp) GetUserIDByEmail(email string, emailType EmailType) (string, error)
- func (c *WorkwxApp) GetUserIDByMobile(mobile string) (string, error)
- func (c *WorkwxApp) GetUserInfoByCode(code string) (*UserIdentityInfo, error)
- func (c *WorkwxApp) GetUserJoinQrcode(sizeType SizeType) (string, error)
- func (c *WorkwxApp) JSCode2Session(jscode string) (*JSCodeSession, error)
- func (c *WorkwxApp) KfSyncMsg(openKfID, token, cursor string, limit int64, voiceFormat int) ([]KfMsg, int, string, error)
- func (c *WorkwxApp) ListAllDepts() ([]*DeptInfo, error)
- func (c *WorkwxApp) ListDepts(id int64) ([]*DeptInfo, error)
- func (c *WorkwxApp) ListExternalContact(userID string) ([]string, error)
- func (c *WorkwxApp) ListExternalContactCorpTags(tagIDs ...string) ([]ExternalContactCorpTagGroup, error)
- func (c *WorkwxApp) ListKfAccount(offset, limit int64) ([]*KfAccount, error)
- func (c *WorkwxApp) ListKfServicer(openKfID string) ([]*KfServicer, error)
- func (c *WorkwxApp) ListMsgAuditPermitUser(msgAuditEdition MsgAuditEdition) ([]string, error)
- func (c *WorkwxApp) ListUnassignedExternalContact(pageID, pageSize uint32, cursor string) (*ExternalContactUnassignedList, error)
- func (c *WorkwxApp) ListUsersByDeptID(deptID int64, fetchChild bool) ([]*UserInfo, error)
- func (c *WorkwxApp) MarkExternalContactTag(userID, externalUserID string, addTag, removeTag []string) error
- func (c *WorkwxApp) RemarkExternalContact(req *ExternalContactRemark) error
- func (c *WorkwxApp) ResignedTransferCustomer(handoverUserID, takeoverUserID string, externalUserIDs []string) (TransferCustomerResult, error)
- func (c *WorkwxApp) SendFileMessage(recipient *Recipient, mediaID string, isSafe bool) error
- func (c *WorkwxApp) SendImageMessage(recipient *Recipient, mediaID string, isSafe bool) error
- func (c *WorkwxApp) SendMPNewsMessage(recipient *Recipient, mparticles []MPArticle, isSafe bool) error
- func (c *WorkwxApp) SendMarkdownMessage(recipient *Recipient, content string, isSafe bool) error
- func (c *WorkwxApp) SendNewsMessage(recipient *Recipient, articles []Article, isSafe bool) error
- func (c *WorkwxApp) SendTaskCardMessage(recipient *Recipient, title string, description string, url string, ...) error
- func (c *WorkwxApp) SendTemplateCardMessage(recipient *Recipient, templateCard TemplateCard, isSafe bool) error
- func (c *WorkwxApp) SendTextCardMessage(recipient *Recipient, title string, description string, url string, ...) error
- func (c *WorkwxApp) SendTextMessage(recipient *Recipient, content string, isSafe bool) error
- func (c *WorkwxApp) SendVideoMessage(recipient *Recipient, mediaID string, description string, title string, ...) error
- func (c *WorkwxApp) SendVoiceMessage(recipient *Recipient, mediaID string, isSafe bool) error
- func (c *WorkwxApp) SendWelcomeMsg(welcomeCode string, text Text, attachments []Attachments) error
- func (c *WorkwxApp) SetOAOneUserVacationQuota(req OASetOneUserVacationQuota) error
- func (c *WorkwxApp) SimpleListAllDepts() ([]*DeptInfo, error)
- func (c *WorkwxApp) SimpleListDepts(id int64) ([]*DeptInfo, error)
- func (c *WorkwxApp) SpawnAccessTokenRefresher()
- func (c *WorkwxApp) SpawnAccessTokenRefresherWithContext(ctx context.Context)
- func (c *WorkwxApp) SpawnJSAPITicketAgentConfigRefresher()
- func (c *WorkwxApp) SpawnJSAPITicketAgentConfigRefresherWithContext(ctx context.Context)
- func (c *WorkwxApp) SpawnJSAPITicketRefresher()
- func (c *WorkwxApp) SpawnJSAPITicketRefresherWithContext(ctx context.Context)
- func (c *WorkwxApp) TransKfServiceState(openKfID, externalUserID, servicerUserID string, ServiceState KfServiceState) (string, error)
- func (c *WorkwxApp) TransferCustomer(handoverUserID, takeoverUserID string, externalUserIDs []string) (TransferCustomerResult, error)
- func (c *WorkwxApp) TransferExternalContact(externalUserID, handoverUserID, takeoverUserID, transferSuccessMsg string) error
- func (c *WorkwxApp) UpdateAppchat(chatInfo ChatInfo, addMemberUserIDs, delMemberUserIDs []string) (err error)
- func (c *WorkwxApp) UpdateKfAccount(openKfID, name, mediaID string) (err error)
- func (c *WorkwxApp) UpdateUser(userDetail *UserDetail) error
- func (c *WorkwxApp) UploadPermanentImageMedia(media *Media) (url string, err error)
- func (c *WorkwxApp) UploadTempFileMedia(media *Media) (*MediaUploadResult, error)
- func (c *WorkwxApp) UploadTempImageMedia(media *Media) (*MediaUploadResult, error)
- func (c *WorkwxApp) UploadTempVideoMedia(media *Media) (*MediaUploadResult, error)
- func (c *WorkwxApp) UploadTempVoiceMedia(media *Media) (*MediaUploadResult, error)
- type WorkwxClientError
Examples ¶
Constants ¶
const ( // MsgAuditAgreeStatusAgree 同意 MsgAuditAgreeStatusAgree = "Agree" // MsgAuditAgreeStatusDisagree 不同意 MsgAuditAgreeStatusDisagree = "Disagree" // MsgAuditAgreeStatusDefaultAgree 默认同意 MsgAuditAgreeStatusDefaultAgree = "Default_Agree" )
const ChatNeedName int64 = 1
ChatNeedName 是否需要返回群成员的名字 0-不返回;1-返回。默认不返回
const DefaultQYAPIHost = "https://qyapi.weixin.qq.com"
DefaultQYAPIHost 默认企业微信 API Host
const EventTypeAppMenuClick = "click"
EventTypeAppMenuClick 点击菜单
const EventTypeAppMenuLocationSelect = "location_select"
EventTypeAppMenuLocationSelect 弹出微信位置选择器
const EventTypeAppMenuPicPhotoOrAlbum = "pic_photo_or_album"
EventTypeAppMenuPicPhotoOrAlbum 弹出系统拍照发图
const EventTypeAppMenuPicSysPhoto = "pic_sysphoto"
EventTypeAppMenuPicSysPhoto 弹出系统拍照发图
const EventTypeAppMenuPicWeixin = "pic_weixin"
EventTypeAppMenuPicWeixin 弹出微信相册发图器
const EventTypeAppMenuScanCodePush = "scancode_push"
EventTypeAppMenuScanCodePush 扫码上传
const EventTypeAppMenuScanCodeWaitMsg = "scancode_waitmsg"
EventTypeAppMenuScanCodeWaitMsg 扫码等待消息
const EventTypeAppMenuView = "view"
EventTypeAppMenuCView 打开菜单链接
const EventTypeAppSubscribe = "subscribe"
EventTypeAppSubscribe 应用订阅
const EventTypeAppUnsubscribe = "unsubscribe"
EventTypeAppUnsubscribe 应用订阅取消
const MentionAll = "@all"
MentionAll 表示提醒所有人(“@所有人”)的特殊标记
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionList ¶
type ActionList struct {
// 操作的描述文案
Text string `json:"text"`
// 操作key值,用户点击后,会产生回调事件将本参数作为EventKey返回,回调事件会带上该key值,最长支持1024字节,不可重复
Key string `json:"key"`
}
ActionList 操作列表,列表长度取值范围为 [1, 3]
type ActionMenu ¶
type ActionMenu struct {
// 更多操作界面的描述
Desc string `json:"desc"`
ActionList []ActionList `json:"action_list"`
}
ActionMenu 卡片右上角更多操作按钮
type AddMsgTemplateDetail ¶
type AddMsgTemplateExternalContact ¶
type AddMsgTemplateExternalContact struct {
// ChatType 群发任务的类型,默认为single,表示发送给客户,group表示发送给客户群
ChatType ChatType `json:"chat_type"`
// ExternalUserID 客户的外部联系人id列表,仅在chat_type为single时有效,不可与sender同时为空,最多可传入1万个客户
ExternalUserID []string `json:"external_userid"`
// Sender 发送企业群发消息的成员userid,当类型为发送给客户群时必填
Sender string `json:"sender"`
// Text 消息文本,最多4000个字节
Text Text `json:"text"`
// Attachments 附件,最多支持添加9个附件
Attachments []Attachments `json:"attachments"`
}
AddMsgTemplateExternalContact 创建企业群发请求参数
type Article ¶
type Article struct {
// 标题,不超过128个字节,超过会自动截断(支持id转译)
Title string `json:"title"`
// 描述,不超过512个字节,超过会自动截断(支持id转译)
Description string `json:"description"`
// 点击后跳转的链接。 最长2048字节,请确保包含了协议头(http/https),小程序或者url必须填写一个
URL string `json:"url"`
// 图文消息的图片链接,最长2048字节,支持JPG、PNG格式,较好的效果为大图 1068*455,小图150*150
PicURL string `json:"picurl"`
// 小程序appid,必须是与当前应用关联的小程序,appid和pagepath必须同时填写,填写后会忽略url字段
AppID string `json:"appid"`
// 点击消息卡片后的小程序页面,最长128字节,仅限本小程序内的页面。appid和pagepath必须同时填写,填写后会忽略url字段
PagePath string `json:"pagepath"`
}
Article news 类型的文章
type AttachmentMsgType ¶
type AttachmentMsgType string
AttachmentMsgType 附件类型
const ( // AttachmentMsgTypeImage 图片消息 AttachmentMsgTypeImage AttachmentMsgType = "image" // AttachmentMsgTypeLink 图文消息 AttachmentMsgTypeLink AttachmentMsgType = "link" // AttachmentMsgTypeMiniprogram 小程序消息 AttachmentMsgTypeMiniprogram AttachmentMsgType = "miniprogram" // AttachmentMsgTypeVideo 视频消息 AttachmentMsgTypeVideo AttachmentMsgType = "video" )
type Attachments ¶
type Attachments struct {
// MsgType 附件类型,可选image、link、miniprogram或者video
MsgType AttachmentMsgType `json:"msgtype"`
// Image 图片消息配置
Image Image `json:"image"`
// Link 图文消息配置
Link Link `json:"link"`
// Miniprogram 小程序消息配置
Miniprogram MiniProgram `json:"miniprogram"`
// Video 视频消息配置
Video Video `json:"video"`
// File 文件消息配置
File File `json:"file"`
}
Attachments 附件
type AuthCodeUserInfo ¶
type AuthCodeUserInfo struct {
UserID string `json:"userid,omitempty"`
UserTicket string `json:"user_ticket,omitempty"`
OpenID string `json:"openid,omitempty"`
ExternalUserID string `json:"external_userid,omitempty"`
}
AuthCodeUserInfo 访问用户身份
type BatchListExternalContactsResp ¶
type BatchListExternalContactsResp struct {
Result []ExternalContactBatchInfo
NextCursor string
}
BatchListExternalContactsResp 外部联系人信息
type Button ¶
type Button struct {
// 按钮点击事件类型,0 或不填代表回调点击事件,1 代表跳转url
Type int `json:"type,omitempty"`
// 按钮文案,建议不超过10个字
Text string `json:"text"`
// 按钮样式,目前可填1~4,不填或错填默认1
Style int `json:"style,omitempty"`
// 按钮key值,用户点击后,会产生回调事件将本参数作为EventKey返回,回调事件会带上该key值,最长支持1024字节,不可重复,button_list.type是0时必填
Key string `json:"key,omitempty"`
// 跳转事件的url,button_list.type是1时必填
URL string `json:"url,omitempty"`
}
type ButtonSelection ¶
type ButtonSelection struct {
// 下拉式的选择器的key,用户提交选项后,会产生回调事件,回调事件会带上该key值表示该题,最长支持1024字节
QuestionKey string `json:"question_key"`
// 下拉式的选择器的key,用户提交选项后,会产生回调事件,回调事件会带上该key值表示该题,最长支持1024字节
Title string `json:"title"`
// 选项列表,下拉选项不超过 10 个,最少1个
OptionList []struct {
// 下拉式的选择器选项的id,用户提交后,会产生回调事件,回调事件会带上该id值表示该选项,最长支持128字节,不可重复
ID string `json:"id"`
// 下拉式的选择器选项的文案,建议不超过16个字
Text string `json:"text"`
} `json:"option_list"`
// 默认选定的id,不填或错填默认第一个
SelectedID string `json:"selected_id"`
}
ButtonSelection 按钮交互型
type CardAction ¶
type CardAction struct {
// 跳转事件类型,1 代表跳转url,2 代表打开小程序。text_notice卡片模版中该字段取值范围为[1,2]
Type int `json:"type"`
// 跳转事件的url,card_action.type是1时必填
URL string `json:"url"`
// 跳转事件的小程序的appid,必须是与当前应用关联的小程序,card_action.type是2时必填
Appid string `json:"appid"`
// 跳转事件的小程序的pagepath,card_action.type是2时选填
Pagepath string `json:"pagepath"`
}
CardAction 整体卡片的点击跳转事件,text_notice必填本字段
type CardImage ¶
type CardImage struct {
// 图片的url
URL string `json:"url"`
// 图片的宽高比,宽高比要小于2.25,大于1.3,不填该参数默认1.3
AspectRatio float32 `json:"aspect_ratio"`
}
CardImage 图片样式,news_notice类型的卡片,card_image和image_text_area两者必填一个字段,不可都不填
type ChangeType ¶
type ChangeType string
ChangeType 变更类型
const ChangeTypeAddExternalContact ChangeType = "add_external_contact"
ChangeTypeAddExternalContact 添加企业客户事件
const ChangeTypeAddHalfExternalContact ChangeType = "add_half_external_contact"
ChangeTypeAddHalfExternalContact 外部联系人免验证添加成员事件
const ChangeTypeCreateUser ChangeType = "create_user"
ChangeTypeCreateUser 新增成员事件
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 客户接替失败事件
const ChangeTypeUpdateUser ChangeType = "update_user"
ChangeTypeUpdateUser 更新成员事件
type ChatAdminList ¶
type ChatAdminList struct {
// UserID 管理员ID
UserID string `json:"userid"`
}
ChatAdminList 客户群管理员列表
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 ChatMemberList ¶
type ChatMemberList struct {
// UserID 群成员ID
UserID string `json:"userid"`
// Type 群成员类型 1 - 企业成员 2 - 外部联系人
Type int64 `json:"type"`
// UnionID 微信unionid
UnionID string `json:"unionid"`
// JoinTime 入群时间
JoinTime int64 `json:"join_time"`
// JoinScene 入群方式。1 - 由群成员邀请入群(直接邀请入群)2 - 由群成员邀请入群(通过邀请链接入群)3 - 通过扫描群二维码入群
JoinScene int64 `json:"join_scene"`
// Invitor 邀请者。目前仅当是由本企业内部成员邀请入群时会返回该值
Invitor ChatMemberListInvitor `json:"invitor"`
// GroupNickname 在群里的昵称
GroupNickname string `json:"group_nickname"`
// Name 在群里名字
Name string `json:"name"`
}
ChatMemberList 客户群成员列表
type ChatMemberListInvitor ¶
type ChatMemberListInvitor struct {
// UserID 邀请者ID
UserID string `json:"userid"`
}
ChatMemberListInvitor 入群邀请者
type CheckBox ¶
type CheckBox struct {
// 选择题key值,用户提交选项后,会产生回调事件,回调事件会带上该key值表示该题,最长支持1024字节
QuestionKey string `json:"question_key"`
// 选项list,选项个数不超过 20 个,最少1个
OptionList []struct {
// 选项id,用户提交选项后,会产生回调事件,回调事件会带上该id值表示该选项,最长支持128字节,不可重复
ID string `json:"id"`
// 选项文案描述,建议不超过17个字
Text string `json:"text"`
// 该选项是否要默认选中
IsChecked bool `json:"is_checked"`
} `json:"option_list" validate:"required,min=1,max=20"`
// 选择题模式,单选:0,多选:1,不填默认0
Mode int `json:"mode" validate:"omitempty,oneof=0 1"`
}
CheckBox 选择题样式
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 Conclusions ¶
type Conclusions struct {
// Text 文本消息
Text Text `json:"text"`
// Image 图片
Image Image `json:"image"`
// Link 链接
Link Link `json:"link"`
// MiniProgram 小程序
MiniProgram MiniProgram `json:"miniprogram"`
}
Conclusions 结束语,会话结束时自动发送给客户
type CorpVacationConf ¶
type CorpVacationConf struct {
// ID 假期id
ID uint32 `json:"id"`
// Name 假期名称
Name string `json:"name"`
// TimeAttr 假期时间刻度:0-按天请假;1-按小时请假
TimeAttr uint32 `json:"time_attr"`
// DurationType 时长计算类型:0-自然日;1-工作日
DurationType uint32 `json:"duration_type"`
// QuotaAttr 假期发放相关配置
QuotaAttr CorpVacationConfQuotaAttr `json:"quota_attr"`
// PerdayDuration 单位换算值,即1天对应的秒数,可将此值除以3600得到一天对应的小时。
PerdayDuration uint32 `json:"perday_duration"`
// IsNewovertime 是否关联加班调休,0-不关联,1-关联,关联后改假期类型变为调休假
IsNewovertime *uint32 `json:"is_newovertime"`
// EnterCompTimeLimit 入职时间大于n个月可用该假期,单位为月
EnterCompTimeLimit *uint32 `json:"enter_comp_time_limit"`
// ExpireRule 假期过期规则
ExpireRule *CorpVacationConfExpireRule `json:"expire_rule"`
}
CorpVacationConf 企业假期管理配置
type CorpVacationConfDate ¶
type CorpVacationConfDate struct {
// Month 月份
Month uint32 `json:"month"`
// Day 日
Day uint32 `json:"day"`
}
CorpVacationConfDate 企业假期管理配置-失效日期
type CorpVacationConfExpireRule ¶
type CorpVacationConfExpireRule struct {
// Type 过期规则类型,1-按固定时间过期,2-从发放日按年过期,3-从发放日按月过期,4-不过期
Type uint32 `json:"type"`
// Duration 有效期,按年过期为年,按月过期为月,只有在以上两种情况时有效
Duration uint64 `json:"duration"`
// Date 失效日期,只有按固定时间过期时有效
Date CorpVacationConfDate `json:"date"`
// ExternDurationEnable 是否允许延长有效期
ExternDurationEnable bool `json:"extern_duration_enable"`
// ExternDuration 延长有效期的具体时间,只有在extern_duration_enable为true时有效
ExternDuration CorpVacationConfDate `json:"extern_duration"`
}
CorpVacationConfExpireRule 企业假期管理配置-假期过期规则
type CorpVacationConfQuotaAttr ¶
type CorpVacationConfQuotaAttr struct {
// Type 假期发放类型:0-不限额;1-自动按年发放;2-手动发放;3-自动按月发放
Type uint32 `json:"type"`
// AutoresetTime 自动发放时间戳,若假期发放为自动发放,此参数代表自动发放日期。注:返回时间戳的年份是无意义的,请只使用返回时间的月和日;若at_entry_date为true,该字段则无效,假期发放时间为员工入职时间
AutoresetTime uint32 `json:"autoreset_time"`
// AutoresetDuration 自动发放时长,单位为秒。注:只有自动按年发放和自动按月发放时有效,若选择了按照工龄和司龄发放,该字段无效,发放时长请使用区间中的quota
AutoresetDuration uint32 `json:"autoreset_duration"`
// QuotaRuleType 额度计算类型,自动按年发放时有效,0-固定额度;1-按工龄计算;2-按司龄计算
QuotaRuleType *uint32 `json:"quota_rule_type"`
// QuotaRules 额度计算规则,自动按年发放时有效
QuotaRules *CorpVacationConfQuotaRules `json:"quota_rules"`
// AtEntryDate 是否按照入职日期发放假期,只有在自动按年发放类型有效,选择后发放假期的时间会成为员工入职的日期
AtEntryDate *bool `json:"at_entry_date"`
// AutoResetMonthDay 自动按月发放的发放时间,只有自动按月发放类型有效
AutoResetMonthDay *uint32 `json:"auto_reset_month_day"`
}
CorpVacationConfQuotaAttr 企业假期管理配置-假期发放相关配置
type CorpVacationConfQuotaRule ¶
type CorpVacationConfQuotaRule struct {
// Quota 区间发放时长,单位为s
Quota uint32 `json:"quota"`
// Begin 区间开始点,单位为年
Begin uint32 `json:"begin"`
// End 区间结束点,无穷大则为0,单位为年
End uint32 `json:"end"`
// BasedOnActualWorkTime 是否根据实际入职时间计算假期,选择后会根据员工在今年的实际工作时间发放假期
BasedOnActualWorkTime bool `json:"based_on_actual_work_time"`
}
CorpVacationConfQuotaRule 企业假期管理配置-额度计算规则区间
type CorpVacationConfQuotaRules ¶
type CorpVacationConfQuotaRules struct {
// List 额度计算规则区间,只有在选择了按照工龄计算或者按照司龄计算时有效
List []CorpVacationConfQuotaRule `json:"list"`
}
CorpVacationConfQuotaRules 企业假期管理配置-额度计算规则
type CtorOption ¶
type CtorOption interface {
// contains filtered or unexported methods
}
CtorOption 客户端对象构造参数
func WithAccessTokenProvider ¶
func WithAccessTokenProvider(provider ITokenProvider) CtorOption
func WithHTTPClient ¶
func WithHTTPClient(client *http.Client) CtorOption
WithHTTPClient 使用给定的 http.Client 作为 HTTP 客户端
func WithJSAPITicketAgentConfigProvider ¶
func WithJSAPITicketAgentConfigProvider(provider ITokenProvider) CtorOption
func WithJSAPITicketProvider ¶
func WithJSAPITicketProvider(provider ITokenProvider) CtorOption
type CustomerTransferResult ¶
type CustomerTransferResult struct {
Customer []struct {
// ExternalUserID 转接客户的外部联系人userid
ExternalUserID string `json:"external_userid"`
// Status 接替状态, 1-接替完毕 2-等待接替 3-客户拒绝 4-接替成员客户达到上限 5-无接替记录
Status int `json:"status"`
// TakeoverTime 接替客户的时间,如果是等待接替状态,则为未来的自动接替时间
TakeoverTime int `json:"takeover_time"`
} `json:"customer"`
// NextCursor 下个分页的起始cursor
NextCursor string `json:"next_cursor"`
}
type DeptInfo ¶
type DeptInfo struct {
// ID 部门 ID
ID int64 `json:"id,omitempty"`
// Name 部门名称
Name string `json:"name,omitempty"`
// NameEn 部门英文名称
NameEn string `json:"name_en,omitempty"`
// ParentID 父亲部门id。根部门为1
ParentID int64 `json:"parentid"`
// Order 在父部门中的次序值。order值大的排序靠前。值范围是[0, 2^32)
Order uint32 `json:"order"`
}
DeptInfo 部门信息
type EmphasisContent ¶
type EmphasisContent struct {
// 关键数据样式的数据内容,建议不超过14个字
Title string `json:"title"`
// 关键数据样式的数据描述内容,建议不超过22个字
Desc string `json:"desc"`
}
EmphasisContent 关键数据样式
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 EventKfMsgOrEvent ¶
type EventKfMsgOrEvent interface {
// GetOpenKfID 客服账号ID
GetOpenKfID() string
// GetToken 调用拉取消息接口时,需要传此token,用于校验请求的合法性
GetToken() string
// contains filtered or unexported methods
}
EventKfMsgOrEvent 客服接收消息和事件
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 EventTypeChangeContact EventType = "change_contact"
EventTypeChangeContact 通讯录回调通知
const EventTypeChangeExternalChat EventType = "change_external_chat"
EventTypeChangeExternalChat 客户群变更事件
const EventTypeChangeExternalContact EventType = "change_external_contact"
EventTypeChangeExternalContact 企业客户事件
const EventTypeKfMsgOrEvent EventType = "kf_msg_or_event"
EventTypeKfMsgOrEvent 客服回调通知
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 ExternalContactAddCorpTag ¶
type ExternalContactAddCorpTag struct {
// Name 标签名称
Name string `json:"name,omitempty"`
// Order 标签排序的次序值,order值大的排序靠前。有效的值范围是[0, 2^32)
Order uint32 `json:"order,omitempty"`
}
ExternalContactAddCorpTag 企业客户标签
type ExternalContactAddCorpTagGroup ¶
type ExternalContactAddCorpTagGroup struct {
// GroupID 标签组id
GroupID string `json:"group_id,omitempty"`
// GroupName 标签组名称
GroupName string `json:"group_name,omitempty"`
// Order 标签组排序的次序值,order值大的排序靠前。有效的值范围是[0, 2^32)
Order uint32 `json:"order,omitempty"`
// Tag 标签组内的标签列表
Tag []ExternalContactAddCorpTag `json:"tag,omitempty"`
// AgentID 授权方安装的应用agentid。仅旧的第三方多应用套件需要填此参数
AgentID int64 `json:"agentid,omitempty"`
}
ExternalContactAddCorpTagGroup 企业客户标签组
type ExternalContactBatchInfo ¶
type ExternalContactBatchInfo struct {
ExternalContact ExternalContact `json:"external_contact"`
FollowInfo FollowInfo `json:"follow_info"`
}
ExternalContactBatchInfo 外部联系人信息
type ExternalContactContactWay ¶
type ExternalContactContactWay struct {
ConfigID string `json:"config_id"`
QRCode string `json:"qr_code"`
ExternalContactWay
}
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 ExternalContactFollowUserList ¶
type ExternalContactFollowUserList struct {
// FollowUser 配置了客户联系功能的成员userid列表
FollowUser []string `json:"follow_user"`
}
ExternalContactFollowUserList 配置了客户联系功能的成员列表
type ExternalContactGroupChatJoinWay ¶
type ExternalContactGroupChatJoinWay struct {
ConfigID string `json:"config_id"`
QRCode string `json:"qr_code"`
ExternalGroupChatJoinWay
}
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 ExternalContactListContactWayChat ¶
type ExternalContactListContactWayChat struct {
NextCursor string `json:"next_cursor"`
ContactWay []contactWay `json:"contact_way"`
}
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 ExternalContactWay ¶
type ExternalContactWay struct {
// Type 联系方式类型,1-单人, 2-多人
Type int `json:"type"`
// Scene 场景,1-在小程序中联系,2-通过二维码联系
Scene int `json:"scene"`
// Style 在小程序中联系时使用的控件样式,详见附表
Style int `json:"style"`
// Remark 联系方式的备注信息,用于助记,不超过30个字符
Remark string `json:"remark"`
// SkipVerify 外部客户添加时是否无需验证,默认为true
SkipVerify bool `json:"skip_verify"`
// State 企业自定义的state参数,用于区分不同的添加渠道,在调用“获取外部联系人详情”时会返回该参数值,不超过30个字符 https://developer.work.weixin.qq.com/document/path/92114
State string `json:"state"`
// User 使用该联系方式的用户userID列表,在type为1时为必填,且只能有一个
User []string `json:"user"`
// Party 使用该联系方式的部门id列表,只在type为2时有效
Party []int `json:"party"`
// IsTemp 是否临时会话模式,true表示使用临时会话模式,默认为false
IsTemp bool `json:"is_temp"`
// ExpiresIn 临时会话二维码有效期,以秒为单位。该参数仅在is_temp为true时有效,默认7天,最多为14天
ExpiresIn int `json:"expires_in"`
// ChatExpiresIn 临时会话有效期,以秒为单位。该参数仅在is_temp为true时有效,默认为添加好友后24小时,最多为14天
ChatExpiresIn int `json:"chat_expires_in"`
// UnionID 可进行临时会话的客户UnionID,该参数仅在is_temp为true时有效,如不指定则不进行限制
UnionID string `json:"unionid"`
// Conclusions 结束语,会话结束时自动发送给客户,可参考“结束语定义”,仅在is_temp为true时有效,https://developer.work.weixin.qq.com/document/path/92572#%E7%BB%93%E6%9D%9F%E8%AF%AD%E5%AE%9A%E4%B9%89
Conclusions Conclusions `json:"conclusions"`
}
ExternalContactWay 配置客户联系「联系我」方式
type ExternalGroupChatJoinWay ¶
type ExternalGroupChatJoinWay struct {
// Scene 场景,1 - 群的小程序插件,2 - 群的二维码插件
Scene int `json:"scene"`
// Remark 联系方式的备注信息,用于助记,超过30个字符将被截断
Remark string `json:"remark"`
// AutoCreateRoom 当群满了后,是否自动新建群。0-否;1-是。 默认为1
AutoCreateRoom int `json:"auto_create_room"`
// RoomBaseName 自动建群的群名前缀,当auto_create_room为1时有效。最长40个utf8字符
RoomBaseName string `json:"room_base_name"`
// RoomBaseID 自动建群的群起始序号,当auto_create_room为1时有效
RoomBaseID int `json:"room_base_id"`
// ChatIDs 使用该配置的客户群ID列表,支持5个。
ChatIDs []string `json:"chat_id_list"`
// State 企业自定义的state参数,用于区分不同的入群渠道。不超过30个UTF-8字符
State string `json:"state"`
}
ExternalGroupChatJoinWay 配置客户群「加入群聊」方式
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 {
// 添加了外部联系人的企业成员
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"`
// 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 GroupChatList ¶
type GroupChatList struct {
// ChatID 客户群ID
ChatID string `json:"chat_id"`
// Status 客户群跟进状态 0 - 跟进人正常 1 - 跟进人离职 2 - 离职继承中 3 - 离职继承完成
Status int64 `json:"status"`
}
GroupChatList 客户群列表数据
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 HorizontalContentList ¶
type HorizontalContentList struct {
// 二级标题,建议不超过5个字
KeyName string `json:"keyname"`
// 二级文本,如果horizontal_content_list.type是2,该字段代表文件名称(要包含文件类型),建议不超过30个字,(支持id转译)
Value string `json:"value"`
// 链接类型,0或不填代表不是链接,1 代表跳转url,2 代表下载附件,3 代表点击跳转成员详情
Type int `json:"type,omitempty"`
// 链接跳转的url,horizontal_content_list.type是1时必填
URL string `json:"url,omitempty"`
// 附件的media_id,horizontal_content_list.type是2时必填
MediaID string `json:"media_id,omitempty"`
// 成员详情的userid,horizontal_content_list.type是3时必填
Userid string `json:"userid,omitempty"`
}
HorizontalContentList 二级标题+文本列表,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过6
type ITokenProvider ¶
type ITokenProvider interface {
// GetToken 取回一个 token。有可能被并发调用。
GetToken(context.Context) (string, error)
}
ITokenProvider 是鉴权 token 的外部提供者需要实现的 interface。可用于官方所谓 使用“中控服务”集中提供、刷新 token 的场景。
不同类型的 tokens(如 access token、JSAPI token 等)都是这个 interface 提供, 实现方需要自行掌握 token 的类别,避免在 client 构造函数的选项中传入错误的种类。
type Image ¶
type Image struct {
// MediaID 图片的media_id
MediaID string `json:"media_id"`
// PicURL 图片的url
PicURL string `json:"pic_url"`
}
Image 图片类型消息
type ImageMessageExtras ¶
type ImageMessageExtras interface {
// GetPicURL 返回图片消息的图片链接 URL。
GetPicURL() string
// GetMediaID 返回图片消息的图片媒体文件 ID。
//
// 可以调用【获取媒体文件】接口拉取,仅三天内有效。
GetMediaID() string
// contains filtered or unexported methods
}
ImageMessageExtras 图片消息的参数。
type ImageTextArea ¶
type ImageTextArea struct {
// 左图右文样式区域点击事件,0或不填代表没有点击事件,1 代表跳转url,2 代表跳转小程序
Type int `json:"type"`
// 点击跳转的url,image_text_area.type是1时必填
URL string `json:"url"`
// 点击跳转的小程序的appid,必须是与当前应用关联的小程序,image_text_area.type是2时必填
AppID string `json:"appid,omitempty"`
// 点击跳转的小程序的pagepath,image_text_area.type是2时选填
PagePath string `json:"pagepath,omitempty"`
// 左图右文样式的标题
Title string `json:"title"`
// 左图右文样式的描述
Desc string `json:"desc"`
// 左图右文样式的图片url
ImageURL string `json:"image_url"`
}
ImageTextArea 左图右文样式,news_notice类型的卡片,card_image和image_text_area两者必填一个字段,不可都不填
type JSCodeSession ¶
type JSCodeSession struct {
CorpID string `json:"corpid"`
UserID string `json:"userid"`
SessionKey string `json:"session_key"`
}
JSCodeSession 临时登录凭证
type JumpList ¶
type JumpList struct {
// 跳转链接类型,0或不填代表不是链接,1 代表跳转url,2 代表跳转小程序
Type int `json:"type"`
// 跳转链接样式的文案内容,建议不超过18个字
Title string `json:"title"`
// 跳转链接的url,jump_list.type是1时必填
URL string `json:"url,omitempty"`
// 跳转链接的小程序的appid,必须是与当前应用关联的小程序,jump_list.type是2时必填
Appid string `json:"appid,omitempty"`
// 跳转链接的小程序的pagepath,jump_list.type是2时选填
PagePath string `json:"pagepath,omitempty"`
}
JumpList 跳转指引样式的列表,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过3
type KfAccount ¶
type KfAccount struct {
// OpenKfID 客服账号ID
OpenKfID string `json:"open_kfid"`
// Name 客服名称
Name string `json:"name"`
// Avatar 客服头像URL
Avatar string `json:"avatar"`
// ManagePrivilege 当前调用接口的应用身份,是否有该客服账号的管理权限(编辑客服账号信息、分配会话和收发消息)。组件应用不返回此字段
ManagePrivilege bool `json:"manage_privilege,omitempty"`
}
KfAccount 客服账号
type KfEvent ¶
type KfEvent struct {
// EventType 事件类型
EventType KfEventType `json:"event_type"`
// OpenKfID 客服账号ID
OpenKfID string `json:"open_kfid"`
// ExternalUserID 客户UserID,注意不是企业成员的帐号
ExternalUserID string `json:"external_userid,omitempty"`
// ServicerUserID 接待人员userid
ServicerUserID string `json:"servicer_userid,omitempty"`
// Scene 用户进入会话事件特有。进入会话的场景值,获取客服账号链接开发者自定义的场景值
Scene string `json:"scene,omitempty"`
// SceneParam 用户进入会话事件特有。进入会话的自定义参数,获取客服账号链接返回的url,开发者按规范拼接的scene_param参数
SceneParam string `json:"scene_param,omitempty"`
// WelcomeCode 用户进入会话事件特有。如果满足发送欢迎语条件(条件为:用户在过去48小时里未收过欢迎语,且未向客服发过消息),会返回该字段。可用该welcome_code调用发送事件响应消息接口给客户发送欢迎语。
WelcomeCode string `json:"welcome_code,omitempty"`
// WechatChannels 用户进入会话事件特有。进入会话的视频号信息,从视频号进入会话才有值
WechatChannels KfWechatChannels `json:"wechat_channels,omitempty"`
// FailMsgID 消息发送失败事件特有。发送失败的消息msgid
FailMsgID string `json:"fail_msgid,omitempty"`
// FailType 消息发送失败事件特有。失败类型。0-未知原因 1-客服账号已删除 2-应用已关闭 4-会话已过期,超过48小时 5-会话已关闭 6-超过5条限制 8-主体未验证 10-用户拒收 11-企业未有成员登录企业微信App(排查方法:企业至少一个成员通过手机号验证/微信授权登录企业微信App即可)12-发送的消息为客服组件禁发的消息类型
FailType int `json:"fail_type,omitempty"`
// Status 接待人员接待状态变更事件特有。状态类型。1-接待中 2-停止接待
Status int `json:"status,omitempty"`
// StopType 接待人员接待状态变更事件特有。接待人员的状态为「停止接待」的子类型。0:停止接待,1:暂时挂起
StopType int `json:"stop_type,omitempty"`
// ChangeType 会话状态变更事件特有。变更类型,均为接待人员在企业微信客户端操作触发。1-从接待池接入会话 2-转接会话 3-结束会话 4-重新接入已结束/已转接会话
ChangeType KfServiceState `json:"change_type,omitempty"`
// OldServicerUserID 会话状态变更事件特有。老的接待人员userid。仅change_type为2、3和4有值
OldServicerUserID string `json:"old_servicer_userid,omitempty"`
// NewServicerUserid 会话状态变更事件特有。新的接待人员userid。仅change_type为1、2和4有值
NewServicerUserid string `json:"new_servicer_userid,omitempty"`
// MsgCode 会话状态变更事件特有。用于发送事件响应消息的code,仅change_type为1和3时,会返回该字段。可用该msg_code调用发送事件响应消息接口给客户发送回复语或结束语。
MsgCode string `json:"msg_code,omitempty"`
// RecallMsgID 撤回消息事件特有。 撤回的消息msgid
RecallMsgID string `json:"recall_msgid,omitempty"`
// RejectSwitch 拒收客户消息变更事件特有。 拒收客户消息,1表示接待人员拒收了客户消息,0表示接待人员取消拒收客户消息
RejectSwitch int `json:"reject_switch,omitempty"`
}
KfEvent 客服会话事件
type KfEventType ¶
type KfEventType string
KfEventType 事件类型
const ( // KfEventTypeEnterSession 用户进入会话事件 KfEventTypeEnterSession KfEventType = "enter_session" // KfEventTypeMsgSendFail 消息发送失败事件 KfEventTypeMsgSendFail KfEventType = "msg_send_fail" // KfEventTypeServicerStatusChange 接待人员接待状态变更事件 KfEventTypeServicerStatusChange KfEventType = "servicer_status_change" // KfEventTypeSessionStatusChange 会话状态变更事件 KfEventTypeSessionStatusChange KfEventType = "session_status_change" // KfEventTypeUserRecallMsg 用户撤回消息事件 KfEventTypeUserRecallMsg KfEventType = "user_recall_msg" // KfEventTypeServicerRecallMsg 接待人员撤回消息事件 KfEventTypeServicerRecallMsg KfEventType = "servicer_recall_msg" // KfEventTypeRejectCustomerMsgSwitchChange 拒收客户消息变更事件 KfEventTypeRejectCustomerMsgSwitchChange KfEventType = "reject_customer_msg_switch_change" )
type KfMsg ¶
type KfMsg struct {
// MsgID 消息ID
MsgID string `json:"msgid,omitempty"`
// OpenKfID 客服账号ID(msgtype为event,该字段不返回)
OpenKfID string `json:"open_kfid,omitempty"`
// ExternalUserID 客客户UserID(msgtype为event,该字段不返回)
ExternalUserID string `json:"external_userid,omitempty"`
// SendTime 消息发送时间
SendTime int64 `json:"send_time,omitempty"`
// Origin 消息来源。3-微信客户发送的消息 4-系统推送的事件消息 5-接待人员在企业微信客户端发送的消息
Origin int `json:"origin,omitempty"`
// ServicerUserID 从企业微信给客户发消息的接待人员userid(即仅origin为5才返回;msgtype为event,该字段不返回)
ServicerUserID string `json:"servicer_userid,omitempty"`
// MsgType 消息类型
MsgType MessageType `json:"msgtype"`
// Text 文本消息
Text Text `json:"text,omitempty"`
// Image 图片消息
Image Image `json:"image,omitempty"`
// Link 链接消息
Link Link `json:"link,omitempty"`
// MiniProgram 小程序消息
MiniProgram MiniProgram `json:"mini_program,omitempty"`
// Event 事件类型
Event KfEvent `json:"event,omitempty"`
}
KfMsg 客服消息数据
type KfServiceState ¶
type KfServiceState int
KfServiceState 客服会话状态
0 未处理 新会话接入 1 由智能助手接待 2 待接入池排队中 3 由人工接待 4 已结束/未开始
const ( // KfServiceStateUntreated 未处理 新会话接入 KfServiceStateUntreated KfServiceState = iota // KfServiceStateRobotReception 由智能助手接待 KfServiceStateRobotReception // KfServiceStateInQueue 待接入池排队中 KfServiceStateInQueue // KfServiceStateManualReception 由人工接待 KfServiceStateManualReception // KfServiceStateFinished 已结束/未开始 KfServiceStateFinished )
type KfServicer ¶
type KfServicer struct {
// UserID 接待人员的userid。第三方应用获取到的为密文userid,即open_userid
UserID string `json:"userid,omitempty"`
// Status 接待人员的接待状态。0:接待中,1:停止接待。
Status int `json:"status"`
// StopType 接待人员的接待状态为「停止接待」的子类型。0:停止接待,1:暂时挂起
StopType int `json:"stop_type"`
// DepartmentID 接待人员部门的id
DepartmentID int64 `json:"department_id,omitempty"`
}
KfServicer 客服接待人员
type KfServicerResult ¶
type KfServicerResult struct {
// UserID 接待人员的userid
UserID string `json:"userid,omitempty"`
// DepartmentID 接待人员部门的id
DepartmentID int64 `json:"department_id,omitempty"`
// ErrCode 该条记录的结果
ErrCode int64 `json:"errcode"`
// ErrMsg 结果信息
ErrMsg string `json:"errmsg"`
}
KfServicerResult 接待人员数据
type KfWechatChannels ¶
type KfWechatChannels struct {
// NickName 视频号名称,视频号场景值为1、2、3时返回此项
NickName string `json:"nickname,omitempty"`
// ShopNickName 视频号小店名称,视频号场景值为4、5时返回此项
ShopNickName string `json:"shop_nickname,omitempty"`
// Scene 视频号场景值。1:视频号主页,2:视频号直播间商品列表页,3:视频号商品橱窗页,4:视频号小店商品详情页,5:视频号小店订单页
Scene int64 `json:"scene"`
}
KfWechatChannels 进入会话的视频号信息,从视频号进入会话才有值
type Link ¶
type Link struct {
// Title 图文消息标题,最长为128字节
Title string `json:"title"`
// PicURL 图文消息封面的url
PicURL string `json:"picurl"`
// Desc 图文消息的描述,最长为512字节
Desc string `json:"desc"`
// URL 图文消息的链接
URL string `json:"url"`
}
Link 图文消息
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 MPArticle ¶
type MPArticle struct {
// 标题,不超过128个字节,超过会自动截断(支持id转译)
Title string `json:"title"`
// 图文消息缩略图的media_id, 可以通过素材管理接口获得。此处thumb_media_id即上传接口返回的media_id
ThumbMediaID string `json:"thumb_media_id"`
// 图文消息的作者,不超过64个字节
Author string `json:"author"`
// 图文消息点击“阅读原文”之后的页面链接
ContentSourceURL string `json:"content_source_url"`
// 图文消息的内容,支持html标签,不超过666 K个字节(支持id转译)
Content string `json:"content"`
// 图文消息的描述,不超过512个字节,超过会自动截断(支持id转译)
Digest string `json:"digest"`
}
MPArticle mpnews 类型的文章
type MainTitle ¶
type MainTitle struct {
// 一级标题,建议不超过36个字,文本通知型卡片本字段非必填,但不可本字段和sub_title_text都不填,(支持id转译)
Title string `json:"title"`
// 标题辅助信息,建议不超过160个字,(支持id转译)
Desc string `json:"desc"`
}
MainTitle 一级标题
type Media ¶
type Media struct {
// contains filtered or unexported fields
}
Media 欲上传的素材
NOTE: 由于 Go `mime/multipart` 包的实现细节原因, 暂时不开放 Content-Type 定制,全部传 `application/octet-stream`。 如有需求,请去 GitHub 提 issue。
func NewMediaFromBuffer ¶
NewMediaFromBuffer 从内存创建一个欲上传的素材对象
type MediaUploadResult ¶
type MediaUploadResult struct {
// Type 媒体文件类型,分别有图片(image)、语音(voice)、视频(video),普通文件(file)
Type string
// MediaID 媒体文件上传后获取的唯一标识,3天内有效
MediaID string
// CreatedAt 媒体文件上传时间戳
CreatedAt time.Time
}
MediaUploadResult 临时素材上传结果
type Mentions ¶
type Mentions struct {
// UserIDs userid 的列表,提醒群中的指定成员(@某个成员),MentionAll 表示提醒所有人
//
// 如果开发者获取不到 userid,可使用 Mobiles
UserIDs []string
// Mobiles 手机号列表,提醒手机号对应的群成员(@某个成员),MentionAll 表示提醒所有人
//
// 如果开发者获取不到 userid,可使用该列表,否则可使用 UserIDs
Mobiles []string
}
Mentions 群机器人消息的提醒设置
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 MiniProgram ¶
type MiniProgram struct {
// Title 小程序消息标题,最多64个字节
Title string `json:"title"`
// PicMediaID 小程序消息封面的mediaid,封面图建议尺寸为520*416
PicMediaID string `json:"pic_media_id"`
// AppID 小程序appid(可以在微信公众平台上查询),必须是关联到企业的小程序应用
AppID string `json:"appid"`
// Page 小程序page路径
Page string `json:"page"`
}
MiniProgram 小程序消息
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 string
// 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 OAContentBankAccount ¶
type OAContentBankAccount struct {
// AccountType 账户类型 :1:对公账户,2:个人账户
AccountType uint8 `json:"account_type"`
// AccountName 账户名
AccountName string `json:"account_name"`
// AccountNumber 账号
AccountNumber string `json:"account_number"`
// Remark 备注
Remark string `json:"remark"`
// Bank 银行信息
Bank OAContentBankAccountBank `json:"bank"`
}
OAContentBankAccount 时长组件
type OAContentBankAccountBank ¶
type OAContentBankAccountBank struct {
// BankAlias 银行名称
BankAlias string `json:"bank_alias"`
// BankAliasCode 银行代码
BankAliasCode string `json:"bank_alias_code"`
// Province 省份
Province string `json:"province"`
// ProvinceCode 省份代码
ProvinceCode uint8 `json:"province_code"`
// City 城市
City string `json:"city"`
// CityCode 城市代码
CityCode uint8 `json:"city_code"`
// BankBranchName 银行支行
BankBranchName string `json:"bank_branch_name"`
// BankBranchId 银行支行联行号
BankBranchId string `json:"bank_branch_id"`
}
OAContentBankAccountBank 银行信息
type OAContentDate ¶
type OAContentDate struct {
// Type 时间展示类型:day-日期;hour-日期+时间 ,和对应模板控件属性一致
Type string `json:"type"`
// Timestamp 时间戳-字符串类型,在此填写日期/日期+时间控件的选择值,以此为准
Timestamp string `json:"s_timestamp"`
}
OAContentDate 日期/日期+时间内容
type OAContentDateRange ¶
type OAContentDateRange struct {
// Type 时间展示类型:halfday-日期;hour-日期+时间
Type string `json:"type"`
// NewBegin 开始时间,unix时间戳
NewBegin int `json:"new_begin"`
// NewEnd 结束时间,unix时间戳
NewEnd int `json:"new_end"`
// NewDuration 时长范围,单位秒
NewDuration int `json:"new_duration"`
// PerdayDuration 每天的工作时长
PerdayDuration int `json:"perday_duration"`
// TimezoneInfo 时区信息,只有在非UTC+8的情况下会返回
TimezoneInfo *OAContentDateRangeTimezoneInfo `json:"timezone_info"`
}
OAContentDateRange 时长组件
type OAContentDateRangeTimezoneInfo ¶
type OAContentDateRangeTimezoneInfo struct {
// ZoneOffset 时区偏移量
ZoneOffset string `json:"zone_offset"`
// ZoneDesc 时区描述
ZoneDesc string `json:"zone_desc"`
}
OAContentDateRangeTimezoneInfo 时区信息
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 OAContentPunchCorrection ¶
type OAContentPunchCorrection struct {
// State 异常状态说明
State string `json:"state"`
// Time 补卡时间,Unix时间戳
Time uint64 `json:"time"`
// Version 版本标识,为1的时候为新版补卡,daymonthyear有值
Version uint8 `json:"version"`
// Daymonthyear 补卡日期0点Unix时间戳
Daymonthyear uint64 `json:"daymonthyear"`
}
OAContentPunchCorrection 补卡组件
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"`
// Value 选项值,若配置了多语言则会包含中英文的选项值
Value []OAText `json:"value"`
}
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"`
// SliceInfo 时长支持按天分片信息, 2020/10/01之前的历史表单不支持时长分片
SliceInfo OAContentVacationAttendanceSliceInfo `json:"slice_info"`
}
OAContentVacationAttendance 假勤组件
type OAContentVacationAttendanceDateRange ¶
type OAContentVacationAttendanceDateRange struct {
// Type 时间展示类型:day-日期;hour-日期+时间
Type string `json:"type"`
// 时长范围
OAContentDateRange
}
OAContentVacationAttendanceDateRange 假勤组件时间选择范围
type OAContentVacationAttendanceSliceInfo ¶
type OAContentVacationAttendanceSliceInfo struct {
// Duration 总时长,单位是秒
Duration uint64 `json:"duration"`
// State 时长计算来源类型: 1--系统自动计算;2--用户修改
State uint8 `json:"state"`
// DayItems 时长计算来源类型: 1--系统自动计算;2--用户修改
DayItems []OAContentVacationAttendanceSliceInfoDayItem `json:"day_items"`
}
OAContentVacationAttendanceSliceInfo 假勤组件时长支持按天分片信息, 2020/10/01之前的历史表单不支持时长分片
type OAContentVacationAttendanceSliceInfoDayItem ¶
type OAContentVacationAttendanceSliceInfoDayItem struct {
// Daytime 日期的00:00:00时间戳,Unix时间
Daytime uint64 `json:"daytime"`
// Duration 分隔当前日期的时长秒数
Duration uint64 `json:"duration"`
}
OAContentVacationAttendanceSliceInfoDayItem 假勤组件时长支持按天分片信息,每一天的分片时长信息
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"`
// Tips 说明文字控件(control参数为Tips)
Tips OATemplateControlConfigTips `json:"new_tips"`
// Files 附件控件(control参数为File,且value参数为files)
Files []OAContentFile `json:"files"`
// Table 明细控件(control参数为Table)
Table []OAContentTableList `json:"children"`
// Vacation 假勤组件-请假组件(control参数为Vacation)
Vacation OAContentVacation `json:"vacation"`
// Attendance 假勤组件-出差/外出/加班组件(control参数为Attendance)
Attendance OAContentVacationAttendance `json:"attendance"`
// PunchCorrection 假勤组件-出差/外出/加班组件(control参数为Attendance)
PunchCorrection OAContentPunchCorrection `json:"punch_correction"`
// 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"`
// BankAccount 收款账户控件(control参数为BankAccount)
BankAccount OAContentBankAccount `json:"bank_account"`
}
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 OASetOneUserVacationQuota ¶
type OASetOneUserVacationQuota struct {
UserID string
VacationID string
LeftDuration string
TimeAttr int64
Remarks string
}
OASetOneUserVacationQuota 修改成员假期余额
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"`
// Vacation Vacation控件(假勤控件)【请假】模板特有控件, 请假类型强关联审批应用中的假期管理。
Vacation OATemplateControlConfigVacation `json:"vacation_list"`
// Tips Tips控件(说明文字控件)
Tips OATemplateControlConfigTips `json:"tips"`
}
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 OATemplateControlConfigTips ¶
type OATemplateControlConfigTips struct {
// TipsContent 说明文字数组,元素为不同语言的富文本说明文字
TipsContent []OATemplateControlConfigTipsContent `json:"tips_content"`
}
OATemplateControlConfigTips 类型标志,说明文字控件的config中会包含此参数
type OATemplateControlConfigTipsContent ¶
type OATemplateControlConfigTipsContent struct {
// Text 某个语言的富文本说明文字数组,元素为不同文本类型的说明文字分段
Text OATemplateControlConfigTipsContentText `json:"text"`
// Lang 语言类型
Lang string `json:"lang"`
}
OATemplateControlConfigTipsContent 类型标志,说明文字控件的config中会包含此参数
type OATemplateControlConfigTipsContentSubText ¶
type OATemplateControlConfigTipsContentSubText struct {
// Type 文本类型 1:纯文本 2:链接,每个说明文字中只支持包含一个链接
Type uint8 `json:"type"`
// Content 内容
Content OATemplateControlConfigTipsContentSubTextContent `json:"content"`
}
OATemplateControlConfigTipsContentSubText 类型标志,说明文字控件的config中会包含此参数
type OATemplateControlConfigTipsContentSubTextContent ¶
type OATemplateControlConfigTipsContentSubTextContent struct {
// Text 纯文本类型的内容
Text *OATemplateControlConfigTipsContentSubTextContentPlain `json:"plain_text"`
// Lang 链接类型的内容
Lang *OATemplateControlConfigTipsContentSubTextContentLink `json:"link"`
}
OATemplateControlConfigTipsContentSubTextContent 类型标志,说明文字控件的config中会包含此参数
type OATemplateControlConfigTipsContentSubTextContentLink ¶
type OATemplateControlConfigTipsContentSubTextContentLink struct {
// Title 链接标题
Title string `json:"title"`
// URL 链接url
URL string `json:"url"`
}
OATemplateControlConfigTipsContentSubTextContentLink 类型标志,说明文字控件的config中会包含此参数
type OATemplateControlConfigTipsContentSubTextContentPlain ¶
type OATemplateControlConfigTipsContentSubTextContentPlain struct {
// Content 纯文本文字
Content string `json:"content"`
}
OATemplateControlConfigTipsContentSubTextContentPlain 类型标志,说明文字控件的config中会包含此参数
type OATemplateControlConfigTipsContentText ¶
type OATemplateControlConfigTipsContentText struct {
// SubText 说明文字分段
SubText []OATemplateControlConfigTipsContentSubText `json:"sub_text"`
}
OATemplateControlConfigTipsContentText 类型标志,说明文字控件的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 OptionList ¶
type OptionList struct {
// 下拉式的选择器选项的id,用户提交选项后,会产生回调事件,回调事件会带上该id值表示该选项,最长支持128字节,不可重复
ID string `json:"id"`
// 下拉式的选择器选项的文案,建议不超过16个字
Text string `json:"text"`
}
项列表,下拉选项不超过 10 个,最少1个
type QuoteArea ¶
type QuoteArea struct {
// 引用文献样式区域点击事件,0或不填代表没有点击事件,1 代表跳转url,2 代表跳转小程序
Type int `json:"type"`
// 点击跳转的url,quote_area.type是1时必填
URL string `json:"url"`
// 引用文献样式的标题
Title string `json:"title"`
// 引用文献样式的引用文案
QuoteText string `json:"quote_text"`
// 小程序appid,必须是与当前应用关联的小程序,appid和pagepath必须同时填写,填写后会忽略url字段
AppID string `json:"appid"`
// 点击消息卡片后的小程序页面,最长128字节,仅限本小程序内的页面。appid和pagepath必须同时填写,填写后会忽略url字段
PagePath string `json:"pagepath"`
}
QuoteArea 引用文献样式
type Recipient ¶
type Recipient struct {
// UserIDs 成员ID列表(消息接收者),最多支持1000个
UserIDs []string
// PartyIDs 部门ID列表,最多支持100个。
PartyIDs []string
// TagIDs 标签ID列表,最多支持100个
TagIDs []string
// ChatID 应用关联群聊ID,仅用于【发送消息到群聊会话】
ChatID string
// OpenKfID 应用关联客服ID,仅用于【客服发送消息】
OpenKfID string
// Code 仅用于【客服发送欢迎语等事件响应消息】
Code string
}
Recipient 消息收件人定义
type ReqChatList ¶
type ReqChatList struct {
// StatusFilter 客户群跟进状态过滤
StatusFilter int64 `json:"status_filter"`
// OwnerFilter 群主过滤
OwnerFilter ReqChatListOwnerFilter `json:"owner_filter"`
// Cursor 用于分页查询的游标,字符串类型,由上一次调用返回,首次调用不填
Cursor string `json:"cursor"`
// Limit 分页,预期请求的数据量,取值范围 1 ~ 1000
Limit int64 `json:"limit"`
}
ReqChatList 获取客户群列表参数
type ReqChatListOwnerFilter ¶
type ReqChatListOwnerFilter struct {
// UserIDList 用户ID列表。最多100个
UserIDList []string `json:"userid_list"`
}
ReqChatListOwnerFilter 群主过滤
type RespGroupChatInfo ¶
type RespGroupChatInfo struct {
// ChatID 客户群ID
ChatID string `json:"chat_id"`
// Name 客户群名称
Name string `json:"name"`
// Owner 群主ID
Owner string `json:"owner"`
// CreateTime 群创建时间
CreateTime int64 `json:"create_time"`
// Notice 群公告
Notice string `json:"notice"`
// MemberList 群成员列表
MemberList []*ChatMemberList `json:"member_list"`
// AdminList 群管理员列表
AdminList []*ChatAdminList `json:"admin_list"`
}
RespGroupChatInfo 客户群详情
type RespGroupChatList ¶
type RespGroupChatList struct {
// GroupChatList 客户群列表
GroupChatList []GroupChatList `json:"group_chat_list"`
// NextCursor 分页游标
NextCursor string `json:"next_cursor"`
}
RespGroupChatList 客户群列表结果
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) EventAppMenuClick ¶
EventAppMenuClick 如果消息为应用菜单点击事件通知,则拿出相应消息参数,否则返回 nil, false
func (*RxMessage) EventAppMenuView ¶
EventAppMenuView 如果消息为应用菜单链接点击事件通知,则拿出相应消息参数,否则返回 nil, false
func (*RxMessage) EventAppSubscribe ¶
EventAppSubscribe 如果消息为应用订阅事件通知,则拿出相应消息参数,否则返回 nil, false
func (*RxMessage) EventAppUnsubscribe ¶
EventAppUnsubscribe 如果消息为应用订阅取消事件通知,则拿出相应消息参数,否则返回 nil, false
func (*RxMessage) EventChangeExternalChat ¶
func (m *RxMessage) EventChangeExternalChat() (EventChangeExternalChat, bool)
EventChangeExternalChat 如果消息为客户群变更事件,则拿出相应的消息参数,否则返回 nil, false
func (*RxMessage) EventChangeTypeCreateUser ¶
EventChangeTypeCreateUser 如果消息为创建成员事件通知,则拿出相应消息参数,否则返回 nil, false
func (*RxMessage) EventChangeTypeUpdateUser ¶
EventChangeTypeUpdateUser 如果消息为更新成员事件通知,则拿出相应消息参数,否则返回 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) EventKfMsgOrEvent ¶
EventKfMsgOrEvent 如果消息为客服接收消息和事件,则拿出相应消息参数,否则返回 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) EventUnknown ¶
EventUnknown 未定义的event类型
func (*RxMessage) Image ¶
func (m *RxMessage) Image() (ImageMessageExtras, bool)
Image 如果消息为图片类型,则拿出相应的消息参数,否则返回 nil, false
func (*RxMessage) Link ¶
func (m *RxMessage) Link() (LinkMessageExtras, bool)
Link 如果消息为链接类型,则拿出相应的消息参数,否则返回 nil, false
func (*RxMessage) Location ¶
func (m *RxMessage) Location() (LocationMessageExtras, bool)
Location 如果消息为位置类型,则拿出相应的消息参数,否则返回 nil, false
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 SelectList ¶
type SelectList struct {
// 下拉式的选择器题目的key,用户提交选项后,会产生回调事件,回调事件会带上该key值表示该题,最长支持1024字节,不可重复
QuestionKey string `json:"question_key"`
// 下拉式的选择器上面的title
Title string `json:"title,omitempty"`
// 默认选定的id,不填或错填默认第一个
SelectedID string `json:"selected_id,omitempty"`
OptionList []OptionList `json:"option_list"`
}
SelectList 下拉式的选择器列表,multiple_interaction类型的卡片该字段不可为空,一个消息最多支持 3 个选择器
type SendWelcomeMsgExternalContact ¶
type SendWelcomeMsgExternalContact struct {
// WelcomeCode 通过添加外部联系人事件推送给企业的发送欢迎语的凭证,有效期为20秒
WelcomeCode string `json:"welcome_code"`
// Text 消息文本,最多4000个字节
Text Text `json:"text"`
// Attachments 附件,最多支持添加9个附件
Attachments []Attachments `json:"attachments"`
}
SendWelcomeMsgExternalContact 发送新客户欢迎语请求参数
type SizeType ¶
type SizeType int
SizeType qrcode尺寸类型
1: 171 x 171; 2: 399 x 399; 3: 741 x 741; 4: 2052 x 2052
type Source ¶
type Source struct {
// 来源图片的url,来源图片的尺寸建议为72*72
IconURL string `json:"icon_url"`
// 来源图片的描述,建议不超过20个字,(支持id转译)
Desc string `json:"desc"`
// 来源文字的颜色,目前支持:0(默认) 灰色,1 黑色,2 红色,3 绿色
DescColor int `json:"desc_color"`
}
Source 卡片来源样式信息,不需要来源样式可不填写
type SubmitButton ¶
type SubmitButton struct {
// 按钮文案,建议不超过10个字,不填默认为提交
Text string `json:"text"`
// 提交按钮的key,会产生回调事件将本参数作为EventKey返回,最长支持1024字节
Key string `json:"key"`
}
SubmitButton 提交按钮样式
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 TemplateCard ¶
type TemplateCard struct {
CardType TemplateCardType `json:"card_type"`
Source Source `json:"source"`
ActionMenu *ActionMenu `json:"action_menu,omitempty" validate:"required_with=TaskID"`
TaskID string `json:"task_id,omitempty" validate:"required_with=ActionMenu"`
MainTitle *MainTitle `json:"main_title"`
QuoteArea *QuoteArea `json:"quote_area,omitempty"`
// 文本通知型
EmphasisContent *EmphasisContent `json:"emphasis_content,omitempty"`
SubTitleText string `json:"sub_title_text,omitempty"`
// 图文展示型
ImageTextArea *ImageTextArea `json:"image_text_area,omitempty"`
CardImage *CardImage `json:"card_image,omitempty"`
HorizontalContentList []HorizontalContentList `json:"horizontal_content_list"`
JumpList []JumpList `json:"jump_list"`
CardAction *CardAction `json:"card_action,omitempty"`
// 按钮交互型
ButtonSelection *ButtonSelection `json:"button_selection,omitempty"`
ButtonList []Button `json:"button_list,omitempty" validate:"omitempty,max=6"`
// 投票选择型
CheckBox *CheckBox `json:"checkbox,omitempty"`
SelectList []SelectList `json:"select_list,omitempty" validate:"max=3"`
SubmitButton *SubmitButton `json:"submit_button,omitempty"`
}
type TemplateCardType ¶
type TemplateCardType string
TemplateCardType 模板卡片的类型
const ( CardTypeTextNotice TemplateCardType = "text_notice" // 文本通知型 CardTypeNewsNotice TemplateCardType = "news_notice" // 图文展示型 CardTypeButtonInteraction TemplateCardType = "button_interaction" // 按钮交互型 CardTypeVoteInteraction TemplateCardType = "vote_interaction" // 投票选择型 CardTypeMultipleInteraction TemplateCardType = "multiple_interaction" // 多项选择型 )
type TemplateCardUpdateMessage ¶
type TemplateCardUpdateMessage struct {
UserIDs []string `json:"userids" validate:"omitempty,max=100"`
PartyIDs []int64 `json:"partyids" validate:"omitempty,max=100"`
TagIDs []int32 `json:"tagids" validate:"omitempty,max=100"`
AtAll int `json:"atall,omitempty"`
ResponseCode string `json:"response_code"`
Button struct {
ReplaceName string `json:"replace_name"`
} `json:"button" validate:"required_without=TemplateCard"`
TemplateCard TemplateCard `json:"template_card" validate:"required_without=Button"`
ReplaceText string `json:"replace_text,omitempty"`
}
type Text ¶
type Text struct {
// Content 消息文本内容,最长为4000字节
Content string `json:"content"`
}
Text 文本消息
type TextMessageExtras ¶
type TextMessageExtras interface {
// GetContent 返回文本消息的内容。
GetContent() string
// contains filtered or unexported methods
}
TextMessageExtras 文本消息的参数。
type TransferCustomerResult ¶
type TransferCustomerResult []struct {
// ExternalUserID 转接客户的外部联系人userid
ExternalUserID string `json:"external_userid"`
// Errcode 对此客户进行分配的结果, 具体可参考全局错误码(https://work.weixin.qq.com/api/doc/90000/90135/92125#10649), 0表示成功发起接替,待24小时后自动接替,并不代表最终接替成功
Errcode int `json:"errcode"`
}
type UserDeptInfo ¶
type UserDeptInfo struct {
// DeptID 部门 ID
DeptID int64
// Order 部门内的排序值,默认为0,数值越大排序越前面
Order uint32
// IsLeader 在所在的部门内是否为上级
IsLeader bool
}
UserDeptInfo 用户部门信息
type UserDetail ¶
type UserDetail struct {
UserID string `json:"userid"`
Name string `json:"name,omitempty"`
DeptIDs []int64 `json:"department"`
DeptOrder []uint32 `json:"order"`
Position string `json:"position"`
Mobile string `json:"mobile,omitempty"`
Gender string `json:"gender,omitempty"`
Email string `json:"email,omitempty"`
IsLeaderInDept []int `json:"is_leader_in_dept"`
AvatarURL string `json:"avatar"`
Telephone string `json:"telephone"`
IsEnabled int `json:"enable"`
Alias string `json:"alias"`
Status int `json:"status"`
QRCodeURL string `json:"qr_code"`
}
UserDetail 成员详细信息的公共字段
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 UserVacationQuota ¶
type UserVacationQuota struct {
// ID 假期id
ID uint32 `json:"id"`
// AssignDuration 发放时长,单位为秒
AssignDuration uint32 `json:"assignduration"`
// UsedDuration 使用时长,单位为秒
UsedDuration uint32 `json:"usedduration"`
// LeftDuration 剩余时长,单位为秒
LeftDuration uint32 `json:"leftduration"`
// VacationName 假期名称
VacationName string `json:"vacationname"`
// RealAssignDuration 假期的实际发放时长,通常在设置了按照实际工作时间发放假期后进行计算
RealAssignDuration uint32 `json:"real_assignduration"`
}
UserVacationQuota 假期列表
type Video ¶
type Video struct {
// MediaID 视频的media_id
MediaID string `json:"media_id"`
}
Video 视频消息
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 WebhookClient ¶
type WebhookClient struct {
// contains filtered or unexported fields
}
WebhookClient 群机器人客户端
func NewWebhookClient ¶
func NewWebhookClient(key string, opts ...CtorOption) *WebhookClient
NewWebhookClient 构造一个群机器人客户端对象,需要提供 webhook 的 key。
func (*WebhookClient) SendMarkdownMessage ¶
func (c *WebhookClient) SendMarkdownMessage( content string, ) error
SendMarkdownMessage 发送 Markdown 消息
NOTE: 使用群机器人接口发送 Markdown 消息时,不能传递 Mentions 结构体,而需要使用 `<@userid>` 的特殊扩展语法来表示 at 给定的 userid。
func (*WebhookClient) SendTextMessage ¶
func (c *WebhookClient) SendTextMessage( content string, mentions *Mentions, ) error
SendTextMessage 发送文本消息
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
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 ExternalContactAddCorpTagGroup) (ExternalContactCorpTagGroup, error)
AddExternalContactCorpTag 添加企业客户标签
func (*WorkwxApp) AddKfContact ¶
AddKfContact 获取客服账号链接
func (*WorkwxApp) AddMsgTemplate ¶
func (c *WorkwxApp) AddMsgTemplate(chatType ChatType, sender string, externalUserID []string, text Text, attachments []Attachments) (*AddMsgTemplateDetail, error)
AddMsgTemplate 创建企业群发 https://developer.work.weixin.qq.com/document/path/92135
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)
func (*WorkwxApp) AuthCode2UserInfo ¶
func (c *WorkwxApp) AuthCode2UserInfo(code string) (*AuthCodeUserInfo, error)
AuthCode2UserInfo 获取访问用户身份
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) ConvertOpenGIDToChatID ¶
ConvertOpenGIDToChatID 客户群opengid转换
func (*WorkwxApp) ConvertOpenIDToUserID ¶
ConvertOpenIDToUserID openid转userid
func (*WorkwxApp) ConvertUserIDToOpenID ¶
ConvertUserIDToOpenID userid转openid
func (*WorkwxApp) CreateAppchat ¶
CreateAppchat 创建群聊会话
func (*WorkwxApp) CreateDept ¶
CreateDept 创建部门
func (*WorkwxApp) CreateKfAccount ¶
CreateKfAccount 创建客服账号
func (*WorkwxApp) CreateKfServicer ¶
func (c *WorkwxApp) CreateKfServicer(openKfID string, userIDs []string, departmentIDs []int64) (resultList []*KfServicerResult, err error)
CreateKfServicer 创建接待人员
func (*WorkwxApp) DelExternalContactCorpTag ¶
DelExternalContactCorpTag 删除企业客户标签
func (*WorkwxApp) DeleteKfAccount ¶
DeleteKfAccount 删除客服账号
func (*WorkwxApp) DeleteKfServicer ¶
func (c *WorkwxApp) DeleteKfServicer(openKfID string, userIDs []string, departmentIDs []int64) (resultList []*KfServicerResult, err error)
DeleteKfServicer 删除接待人员
func (*WorkwxApp) EditExternalContactCorpTag ¶
EditExternalContactCorpTag 编辑企业客户标签
func (*WorkwxApp) ExternalContactAddContact ¶
func (c *WorkwxApp) ExternalContactAddContact(t int, scene int, style int, remark string, skipVerify bool, state string, user []string, party []int, isTemp bool, expiresIn int, chatExpiresIn int, unionID string, conclusions Conclusions) (*ExternalContactAddContact, error)
ExternalContactAddContact 配置客户联系「联系我」方式
func (*WorkwxApp) ExternalContactAddGroupChatJoinWay ¶
func (c *WorkwxApp) ExternalContactAddGroupChatJoinWay(externalGroupChatJoinWay ExternalGroupChatJoinWay) (string, error)
ExternalContactAddGroupChatJoinWay 配置客户群「加入群聊」方式
func (*WorkwxApp) ExternalContactCloseTempChat ¶
ExternalContactCloseTempChat 结束临时会话
func (*WorkwxApp) ExternalContactDelContactWay ¶
ExternalContactDelContactWay 删除企业已配置的「联系我」方式
func (*WorkwxApp) ExternalContactDelGroupChatJoinWay ¶
ExternalContactDelGroupChatJoinWay 删除企业已配置的客户群「加入群聊」方式
func (*WorkwxApp) ExternalContactGetContactWay ¶
func (c *WorkwxApp) ExternalContactGetContactWay(configID string) (*ExternalContactContactWay, error)
ExternalContactGetContactWay 获取企业已配置的「联系我」方式
func (*WorkwxApp) ExternalContactGetGroupChatJoinWay ¶
func (c *WorkwxApp) ExternalContactGetGroupChatJoinWay(configID string) (*ExternalContactGroupChatJoinWay, error)
ExternalContactGetGroupChatJoinWay 获取企业已配置的客户群「加入群聊」方式
func (*WorkwxApp) ExternalContactListContactWayChat ¶
func (c *WorkwxApp) ExternalContactListContactWayChat(startTime int, endTime int, cursor string, limit int) (*ExternalContactListContactWayChat, error)
ExternalContactListContactWayChat 获取企业已配置的「联系我」列表
func (*WorkwxApp) ExternalContactListFollowUser ¶
func (c *WorkwxApp) ExternalContactListFollowUser() (*ExternalContactFollowUserList, error)
ExternalContactListFollowUser 获取配置了客户联系功能的成员列表
func (*WorkwxApp) ExternalContactTransferGroupChat ¶
func (c *WorkwxApp) ExternalContactTransferGroupChat(chatIDList []string, newOwner string) ([]ExternalContactGroupChatTransferFailed, error)
ExternalContactTransferGroupChat 离职成员的群再分配
func (*WorkwxApp) ExternalContactUpdateContactWay ¶
func (c *WorkwxApp) ExternalContactUpdateContactWay(configID string, remark string, skipVerify bool, style int, state string, user []string, party []int, expiresIn int, chatExpiresIn int, unionid string, conclusions Conclusions) error
ExternalContactUpdateContactWay 更新企业已配置的「联系我」成员配置
func (*WorkwxApp) ExternalContactUpdateGroupChatJoinWay ¶
func (c *WorkwxApp) ExternalContactUpdateGroupChatJoinWay(configID string, externalGroupChatJoinWay ExternalGroupChatJoinWay) error
ExternalContactUpdateGroupChatJoinWay 更新企业已配置的客户群「加入群聊」方式
func (*WorkwxApp) GetAppChatInfo ¶
func (c *WorkwxApp) GetAppChatInfo(chatID string) (*RespAppChatInfo, error)
GetAppChatInfo 获取客户群详细信息 企业微信接口调整 此API同GetGroupChatInfo 兼容处理
func (*WorkwxApp) GetAppChatList ¶
func (c *WorkwxApp) GetAppChatList(req ReqChatList) (*RespAppchatList, error)
GetAppChatList 获取客户群列表 企业微信接口调整 此API同GetGroupChatList 兼容处理
func (*WorkwxApp) GetAppchat ¶
GetAppchat 获取群聊会话
func (*WorkwxApp) GetExternalContact ¶
func (c *WorkwxApp) GetExternalContact(externalUserID string) (*ExternalContactInfo, error)
GetExternalContact 获取客户详情
func (*WorkwxApp) GetGroupChatInfo ¶
func (c *WorkwxApp) GetGroupChatInfo(chatID string, chatNeedName int64) (*RespGroupChatInfo, error)
GetGroupChatInfo 获取客户群详细信息
func (*WorkwxApp) GetGroupChatList ¶
func (c *WorkwxApp) GetGroupChatList(req ReqChatList) (*RespGroupChatList, error)
GetGroupChatList 获取客户群列表
func (*WorkwxApp) GetJSAPITicket ¶
GetJSAPITicket 获取 JSAPI_ticket
func (*WorkwxApp) GetJSAPITicketAgentConfig ¶
GetJSAPITicketAgentConfig 获取 JSAPI_ticket_agent_config
func (*WorkwxApp) GetKfServiceState ¶
func (c *WorkwxApp) GetKfServiceState(openKfID, externalUserID string) (KfServiceState, string, error)
GetKfServiceState 获取会话状态
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) GetOAGetCorpVacationConf ¶
func (c *WorkwxApp) GetOAGetCorpVacationConf() ([]CorpVacationConf, error)
GetOAGetCorpVacationConf 获取企业假期管理配置
func (*WorkwxApp) GetOAGetUserVacationQuota ¶
func (c *WorkwxApp) GetOAGetUserVacationQuota(userID string) ([]UserVacationQuota, error)
GetOAGetUserVacationQuota 获取成员假期余额
func (*WorkwxApp) GetOATemplateDetail ¶
func (c *WorkwxApp) GetOATemplateDetail(templateID string) (*OATemplateDetail, error)
GetOATemplateDetail 获取审批模板详情
func (*WorkwxApp) GetTransferCustomerResult ¶
func (c *WorkwxApp) GetTransferCustomerResult(handoverUserID, takeoverUserID, cursor string) (*CustomerTransferResult, error)
GetTransferCustomerResult 在职继承 查询客户接替状态
func (*WorkwxApp) GetTransferExternalContactResult ¶
func (c *WorkwxApp) GetTransferExternalContactResult(externalUserID, handoverUserID, takeoverUserID string) (*ExternalContactTransferResult, error)
GetTransferExternalContactResult 查询客户接替结果
func (*WorkwxApp) GetTransferResignedCustomerResult ¶
func (c *WorkwxApp) GetTransferResignedCustomerResult(handoverUserID, takeoverUserID, cursor string) (*CustomerTransferResult, error)
GetTransferResignedCustomerResult 离职继承 查询客户接替状态
func (*WorkwxApp) GetUserIDByEmail ¶
GetUserIDByEmail 通过邮箱获取 userid
func (*WorkwxApp) GetUserIDByMobile ¶
GetUserIDByMobile 通过手机号获取 userid
func (*WorkwxApp) GetUserInfoByCode ¶
func (c *WorkwxApp) GetUserInfoByCode(code string) (*UserIdentityInfo, error)
GetUserInfoByCode 获取访问用户身份,根据code获取成员信息
func (*WorkwxApp) GetUserJoinQrcode ¶
GetUserJoinQrcode 获取加入企业二维码
func (*WorkwxApp) JSCode2Session ¶
func (c *WorkwxApp) JSCode2Session(jscode string) (*JSCodeSession, error)
JSCode2Session 临时登录凭证校验
func (*WorkwxApp) KfSyncMsg ¶
func (c *WorkwxApp) KfSyncMsg(openKfID, token, cursor string, limit int64, voiceFormat int) ([]KfMsg, int, string, error)
KfSyncMsg 微信客服获取消息列表
func (*WorkwxApp) ListAllDepts ¶
ListAllDepts 获取全量组织架构。
func (*WorkwxApp) ListExternalContact ¶
ListExternalContact 获取客户列表
func (*WorkwxApp) ListExternalContactCorpTags ¶
func (c *WorkwxApp) ListExternalContactCorpTags(tagIDs ...string) ([]ExternalContactCorpTagGroup, error)
ListExternalContactCorpTags 获取企业标签库
func (*WorkwxApp) ListKfAccount ¶
ListKfAccount 获取客服账号列表
func (*WorkwxApp) ListKfServicer ¶
func (c *WorkwxApp) ListKfServicer(openKfID string) ([]*KfServicer, error)
ListKfServicer 获取接待人员列表
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 ¶
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) ResignedTransferCustomer ¶
func (c *WorkwxApp) ResignedTransferCustomer(handoverUserID, takeoverUserID string, externalUserIDs []string) (TransferCustomerResult, error)
ResignedTransferCustomer 离职继承 分配离职成员的客户 一次最多转移100个客户
func (*WorkwxApp) SendFileMessage ¶
SendFileMessage 发送文件消息
收件人参数如果仅设置了 `ChatID` 字段,则为【发送消息到群聊会话】接口调用; 否则为单纯的【发送应用消息】接口调用。
func (*WorkwxApp) SendImageMessage ¶
SendImageMessage 发送图片消息
收件人参数如果仅设置了 `ChatID` 字段,则为【发送消息到群聊会话】接口调用; 否则为单纯的【发送应用消息】接口调用。
func (*WorkwxApp) SendMPNewsMessage ¶
func (c *WorkwxApp) SendMPNewsMessage( recipient *Recipient, mparticles []MPArticle, isSafe bool, ) error
SendMPNewsMessage 发送 mpnews 类型的图文消息
收件人参数如果仅设置了 `ChatID` 字段,则为【发送消息到群聊会话】接口调用; 否则为单纯的【发送应用消息】接口调用。
func (*WorkwxApp) SendMarkdownMessage ¶
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 ¶
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) SendTemplateCardMessage ¶
func (c *WorkwxApp) SendTemplateCardMessage( recipient *Recipient, templateCard TemplateCard, isSafe bool, ) error
SendTemplateCardMessage 发送卡片模板消息
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 ¶
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)
func (*WorkwxApp) SendVideoMessage ¶
func (c *WorkwxApp) SendVideoMessage( recipient *Recipient, mediaID string, description string, title string, isSafe bool, ) error
SendVideoMessage 发送视频消息
收件人参数如果仅设置了 `ChatID` 字段,则为【发送消息到群聊会话】接口调用; 否则为单纯的【发送应用消息】接口调用。
func (*WorkwxApp) SendVoiceMessage ¶
SendVoiceMessage 发送语音消息
收件人参数如果仅设置了 `ChatID` 字段,则为【发送消息到群聊会话】接口调用; 否则为单纯的【发送应用消息】接口调用。
func (*WorkwxApp) SendWelcomeMsg ¶
func (c *WorkwxApp) SendWelcomeMsg(welcomeCode string, text Text, attachments []Attachments) error
SendWelcomeMsg 发送新客户欢迎语 https://developer.work.weixin.qq.com/document/path/92137
func (*WorkwxApp) SetOAOneUserVacationQuota ¶
func (c *WorkwxApp) SetOAOneUserVacationQuota(req OASetOneUserVacationQuota) error
SetOAOneUserVacationQuota 修改成员假期余额
func (*WorkwxApp) SimpleListAllDepts ¶
SimpleListAllDepts 获取全量组织架构(简易)。
func (*WorkwxApp) SimpleListDepts ¶
SimpleListDepts 获取指定部门及其下的子部门(简易)。
func (*WorkwxApp) SpawnAccessTokenRefresher ¶
func (c *WorkwxApp) SpawnAccessTokenRefresher()
SpawnAccessTokenRefresher 启动该 app 的 access token 刷新 goroutine
如果使用了外部 token provider 提供 access token 则没有必要调用此方法:调用效果为空操作。
NOTE: 该 goroutine 本身没有 keep-alive 逻辑,需要自助保活
func (*WorkwxApp) SpawnAccessTokenRefresherWithContext ¶
SpawnAccessTokenRefresherWithContext 启动该 app 的 access token 刷新 goroutine 可以通过 context cancellation 停止此 goroutine
如果使用了外部 token provider 提供 access token 则没有必要调用此方法:调用效果为空操作。
NOTE: 该 goroutine 本身没有 keep-alive 逻辑,需要自助保活
func (*WorkwxApp) SpawnJSAPITicketAgentConfigRefresher ¶
func (c *WorkwxApp) SpawnJSAPITicketAgentConfigRefresher()
SpawnJSAPITicketAgentConfigRefresher 启动该 app 的 JSAPI_ticket_agent_config 刷新 goroutine
如果使用了外部 token provider 提供 JSAPI ticket agent config 则没有必要调用此方法:调用效果为空操作。
NOTE: 该 goroutine 本身没有 keep-alive 逻辑,需要自助保活
func (*WorkwxApp) SpawnJSAPITicketAgentConfigRefresherWithContext ¶
SpawnJSAPITicketAgentConfigRefresherWithContext 启动该 app 的 JSAPI_ticket_agent_config 刷新 goroutine 可以通过 context cancellation 停止此 goroutine
如果使用了外部 token provider 提供 JSAPI ticket agent config 则没有必要调用此方法:调用效果为空操作。
NOTE: 该 goroutine 本身没有 keep-alive 逻辑,需要自助保活
func (*WorkwxApp) SpawnJSAPITicketRefresher ¶
func (c *WorkwxApp) SpawnJSAPITicketRefresher()
SpawnJSAPITicketRefresher 启动该 app 的 JSAPI_ticket 刷新 goroutine
如果使用了外部 token provider 提供 JSAPI ticket 则没有必要调用此方法:调用效果为空操作。
NOTE: 该 goroutine 本身没有 keep-alive 逻辑,需要自助保活
func (*WorkwxApp) SpawnJSAPITicketRefresherWithContext ¶
SpawnJSAPITicketRefresherWithContext 启动该 app 的 JSAPI_ticket 刷新 goroutine 可以通过 context cancellation 停止此 goroutine
如果使用了外部 token provider 提供 JSAPI ticket 则没有必要调用此方法:调用效果为空操作。
NOTE: 该 goroutine 本身没有 keep-alive 逻辑,需要自助保活
func (*WorkwxApp) TransKfServiceState ¶
func (c *WorkwxApp) TransKfServiceState(openKfID, externalUserID, servicerUserID string, ServiceState KfServiceState) (string, error)
TransKfServiceState 变更会话状态
func (*WorkwxApp) TransferCustomer ¶
func (c *WorkwxApp) TransferCustomer(handoverUserID, takeoverUserID string, externalUserIDs []string) (TransferCustomerResult, error)
TransferCustomer 在职继承 分配在职成员的客户 一次最多转移100个客户 为保障客户服务体验,90个自然日内,在职成员的每位客户仅可被转接2次
func (*WorkwxApp) TransferExternalContact ¶
func (c *WorkwxApp) TransferExternalContact(externalUserID, handoverUserID, takeoverUserID, transferSuccessMsg string) error
TransferExternalContact 分配成员的客户
func (*WorkwxApp) UpdateAppchat ¶
func (c *WorkwxApp) UpdateAppchat(chatInfo ChatInfo, addMemberUserIDs, delMemberUserIDs []string) (err error)
UpdateAppchat 修改群聊会话
func (*WorkwxApp) UpdateKfAccount ¶
UpdateKfAccount 修改客服账号
func (*WorkwxApp) UpdateUser ¶
func (c *WorkwxApp) UpdateUser(userDetail *UserDetail) error
UpdateUser 更新成员
func (*WorkwxApp) UploadPermanentImageMedia ¶
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
Source Files
¶
- apis.md.go
- appchat.go
- chat_info.md.go
- client.go
- client_options.go
- dept_info.go
- dept_info.md.go
- dummy_for_generate.go
- errors.go
- external_contact.go
- external_contact.md.go
- kf.go
- kf.md.go
- media.go
- media_api.go
- message.go
- models.go
- msg_audit.go
- oa.go
- oa.md.go
- recipient.go
- rx.go
- rx_msg.go
- rx_msg.md.go
- rx_msg_extras.go
- token.go
- traits.go
- user_info.go
- user_info.md.go
- user_info_helper.go
- webhook_client.go
- webhook_message.go