Documentation ¶
Index ¶
- type ActionList
- type ActionMenu
- type ApprovalInfo
- type ApprovalNode
- type ApprovalNodes
- type ArticleResponseMessage
- type Articles
- type BaseMessageOptions
- type BaseMessageSchema
- type BaseSendGroupMessage
- type BaseTemplateCardUpdateMessage
- type BaseTemplateCardUpdateSchema
- type BatchJobApplication
- type BatchJobResultApplicationCallbackMessage
- type Button
- type ButtonActionList
- type ButtonActionMenu
- type ButtonButtonList
- type ButtonButtonSelection
- type ButtonCardAction
- type ButtonHorizontalContentList
- type ButtonJumpList
- type ButtonList
- type ButtonMainTitle
- type ButtonOptionList
- type ButtonQuoteArea
- type ButtonResponseMessage
- type ButtonSelection
- type ButtonSource
- type ButtonTemplateCard
- type CallbackMessage
- type CardAction
- type CardImage
- type ChatInfo
- type Checkbox
- type CheckboxUpdateVote
- type ClickCallbackMessage
- type Client
- func (r *Client) CreateGroup(options CreateGroupOptions) (info CreateGroupSchema, err error)
- func (r *Client) GetCallbackMessage(signatureOptions SignatureOptions, encryptedMsg []byte) (rawData []byte, msg CallbackMessage, err error)
- func (r *Client) GetGroup(options GetGroupOptions) (info GetGroupSchema, err error)
- func (r *Client) RecallMessage(options interface{}) (info util.CommonError, err error)
- func (r *Client) SendGroupMessage(options interface{}) (info util.CommonError, err error)
- func (r *Client) SendMessage(options interface{}) (info BaseMessageSchema, err error)
- func (r *Client) UpdateGroup(options UpdateGroupOptions) (info util.CommonError, err error)
- func (r *Client) UpdateTemplateCard(options interface{}) (info BaseTemplateCardUpdateSchema, err error)
- func (r *Client) VerifyURL(options SignatureOptions) (string, error)
- type ContentItem
- type CreateGroupOptions
- type CreateGroupSchema
- type CreatePartyCallbackMessage
- type CreateUserCallbackMessage
- type DeletePartyCallbackMessage
- type DeleteUserCallbackMessage
- type EmphasisContent
- type EnterAgentCallbackMessage
- type Error
- type File
- type FileMessageOptions
- type GetGroupOptions
- type GetGroupSchema
- type HorizontalContentList
- type Image
- type ImageMessageOptions
- type ImageResponseMessage
- type ImageTextActionList
- type ImageTextActionMenu
- type ImageTextArea
- type ImageTextCardAction
- type ImageTextCardImage
- type ImageTextHorizontalContentList
- type ImageTextImageTextArea
- type ImageTextJumpList
- type ImageTextMainTitle
- type ImageTextQuoteArea
- type ImageTextSource
- type ImageTextTemplateCard
- type ImageTextVerticalContentList
- type Item
- type Items
- type JumpList
- type LocationCallbackMessage
- type LocationSelectCallbackMessage
- type MainTitle
- type Markdown
- type MarkdownMessageOptions
- type MiniprogramNotice
- type MiniprogramNoticeMessageOptions
- type Mpnews
- type MpnewsArticles
- type MpnewsMessageOptions
- type News
- type NewsMessageOptions
- type NotifyNode
- type NotifyNodes
- type OpenApprovalChangeCallbackMessage
- type OpenApprovalItem
- type OptionIds
- type OptionList
- type OptionListVote
- type PicList
- type PicSysphotoCallbackMessage
- type QuoteArea
- type RecallMessageOptions
- type ResponseArticles
- type ResponseButton
- type ResponseImage
- type ResponseItem
- type ResponseMessage
- type ResponseVideo
- type ResponseVoice
- type ScanCodeInfo
- type ScancodeCallbackMessage
- type SelectList
- type SelectListUpdateFunction
- type SelectMainTitle
- type SelectOptionList
- type SelectSelectList
- type SelectSource
- type SelectSubmitButton
- type SelectTemplateCard
- type SelectedItem
- type SelectedItems
- type SendGroupFileMessage
- type SendGroupFileMessageOptions
- type SendGroupImageMessage
- type SendGroupImageMessageOptions
- type SendGroupMarkdownMessage
- type SendGroupMarkdownMessageOptions
- type SendGroupMpnewsArticlesMessage
- type SendGroupMpnewsMessage
- type SendGroupMpnewsMessageOptions
- type SendGroupNewsArticlesMessage
- type SendGroupNewsMessage
- type SendGroupNewsMessageOptions
- type SendGroupTextMessage
- type SendGroupTextMessageOptions
- type SendGroupTextcardMessage
- type SendGroupTextcardMessageOptions
- type SendGroupVideoMessage
- type SendGroupVideoMessageOptions
- type SendGroupVoiceMessage
- type SendGroupVoiceMessageOptions
- type SendLocationInfo
- type SendPicsInfo
- type ShareAgentChangeCallbackMessage
- type SignatureOptions
- type Source
- type SourceFunction
- type SourceVote
- type SubmitButton
- type SubscribeCallbackMessage
- type TemplateCard
- type TemplateCardButton
- type TemplateCardButtonMessageOptions
- type TemplateCardButtonResponseMessage
- type TemplateCardEventCallbackMessage
- type TemplateCardFunction
- type TemplateCardFunctionMessageOptions
- type TemplateCardImage
- type TemplateCardImageMessageOptions
- type TemplateCardImageTextResponseMessage
- type TemplateCardMenuEventCallbackMessage
- type TemplateCardMessageOptions
- type TemplateCardSelectResponseMessage
- type TemplateCardTextResponseMessage
- type TemplateCardUpdateButton
- type TemplateCardUpdateButtonMessageOptions
- type TemplateCardUpdateFunction
- type TemplateCardUpdateFunctionMessageOptions
- type TemplateCardUpdateImage
- type TemplateCardUpdateImageMessageOptions
- type TemplateCardUpdateMessageOptions
- type TemplateCardUpdateText
- type TemplateCardUpdateTextMessageOptions
- type TemplateCardUpdateVote
- type TemplateCardUpdateVoteMessageOptions
- type TemplateCardVote
- type TemplateCardVoteMessageOptions
- type TemplateCardVoteResponseMessage
- type Text
- type TextActionList
- type TextActionMenu
- type TextCardAction
- type TextEmphasisContent
- type TextHorizontalContentList
- type TextJumpList
- type TextMainTitle
- type TextMessageOptions
- type TextQuoteArea
- type TextResponseMessage
- type TextSource
- type TextTemplateCard
- type Textcard
- type TextcardMessageOptions
- type UpdateGroupOptions
- type UpdatePartyCallbackMessage
- type UpdateTagCallbackMessage
- type UpdateUserCallbackMessage
- type VerticalContentList
- type Video
- type VideoMessageOptions
- type VideoResponseMessage
- type ViewCallbackMessage
- type Voice
- type VoiceMessageOptions
- type VoiceResponseMessage
- type VoteCheckBox
- type VoteMainTitle
- type VoteOptionList
- type VoteSource
- type VoteSubmitButton
- type VoteTemplateCard
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionList ¶
type ActionMenu ¶
type ActionMenu struct { Desc string `json:"desc"` ActionList []ActionList `json:"action_list"` }
type ApprovalInfo ¶
type ApprovalInfo struct { ThirdNo string `json:"third_no"` OpenSpName string `json:"open_sp_name"` OpenTemplateID string `json:"open_template_id"` OpenSpStatus int `json:"open_sp_status"` ApplyTime int `json:"apply_time"` ApplyUserName string `json:"apply_user_name"` ApplyUserID string `json:"apply_user_id"` ApplyUserParty string `json:"apply_user_party"` ApplyUserImage string `json:"apply_user_image"` ApprovalNodes ApprovalNodes `json:"approval_nodes"` NotifyNodes NotifyNodes `json:"notify_nodes"` Approverstep int `json:"approverstep"` }
type ApprovalNode ¶
type ApprovalNodes ¶
type ApprovalNodes struct {
ApprovalNode ApprovalNode `json:"approval_node"`
}
type ArticleResponseMessage ¶
type ArticleResponseMessage struct { ResponseMessage ArticleCount int `json:"article_count"` Articles ResponseArticles `json:"articles"` }
ArticleResponseMessage 图文消息
type BaseMessageOptions ¶
type BaseMessageOptions struct { Touser string `json:"touser"` Toparty string `json:"toparty"` Totag string `json:"totag"` Msgtype string `json:"msgtype"` Agentid int `json:"agentid"` Safe int `json:"safe"` EnableIDTrans int `json:"enable_id_trans"` EnableDuplicateCheck int `json:"enable_duplicate_check"` DuplicateCheckInterval int `json:"duplicate_check_interval"` }
type BaseMessageSchema ¶
type BaseSendGroupMessage ¶
type BaseTemplateCardUpdateMessage ¶
type BaseTemplateCardUpdateMessage struct { Userids []string `json:"userids"` Partyids []int `json:"partyids"` Agentid int `json:"agentid"` ResponseCode string `json:"response_code"` }
更新模版卡片消息
type BaseTemplateCardUpdateSchema ¶
type BaseTemplateCardUpdateSchema struct { util.CommonError Invaliduser []string `json:"invaliduser"` }
type BatchJobApplication ¶
type BatchJobResultApplicationCallbackMessage ¶
type BatchJobResultApplicationCallbackMessage struct { CallbackMessage BatchJob BatchJobApplication `json:"batch_job"` }
BatchJobResultApplicationCallbackMessage 异步任务完成事件推送
type ButtonActionList ¶
type ButtonActionMenu ¶
type ButtonActionMenu struct { Desc string `json:"Desc"` ActionList []ButtonActionList `json:"ActionList"` }
type ButtonButtonList ¶
type ButtonButtonSelection ¶
type ButtonButtonSelection struct { QuestionKey string `json:"QuestionKey"` Title string `json:"Title"` SelectedID string `json:"SelectedId"` Disable bool `json:"Disable"` OptionList []ButtonOptionList `json:"OptionList"` }
type ButtonCardAction ¶
type ButtonJumpList ¶
type ButtonList ¶
type ButtonMainTitle ¶
type ButtonOptionList ¶
type ButtonQuoteArea ¶
type ButtonResponseMessage ¶
type ButtonResponseMessage struct { ResponseMessage Button ResponseButton `json:"button"` }
ButtonResponseMessage 更新点击用户的按钮文案
type ButtonSelection ¶
type ButtonSelection struct { QuestionKey string `json:"question_key"` Title string `json:"title"` OptionList []OptionList `json:"option_list"` SelectedID string `json:"selected_id"` }
type ButtonSource ¶
type ButtonTemplateCard ¶
type ButtonTemplateCard struct { CardType string `json:"CardType"` Source ButtonSource `json:"Source"` MainTitle ButtonMainTitle `json:"MainTitle"` SubTitleText string `json:"SubTitleText"` HorizontalContentList []ButtonHorizontalContentList `json:"HorizontalContentList"` JumpList ButtonJumpList `json:"JumpList"` CardAction ButtonCardAction `json:"CardAction"` ButtonList []ButtonButtonList `json:"ButtonList"` ReplaceText string `json:"ReplaceText"` ActionMenu ButtonActionMenu `json:"ActionMenu"` QuoteArea ButtonQuoteArea `json:"QuoteArea"` ButtonSelection ButtonButtonSelection `json:"ButtonSelection"` }
type CallbackMessage ¶
type CallbackMessage struct { ToUserName string `json:"to_user_name"` // 企业微信CorpID FromUserName string `json:"from_user_name"` // 此事件该值固定为sys,表示该消息由系统生成 CreateTime int `json:"create_time"` // 消息创建时间 (整型) MsgType string `json:"msgtype"` // 消息的类型,此时固定为event Event string `json:"event"` // 事件的类型,此时固定为change_contact ChangeType string `json:"change_type"` // 此时固定为delete_user }
CallbackMessage 基础回调消息
type CardAction ¶
type Checkbox ¶
type Checkbox struct { QuestionKey string `json:"question_key"` OptionList []OptionListVote `json:"option_list"` Mode int `json:"mode"` }
type CheckboxUpdateVote ¶
type CheckboxUpdateVote struct { QuestionKey string `json:"question_key"` OptionList []OptionListVote `json:"option_list"` Disable bool `json:"disable"` Mode int `json:"mode"` }
type ClickCallbackMessage ¶
type ClickCallbackMessage struct { CallbackMessage EventKey string `json:"event_key"` AgentID int `json:"agent_id"` }
ClickCallbackMessage 点击菜单拉取消息的事件推送
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client 通讯录实例
func (*Client) CreateGroup ¶
func (r *Client) CreateGroup(options CreateGroupOptions) (info CreateGroupSchema, err error)
CreateGroup 创建群聊会话
func (*Client) GetCallbackMessage ¶
func (r *Client) GetCallbackMessage(signatureOptions SignatureOptions, encryptedMsg []byte) (rawData []byte, msg CallbackMessage, err error)
GetCallbackMessage 获取回调事件中的消息内容
//Gin框架的使用示例 r.POST("/v1/event/callback", func(c *gin.Context) { var ( message kf.CallbackMessage body []byte ) // 读取原始消息内容 body, err = c.GetRawData() if err != nil { c.String(http.StatusInternalServerError, err.Error()) return } // 解析原始数据 message, err = kfClient.GetCallbackMessage(body) if err != nil { c.String(http.StatusInternalServerError, "消息获取失败") return } fmt.Println(message) c.String(200, "ok") })
func (*Client) GetGroup ¶
func (r *Client) GetGroup(options GetGroupOptions) (info GetGroupSchema, err error)
GetGroup 获取群聊会话
func (*Client) RecallMessage ¶
func (r *Client) RecallMessage(options interface{}) (info util.CommonError, err error)
RecallMessage 撤回应用消息
func (*Client) SendGroupMessage ¶
func (r *Client) SendGroupMessage(options interface{}) (info util.CommonError, err error)
SendGroupMessage 发送群组应用消息
func (*Client) SendMessage ¶
func (r *Client) SendMessage(options interface{}) (info BaseMessageSchema, err error)
SendMessage 发送应用消息
func (*Client) UpdateGroup ¶
func (r *Client) UpdateGroup(options UpdateGroupOptions) (info util.CommonError, err error)
UpdateGroup 修改群聊会话
func (*Client) UpdateTemplateCard ¶
func (r *Client) UpdateTemplateCard(options interface{}) (info BaseTemplateCardUpdateSchema, err error)
UpdateTemplateCard 更新模版卡片消息
func (*Client) VerifyURL ¶
func (r *Client) VerifyURL(options SignatureOptions) (string, error)
VerifyURL 验证请求参数是否合法并返回解密后的消息内容
//Gin框架的使用示例 r.GET("/v1/event/callback", func(c *gin.Context) { options := kf.SignatureOptions{} //获取回调的的校验参数 if = c.ShouldBindQuery(&options); err != nil { c.String(http.StatusUnauthorized, "参数解析失败") } // 调用VerifyURL方法校验当前请求,如果合法则把解密后的内容作为响应返回给微信服务器 echo, err := kfClient.VerifyURL(options) if err == nil { c.String(http.StatusOK, echo) } else { c.String(http.StatusUnauthorized, "非法请求来源") } })
type ContentItem ¶
type CreateGroupOptions ¶
type CreateGroupOptions struct { Name string `json:"name"` Owner string `json:"owner"` Userlist []string `json:"userlist"` Chatid string `json:"chatid"` }
CreateGroupOptions 请求参数
type CreateGroupSchema ¶
type CreateGroupSchema struct { util.CommonError Chatid string `json:"chatid"` }
CreateGroupSchema 创建群聊会话响应内容
type CreatePartyCallbackMessage ¶
type CreatePartyCallbackMessage struct { CallbackMessage Id int `json:"id"` // 部门Id Name string `json:"name"` // 部门名称 ParentId int `json:"parent_id"` // 父部门id Order int `json:"order"` // 部门排序 }
CreatePartyCallbackMessage 新增部门事件回调消息
type CreateUserCallbackMessage ¶
type CreateUserCallbackMessage struct { CallbackMessage UserID string `json:"user_id"` // 成员UserID Name string `json:"name"` // 成员名称 Department []int `json:"department"` // 成员部门列表,仅返回该应用有查看权限的部门id MainDepartment int `json:"main_department"` // 主部门 IsLeaderInDept []int `json:"is_leader_in_dept"` // 表示所在部门是否为上级,0-否,1-是,顺序与Department字段的部门逐一对应 Mobile string `json:"mobile"` // 手机号码 Position string `json:"position"` // 职位信息。长度为0~64个字节 Gender string `json:"gender"` // 性别,1表示男性,2表示女性 Email string `json:"email"` // 邮箱 Status int `json:"status"` // 激活状态:1=已激活 2=已禁用 4=未激活 已激活代表已激活企业微信或已关注微工作台(原企业号)5=成员退出 Avatar string `json:"avatar"` // 头像url。注:如果要获取小图将url最后的”/0”改成”/100”即可。 Alias string `json:"alias"` // 成员别名 Telephone string `json:"telephone"` // 座机 Address string `json:"address"` // 地址 ExtAttr map[string]interface{} `json:"ext_attr"` // 扩展属性 }
CreateUserCallbackMessage 新增成员事件回调消息
type DeletePartyCallbackMessage ¶
type DeletePartyCallbackMessage struct { CallbackMessage Id int `json:"id"` // 部门Id }
DeletePartyCallbackMessage 删除部门事件回调消息
type DeleteUserCallbackMessage ¶
type DeleteUserCallbackMessage struct { CallbackMessage UserID string `json:"user_id"` // 成员UserID }
DeleteUserCallbackMessage 删除成员事件回调消息
type EmphasisContent ¶
type EnterAgentCallbackMessage ¶
type EnterAgentCallbackMessage struct { CallbackMessage EventKey string `json:"event_key"` AgentID int `json:"agent_id"` }
EnterAgentCallbackMessage 进入应用
type Error ¶
type Error string
Error 错误
const ( // SDKInitFailed 错误码:50001 SDKInitFailed Error = "SDK初始化失败" SDKCacheUnavailable Error = "缓存无效" // SDKUnknownError 错误码:50003 SDKUnknownError Error = "未知错误" // SDKInvalidCredential 错误码:40001 SDKInvalidCredential Error = "不合法的secret参数" // SDKInvalidCorpID 错误码:40013 SDKInvalidCorpID Error = "无效的 CorpID" // SDKAccessTokenInvalid 错误码:40014 SDKAccessTokenInvalid Error = "AccessToken 无效" // SDKValidateSignatureFailed 错误码:40015 SDKValidateSignatureFailed Error = "校验签名错误" // SDKDecryptMSGFailed 错误码:40016 SDKDecryptMSGFailed Error = "消息解密失败" // SDKAccessTokenMissing 错误码:41001 SDKAccessTokenMissing Error = "缺少AccessToken参数" // SDKAccessTokenExpired 错误码:42001 SDKAccessTokenExpired Error = "AccessToken 已过期" // SDKApiFreqOutOfLimit 错误码:45009 SDKApiFreqOutOfLimit Error = "接口请求次数超频" // SDKApiForbidden 错误码:48002 SDKApiForbidden Error = "API 禁止调用" // SDKInvalidOpenKFID 错误码:95000 SDKInvalidOpenKFID Error = "无效的 open_kfid" // SDKOpenKFIDNotExist 错误码:95004 SDKOpenKFIDNotExist Error = "open_kfid 不存在" // SDKWeWorkAlready 错误码:95011 SDKWeWorkAlready Error = "已在企业微信使用微信客服" // SDKNotUseInWeCom 错误码:95012 SDKNotUseInWeCom Error = "未在企业微信使用微信客服" // SDKApiNotOpen 错误码:95017 SDKApiNotOpen Error = "API 功能没有被开启" )
type FileMessageOptions ¶
type FileMessageOptions struct { BaseMessageOptions File File `json:"file"` }
文件消息
type GetGroupOptions ¶
type GetGroupOptions struct {
Chatid string `json:"chatid"`
}
GetGroupOptions 请求参数
type GetGroupSchema ¶
type GetGroupSchema struct { util.CommonError ChatInfo ChatInfo `json:"chat_info"` }
GetGroupSchema 获取群聊会话响应内容
type HorizontalContentList ¶
type ImageMessageOptions ¶
type ImageMessageOptions struct { BaseMessageOptions Image Image `json:"image"` }
图片消息
type ImageResponseMessage ¶
type ImageResponseMessage struct { ResponseMessage Image ResponseImage `json:"image"` }
ImageResponseMessage 图片消息
type ImageTextActionList ¶
type ImageTextActionMenu ¶
type ImageTextActionMenu struct { Desc string `json:"Desc"` ActionList []ImageTextActionList `json:"ActionList"` }
type ImageTextArea ¶
type ImageTextCardAction ¶
type ImageTextCardImage ¶
type ImageTextImageTextArea ¶
type ImageTextJumpList ¶
type ImageTextMainTitle ¶
type ImageTextQuoteArea ¶
type ImageTextSource ¶
type ImageTextTemplateCard ¶
type ImageTextTemplateCard struct { CardType string `json:"CardType"` Source ImageTextSource `json:"Source"` MainTitle ImageTextMainTitle `json:"MainTitle"` HorizontalContentList []ImageTextHorizontalContentList `json:"HorizontalContentList"` JumpList ImageTextJumpList `json:"JumpList"` CardAction ImageTextCardAction `json:"CardAction"` CardImage ImageTextCardImage `json:"CardImage"` VerticalContentList []ImageTextVerticalContentList `json:"VerticalContentList"` ActionMenu ImageTextActionMenu `json:"ActionMenu"` QuoteArea ImageTextQuoteArea `json:"QuoteArea"` ImageTextArea ImageTextImageTextArea `json:"ImageTextArea"` }
type Items ¶
type Items struct {
Item OpenApprovalItem `json:"item"`
}
type LocationCallbackMessage ¶
type LocationCallbackMessage struct { CallbackMessage Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` Precision int `json:"precision"` AgentID int `json:"agent_id"` AppType string `json:"app_type"` }
LocationCallbackMessage 上报地理位置
type LocationSelectCallbackMessage ¶
type LocationSelectCallbackMessage struct { CallbackMessage EventKey string `json:"event_key"` SendLocationInfo SendLocationInfo `json:"send_location_info"` AgentID int `json:"agent_id"` AppType string `json:"app_type"` }
LocationSelectCallbackMessage 弹出地理位置选择器的事件推送
type MarkdownMessageOptions ¶
type MarkdownMessageOptions struct { BaseMessageOptions Markdown Markdown `json:"markdown"` }
markdown消息
type MiniprogramNotice ¶
type MiniprogramNoticeMessageOptions ¶
type MiniprogramNoticeMessageOptions struct { BaseMessageOptions MiniprogramNotice MiniprogramNotice `json:"miniprogram_notice"` }
小程序通知消息
type Mpnews ¶
type Mpnews struct {
Articles []MpnewsArticles `json:"articles"`
}
type MpnewsArticles ¶
type MpnewsMessageOptions ¶
type MpnewsMessageOptions struct { BaseMessageOptions Mpnews Mpnews `json:"mpnews"` }
图文消息(mpnews)
type NewsMessageOptions ¶
type NewsMessageOptions struct { BaseMessageOptions News News `json:"news"` }
图文消息
type NotifyNode ¶
type NotifyNodes ¶
type NotifyNodes struct {
NotifyNode NotifyNode `json:"notify_node"`
}
type OpenApprovalChangeCallbackMessage ¶
type OpenApprovalChangeCallbackMessage struct { CallbackMessage AgentID int `json:"agent_id"` ApprovalInfo ApprovalInfo `json:"approval_info"` }
OpenApprovalChangeCallbackMessage 审批状态通知事件
type OpenApprovalItem ¶
type OptionList ¶
type OptionListVote ¶
type PicSysphotoCallbackMessage ¶
type PicSysphotoCallbackMessage struct { CallbackMessage EventKey string `json:"event_key"` SendPicsInfo SendPicsInfo `json:"send_pics_info"` AgentID int `json:"agent_id"` }
PicSysphotoCallbackMessage 弹出系统拍照发图的事件推送 / 弹出系统拍照发图的事件推送
type RecallMessageOptions ¶
type RecallMessageOptions struct {
Msgid string `json:"msgid"`
}
type ResponseArticles ¶
type ResponseArticles struct {
Item []ResponseItem `json:"item"`
}
type ResponseButton ¶
type ResponseButton struct {
ReplaceName string `json:"replace_name"`
}
type ResponseImage ¶
type ResponseImage struct {
MediaID string `json:"media_id"`
}
type ResponseItem ¶
type ResponseMessage ¶
type ResponseMessage struct { ToUserName string `json:"to_user_name"` FromUserName string `json:"from_user_name"` CreateTime int `json:"create_time"` MsgType string `json:"msg_type"` }
ResponseMessage 基础响应消息
type ResponseVideo ¶
type ResponseVoice ¶
type ResponseVoice struct {
MediaID string `json:"media_id"`
}
type ScanCodeInfo ¶
type ScancodeCallbackMessage ¶
type ScancodeCallbackMessage struct { CallbackMessage EventKey string `json:"event_key"` ScanCodeInfo ScanCodeInfo `json:"scan_code_info"` AgentID int `json:"agent_id"` }
ScancodeCallbackMessage 扫码推事件的事件推送 / 扫码推事件且弹出“消息接收中”提示框的事件推送
type SelectList ¶
type SelectList struct { QuestionKey string `json:"question_key"` Title string `json:"title"` SelectedID string `json:"selected_id"` OptionList []OptionList `json:"option_list"` }
type SelectListUpdateFunction ¶
type SelectListUpdateFunction struct { QuestionKey string `json:"question_key"` Title string `json:"title"` SelectedID string `json:"selected_id"` Disable bool `json:"disable"` OptionList []OptionList `json:"option_list"` }
type SelectMainTitle ¶
type SelectOptionList ¶
type SelectSelectList ¶
type SelectSelectList struct { QuestionKey string `json:"QuestionKey"` Title string `json:"Title"` SelectedID string `json:"SelectedId"` Disable bool `json:"Disable"` OptionList []SelectOptionList `json:"OptionList"` }
type SelectSource ¶
type SelectSubmitButton ¶
type SelectTemplateCard ¶
type SelectTemplateCard struct { CardType string `json:"CardType"` Source SelectSource `json:"Source"` MainTitle SelectMainTitle `json:"MainTitle"` SelectList SelectSelectList `json:"SelectList"` SubmitButton SelectSubmitButton `json:"SubmitButton"` ReplaceText string `json:"ReplaceText"` }
type SelectedItem ¶
type SelectedItems ¶
type SelectedItems struct {
SelectedItem []SelectedItem `json:"selected_item"`
}
type SendGroupFileMessage ¶
type SendGroupFileMessage struct {
MediaID string `json:"media_id"`
}
type SendGroupFileMessageOptions ¶
type SendGroupFileMessageOptions struct { Chatid string `json:"chatid"` Msgtype string `json:"msgtype"` File File `json:"file"` Safe int `json:"safe"` }
SendGroupFileMessageOptions 文件消息
type SendGroupImageMessage ¶
type SendGroupImageMessage struct {
MediaID string `json:"media_id"`
}
type SendGroupImageMessageOptions ¶
type SendGroupImageMessageOptions struct { BaseSendGroupMessage Image SendGroupImageMessage `json:"image"` }
SendGroupImageMessageOptions 图片消息
type SendGroupMarkdownMessage ¶
type SendGroupMarkdownMessage struct {
Content string `json:"content"`
}
type SendGroupMarkdownMessageOptions ¶
type SendGroupMarkdownMessageOptions struct { Chatid string `json:"chatid"` Msgtype string `json:"msgtype"` Markdown SendGroupMarkdownMessage `json:"markdown"` }
SendGroupMarkdownMessageOptions markdown消息
type SendGroupMpnewsMessage ¶
type SendGroupMpnewsMessage struct {
Articles []SendGroupMpnewsArticlesMessage `json:"articles"`
}
type SendGroupMpnewsMessageOptions ¶
type SendGroupMpnewsMessageOptions struct { Chatid string `json:"chatid"` Msgtype string `json:"msgtype"` Mpnews SendGroupMpnewsMessage `json:"mpnews"` Safe int `json:"safe"` }
SendGroupMpnewsMessageOptions 图文消息(mpnews)
type SendGroupNewsMessage ¶
type SendGroupNewsMessage struct {
Articles []SendGroupNewsArticlesMessage `json:"articles"`
}
type SendGroupNewsMessageOptions ¶
type SendGroupNewsMessageOptions struct { Chatid string `json:"chatid"` Msgtype string `json:"msgtype"` News SendGroupNewsMessage `json:"news"` Safe int `json:"safe"` }
SendGroupNewsMessageOptions 图文消息
type SendGroupTextMessage ¶
type SendGroupTextMessage struct {
Content string `json:"content"`
}
type SendGroupTextMessageOptions ¶
type SendGroupTextMessageOptions struct { BaseSendGroupMessage Text SendGroupTextMessage `json:"text"` }
SendGroupTextMessageOptions 文本消息
type SendGroupTextcardMessageOptions ¶
type SendGroupTextcardMessageOptions struct { BaseSendGroupMessage Textcard Textcard `json:"textcard"` }
SendGroupTextcardMessageOptions 文本卡片消息
type SendGroupVideoMessage ¶
type SendGroupVideoMessageOptions ¶
type SendGroupVideoMessageOptions struct { BaseSendGroupMessage Video Video `json:"video"` }
SendGroupVideoMessageOptions 视频消息
type SendGroupVoiceMessage ¶
type SendGroupVoiceMessage struct {
MediaID string `json:"media_id"`
}
type SendGroupVoiceMessageOptions ¶
type SendGroupVoiceMessageOptions struct { Chatid string `json:"chatid"` Msgtype string `json:"msgtype"` Voice SendGroupVoiceMessage `json:"voice"` }
SendGroupVoiceMessageOptions 语音消息
type SendLocationInfo ¶
type SendPicsInfo ¶
type ShareAgentChangeCallbackMessage ¶
type ShareAgentChangeCallbackMessage struct {}
ShareAgentChangeCallbackMessage 共享应用事件回调
type SignatureOptions ¶
type SignatureOptions struct { Signature string `form:"msg_signature"` TimeStamp string `form:"timestamp"` Nonce string `form:"nonce"` EchoStr string `form:"echostr"` Encrypt string `form:"encrypt"` }
SignatureOptions 微信服务器验证参数
type SourceFunction ¶
type SourceVote ¶
type SubmitButton ¶
type SubscribeCallbackMessage ¶
type SubscribeCallbackMessage struct { CallbackMessage AgentID int `json:"agent_id"` }
SubscribeCallbackMessage 成员关注及取消关注事件
type TemplateCard ¶
type TemplateCard struct { CardType string `json:"card_type"` Source Source `json:"source"` ActionMenu ActionMenu `json:"action_menu"` TaskID string `json:"task_id"` MainTitle MainTitle `json:"main_title"` QuoteArea QuoteArea `json:"quote_area"` EmphasisContent EmphasisContent `json:"emphasis_content"` SubTitleText string `json:"sub_title_text"` HorizontalContentList []HorizontalContentList `json:"horizontal_content_list"` JumpList []JumpList `json:"jump_list"` CardAction CardAction `json:"card_action"` }
type TemplateCardButton ¶
type TemplateCardButton struct { CardType string `json:"card_type"` Source Source `json:"source"` ActionMenu ActionMenu `json:"action_menu"` MainTitle MainTitle `json:"main_title"` QuoteArea QuoteArea `json:"quote_area"` SubTitleText string `json:"sub_title_text"` HorizontalContentList []HorizontalContentList `json:"horizontal_content_list"` CardAction CardAction `json:"card_action"` TaskID string `json:"task_id"` ButtonSelection ButtonSelection `json:"button_selection"` ButtonList []ButtonList `json:"button_list"` }
type TemplateCardButtonMessageOptions ¶
type TemplateCardButtonMessageOptions struct { BaseMessageOptions TemplateCard TemplateCardButton `json:"template_card"` }
按钮交互型
type TemplateCardButtonResponseMessage ¶
type TemplateCardButtonResponseMessage struct { ToUserName string `json:"ToUserName"` FromUserName string `json:"FromUserName"` CreateTime int `json:"CreateTime"` MsgType string `json:"MsgType"` TemplateCard ButtonTemplateCard `json:"TemplateCard"` }
TemplateCardButtonResponseMessage 更新点击用户的整张卡片 - 按钮交互型
type TemplateCardEventCallbackMessage ¶
type TemplateCardEventCallbackMessage struct { CallbackMessage EventKey string `json:"event_key"` TaskID string `json:"task_id"` CardType string `json:"card_type"` ResponseCode string `json:"response_code"` AgentID int `json:"agent_id"` SelectedItems SelectedItems `json:"selected_items"` }
TemplateCardEventCallbackMessage 模板卡片事件推送
type TemplateCardFunction ¶
type TemplateCardFunction struct { CardType string `json:"card_type"` Source SourceFunction `json:"source"` MainTitle MainTitle `json:"main_title"` TaskID string `json:"task_id"` SelectList []SelectList `json:"select_list"` SubmitButton SubmitButton `json:"submit_button"` }
type TemplateCardFunctionMessageOptions ¶
type TemplateCardFunctionMessageOptions struct { BaseMessageOptions TemplateCard TemplateCardFunction `json:"template_card"` }
多项选择型
type TemplateCardImage ¶
type TemplateCardImage struct { CardType string `json:"card_type"` Source Source `json:"source"` ActionMenu ActionMenu `json:"action_menu"` TaskID string `json:"task_id"` MainTitle MainTitle `json:"main_title"` QuoteArea QuoteArea `json:"quote_area"` ImageTextArea ImageTextArea `json:"image_text_area"` CardImage CardImage `json:"card_image"` VerticalContentList []VerticalContentList `json:"vertical_content_list"` HorizontalContentList []HorizontalContentList `json:"horizontal_content_list"` JumpList []JumpList `json:"jump_list"` CardAction CardAction `json:"card_action"` }
type TemplateCardImageMessageOptions ¶
type TemplateCardImageMessageOptions struct { BaseMessageOptions TemplateCard TemplateCardImage `json:"template_card"` }
图文展示型
type TemplateCardImageTextResponseMessage ¶
type TemplateCardImageTextResponseMessage struct { ResponseMessage TemplateCard ImageTextTemplateCard `json:"TemplateCard"` }
TemplateCardImageTextResponseMessage 更新点击用户的整张卡片 - 图文展示型
type TemplateCardMenuEventCallbackMessage ¶
type TemplateCardMenuEventCallbackMessage struct { CallbackMessage EventKey string `json:"event_key"` TaskID string `json:"task_id"` CardType string `json:"card_type"` ResponseCode string `json:"response_code"` AgentID int `json:"agent_id"` }
TemplateCardMenuEventCallbackMessage 通用模板卡片右上角菜单事件推送
type TemplateCardMessageOptions ¶
type TemplateCardMessageOptions struct { BaseMessageOptions TemplateCard TemplateCard `json:"template_card"` }
模板卡片消息
type TemplateCardSelectResponseMessage ¶
type TemplateCardSelectResponseMessage struct { ToUserName string `json:"ToUserName"` FromUserName string `json:"FromUserName"` CreateTime int `json:"CreateTime"` MsgType string `json:"MsgType"` TemplateCard SelectTemplateCard `json:"TemplateCard"` }
TemplateCardSelectResponseMessage 更新点击用户的整张卡片 - 多项选择型
type TemplateCardTextResponseMessage ¶
type TemplateCardTextResponseMessage struct { ResponseMessage TemplateCard TextTemplateCard `json:"template_card"` }
TemplateCardTextResponseMessage 更新点击用户的整张卡片 - 文本通知型
type TemplateCardUpdateButton ¶
type TemplateCardUpdateButton struct { CardType string `json:"card_type"` Source Source `json:"source"` ActionMenu ActionMenu `json:"action_menu"` MainTitle MainTitle `json:"main_title"` QuoteArea QuoteArea `json:"quote_area"` SubTitleText string `json:"sub_title_text"` HorizontalContentList []HorizontalContentList `json:"horizontal_content_list"` CardAction CardAction `json:"card_action"` ButtonSelection ButtonSelection `json:"button_selection"` ButtonList []ButtonList `json:"button_list"` ReplaceText string `json:"replace_text"` }
type TemplateCardUpdateButtonMessageOptions ¶
type TemplateCardUpdateButtonMessageOptions struct { Userids []string `json:"userids"` Partyids []int `json:"partyids"` Agentid int `json:"agentid"` ResponseCode string `json:"response_code"` TemplateCard TemplateCardUpdateButton `json:"template_card"` }
更新为新的卡片 - 按钮交互型
type TemplateCardUpdateFunction ¶
type TemplateCardUpdateFunction struct { CardType string `json:"card_type"` Source SourceFunction `json:"source"` MainTitle MainTitle `json:"main_title"` SelectList []SelectListUpdateFunction `json:"select_list"` SubmitButton SubmitButton `json:"submit_button"` ReplaceText string `json:"replace_text"` }
type TemplateCardUpdateFunctionMessageOptions ¶
type TemplateCardUpdateFunctionMessageOptions struct { Userids []string `json:"userids"` Partyids []int `json:"partyids"` Tagids []int `json:"tagids"` Atall int `json:"atall"` Agentid int `json:"agentid"` ResponseCode string `json:"response_code"` TemplateCard TemplateCardUpdateFunction `json:"template_card"` }
更新为新的卡片 - 多项选择型
type TemplateCardUpdateImage ¶
type TemplateCardUpdateImage struct { CardType string `json:"card_type"` Source Source `json:"source"` ActionMenu ActionMenu `json:"action_menu"` MainTitle MainTitle `json:"main_title"` QuoteArea QuoteArea `json:"quote_area"` ImageTextArea ImageTextArea `json:"image_text_area"` CardImage CardImage `json:"card_image"` VerticalContentList []VerticalContentList `json:"vertical_content_list"` HorizontalContentList []HorizontalContentList `json:"horizontal_content_list"` JumpList []JumpList `json:"jump_list"` CardAction CardAction `json:"card_action"` }
type TemplateCardUpdateImageMessageOptions ¶
type TemplateCardUpdateImageMessageOptions struct { Userids []string `json:"userids"` Partyids []int `json:"partyids"` Agentid int `json:"agentid"` ResponseCode string `json:"response_code"` TemplateCard TemplateCardUpdateImage `json:"template_card"` }
更新为新的卡片 - 图文展示型
type TemplateCardUpdateMessageOptions ¶
type TemplateCardUpdateMessageOptions struct { BaseTemplateCardUpdateMessage Tagids []int `json:"tagids"` Atall int `json:"atall"` TemplateCard TemplateCard `json:"template_card"` }
更新按钮为不可点击状态
type TemplateCardUpdateText ¶
type TemplateCardUpdateText struct { CardType string `json:"card_type"` Source Source `json:"source"` ActionMenu ActionMenu `json:"action_menu"` MainTitle MainTitle `json:"main_title"` QuoteArea QuoteArea `json:"quote_area"` EmphasisContent EmphasisContent `json:"emphasis_content"` SubTitleText string `json:"sub_title_text"` HorizontalContentList []HorizontalContentList `json:"horizontal_content_list"` JumpList []JumpList `json:"jump_list"` CardAction CardAction `json:"card_action"` }
type TemplateCardUpdateTextMessageOptions ¶
type TemplateCardUpdateTextMessageOptions struct { Userids []string `json:"userids"` Partyids []int `json:"partyids"` Agentid int `json:"agentid"` ResponseCode string `json:"response_code"` TemplateCard TemplateCardUpdateText `json:"template_card"` }
更新为新的卡片 - 文本通知型
type TemplateCardUpdateVote ¶
type TemplateCardUpdateVote struct { CardType string `json:"card_type"` Source SourceVote `json:"source"` MainTitle MainTitle `json:"main_title"` Checkbox CheckboxUpdateVote `json:"checkbox"` SubmitButton SubmitButton `json:"submit_button"` ReplaceText string `json:"replace_text"` }
type TemplateCardUpdateVoteMessageOptions ¶
type TemplateCardUpdateVoteMessageOptions struct { Userids []string `json:"userids"` Partyids []int `json:"partyids"` Agentid int `json:"agentid"` ResponseCode string `json:"response_code"` TemplateCard TemplateCardUpdateVote `json:"template_card"` }
更新为新的卡片 - 投票选择型
type TemplateCardVote ¶
type TemplateCardVote struct { CardType string `json:"card_type"` Source SourceVote `json:"source"` MainTitle MainTitle `json:"main_title"` TaskID string `json:"task_id"` Checkbox Checkbox `json:"checkbox"` SubmitButton SubmitButton `json:"submit_button"` }
type TemplateCardVoteMessageOptions ¶
type TemplateCardVoteMessageOptions struct { BaseMessageOptions TemplateCard TemplateCardVote `json:"template_card"` }
投票选择型
type TemplateCardVoteResponseMessage ¶
type TemplateCardVoteResponseMessage struct { ToUserName string `json:"ToUserName"` FromUserName string `json:"FromUserName"` CreateTime int `json:"CreateTime"` MsgType string `json:"MsgType"` TemplateCard VoteTemplateCard `json:"TemplateCard"` }
TemplateCardVoteResponseMessage 更新点击用户的整张卡片 - 投票选择型
type TextActionList ¶
type TextActionMenu ¶
type TextActionMenu struct { Desc string `json:"desc"` ActionList []TextActionList `json:"action_list"` }
type TextCardAction ¶
type TextEmphasisContent ¶
type TextJumpList ¶
type TextMainTitle ¶
type TextMessageOptions ¶
type TextMessageOptions struct { BaseMessageOptions Text Text `json:"text"` }
文本消息
type TextQuoteArea ¶
type TextResponseMessage ¶
type TextResponseMessage struct { ResponseMessage Content string `json:"content"` }
TextResponseMessage 文本消息
type TextSource ¶
type TextTemplateCard ¶
type TextTemplateCard struct { CardType string `json:"card_type"` Source TextSource `json:"source"` MainTitle TextMainTitle `json:"main_title"` SubTitleText string `json:"sub_title_text"` HorizontalContentList []TextHorizontalContentList `json:"horizontal_content_list"` JumpList TextJumpList `json:"jump_list"` CardAction TextCardAction `json:"card_action"` EmphasisContent TextEmphasisContent `json:"emphasis_content"` ActionMenu TextActionMenu `json:"action_menu"` QuoteArea TextQuoteArea `json:"quote_area"` }
type TextcardMessageOptions ¶
type TextcardMessageOptions struct { BaseMessageOptions Textcard Textcard `json:"textcard"` }
文本卡片消息
type UpdateGroupOptions ¶
type UpdateGroupOptions struct { Chatid string `json:"chatid"` Name string `json:"name"` Owner string `json:"owner"` AddUserList []string `json:"add_user_list"` DelUserList []string `json:"del_user_list"` }
UpdateGroupOptions 修改群聊会话请求参数
type UpdatePartyCallbackMessage ¶
type UpdatePartyCallbackMessage struct { CallbackMessage Id int `json:"id"` // 部门Id Name string `json:"name"` // 部门名称,仅当该字段发生变更时传递 ParentId int `json:"parent_id"` // 父部门id,仅当该字段发生变更时传递 }
UpdatePartyCallbackMessage 更新部门事件回调消息
type UpdateTagCallbackMessage ¶
type UpdateTagCallbackMessage struct { CallbackMessage TagId int `json:"tag_id"` // 标签Id AddUserItems []string `json:"add_user_items"` // 标签中新增的成员userid列表,用逗号分隔 DelUserItems []string `json:"del_user_items"` // 标签中删除的成员userid列表,用逗号分隔 AddPartyItems []int `json:"add_party_items"` // 标签中新增的部门id列表,用逗号分隔 DelPartyItems []int `json:"del_party_items"` // 标签中删除的部门id列表,用逗号分隔 }
UpdateTagCallbackMessage 标签变更通知回调消息
type UpdateUserCallbackMessage ¶
type UpdateUserCallbackMessage struct { CallbackMessage CreateUserCallbackMessage NewUserID string `json:"new_user_id"` // 新的UserID,变更时推送(userid由系统生成时可更改一次) }
UpdateUserCallbackMessage 更新成员事件回调消息
type VerticalContentList ¶
type VideoMessageOptions ¶
type VideoMessageOptions struct { BaseMessageOptions Video Video `json:"video"` }
视频消息
type VideoResponseMessage ¶
type VideoResponseMessage struct { ResponseMessage Video ResponseVideo `json:"video"` }
VideoResponseMessage 视频消息
type ViewCallbackMessage ¶
type ViewCallbackMessage struct { CallbackMessage EventKey string `json:"event_key"` AgentID int `json:"agent_id"` }
ViewCallbackMessage 点击菜单跳转链接的事件推送
type VoiceMessageOptions ¶
type VoiceMessageOptions struct { BaseMessageOptions Voice Voice `json:"voice"` }
语音消息
type VoiceResponseMessage ¶
type VoiceResponseMessage struct { ResponseMessage Voice ResponseVoice `json:"voice"` }
VoiceResponseMessage 语音消息
type VoteCheckBox ¶
type VoteCheckBox struct { QuestionKey string `json:"QuestionKey"` OptionList []VoteOptionList `json:"OptionList"` Disable bool `json:"Disable"` Mode int `json:"Mode"` }
type VoteMainTitle ¶
type VoteOptionList ¶
type VoteSource ¶
type VoteSubmitButton ¶
type VoteTemplateCard ¶
type VoteTemplateCard struct { CardType string `json:"CardType"` Source VoteSource `json:"Source"` MainTitle VoteMainTitle `json:"MainTitle"` CheckBox VoteCheckBox `json:"CheckBox"` SubmitButton VoteSubmitButton `json:"SubmitButton"` ReplaceText string `json:"ReplaceText"` }