api

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2021 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessToken

type AccessToken struct {
	CorpId     string
	CorpSecret string
	// contains filtered or unexported fields
}

func (*AccessToken) GetToken

func (at *AccessToken) GetToken(isGetNew bool) (string, error)

type MpNewsArticleItem

type MpNewsArticleItem struct {
	Title            string `json:"title"`                        //	是	标题,不超过128个字节,超过会自动截断(支持id转译)
	ThumbMediaId     string `json:"thumb_media_id"`               //	是	图文消息缩略图的media_id, 可以通过素材管理接口获得。此处thumb_media_id即上传接口返回的media_id
	Author           string `json:"author,omitempty"`             //	否	图文消息的作者,不超过64个字节
	ContentSourceUrl string `json:"content_source_url,omitempty"` //	否	图文消息点击“阅读原文”之后的页面链接
	Content          string `json:"content"`                      //	是	图文消息的内容,支持html标签,不超过666 K个字节(支持id转译)
	Digest           string `json:"digest,omitempty"`             //	否	图文消息的描述,不超过512个字节,超过会自动截断(支持id转译)
}

type MpNewsArticles

type MpNewsArticles struct {
	Articles []*MpNewsArticleItem `json:"articles"`
}

type MpNewsMsg

type MpNewsMsg struct {
	ToUser                 string          `json:"touser,omitempty"`                   //	否	成员ID列表(消息接收者,多个接收者用‘|’分隔,最多支持1000个)。特殊情况:指定为@all,则向关注该企业应用的全部成员发送
	ToParty                string          `json:"toparty,omitempty"`                  //	否	部门ID列表,多个接收者用‘|’分隔,最多支持100个。当touser为@all时忽略本参数
	ToTag                  string          `json:"totag,omitempty"`                    //	否	标签ID列表,多个接收者用‘|’分隔,最多支持100个。当touser为@all时忽略本参数
	MsgType                string          `json:"msgtype"`                            //	是	消息类型,此时固定为:mpnews
	AgentId                int64           `json:"agentid"`                            //	是	企业应用的id,整型。企业内部开发,可在应用的设置页面查看;第三方服务商,可通过接口 获取企业授权信息 获取该参数值
	MpNews                 *MpNewsArticles `json:"mpnews"`                             //	是	图文消息,一个图文消息支持1到8条图文
	Safe                   int             `json:"safe,omitempty"`                     //	否	表示是否是保密消息,0表示可对外分享,1表示不能分享且内容显示水印,2表示仅限在企业内分享,默认为0;注意仅mpnews类型的消息支持safe值为2,其他消息类型不支持
	EnableIdTrans          int             `json:"enable_id_trans,omitempty"`          //	否	表示是否开启id转译,0表示否,1表示是,默认0
	EnableDuplicateCheck   int             `json:"enable_duplicate_check,omitempty"`   //	否	表示是否开启重复消息检查,0表示否,1表示是,默认0
	DuplicateCheckInterval int             `json:"duplicate_check_interval,omitempty"` //	否	表示是否重复消息检查的时间间隔,默认1800s,最大不超过4小时
	// contains filtered or unexported fields
}

图文消息(mpnews)

func (*MpNewsMsg) Send

func (mn *MpNewsMsg) Send(at *AccessToken) error

Jump to

Keyboard shortcuts

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