Documentation ¶
Overview ¶
Package mass 群发消息
Index ¶
- func Delete(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
- func Get(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
- func MediaUploadNews(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
- func MediaUploadVideo(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
- func Preview(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
- func Send(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
- func SendAll(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
- func SpeedGet(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
- func SpeedSet(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
func Delete(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
删除群发
POST https://api.weixin.qq.com/cgi-bin/message/mass/delete?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/offiaccount" "github.com/fastwego/offiaccount/apis/message/mass" ) func main() { var ctx *offiaccount.OffiAccount payload := []byte("{}") resp, err := mass.Delete(ctx, payload) fmt.Println(resp, err) }
Output:
func Get ¶
func Get(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
查询群发消息发送状态
POST https://api.weixin.qq.com/cgi-bin/message/mass/get?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/offiaccount" "github.com/fastwego/offiaccount/apis/message/mass" ) func main() { var ctx *offiaccount.OffiAccount payload := []byte("{}") resp, err := mass.Get(ctx, payload) fmt.Println(resp, err) }
Output:
func MediaUploadNews ¶
func MediaUploadNews(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
上传图文消息素材
POST https://api.weixin.qq.com/cgi-bin/media/uploadnews?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/offiaccount" "github.com/fastwego/offiaccount/apis/message/mass" ) func main() { var ctx *offiaccount.OffiAccount payload := []byte("{}") resp, err := mass.MediaUploadNews(ctx, payload) fmt.Println(resp, err) }
Output:
func MediaUploadVideo ¶
func MediaUploadVideo(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
上传视频素材
群发 视频 的 media_id 需通过此接口特别地得到
POST https://api.weixin.qq.com/cgi-bin/media/uploadvideo?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/offiaccount" "github.com/fastwego/offiaccount/apis/message/mass" ) func main() { var ctx *offiaccount.OffiAccount payload := []byte("{}") resp, err := mass.MediaUploadVideo(ctx, payload) fmt.Println(resp, err) }
Output:
func Preview ¶
func Preview(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
预览
开发者可通过该接口发送消息给指定用户,在手机端查看消息的样式和排版。为了满足第三方平台开发者的需求,在保留对openID预览能力的同时,增加了对指定微信号发送预览的能力,但该能力每日调用次数有限制(100次),请勿滥用
POST https://api.weixin.qq.com/cgi-bin/message/mass/preview?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/offiaccount" "github.com/fastwego/offiaccount/apis/message/mass" ) func main() { var ctx *offiaccount.OffiAccount payload := []byte("{}") resp, err := mass.Preview(ctx, payload) fmt.Println(resp, err) }
Output:
func Send ¶
func Send(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
根据OpenID列表群发
POST https://api.weixin.qq.com/cgi-bin/message/mass/send?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/offiaccount" "github.com/fastwego/offiaccount/apis/message/mass" ) func main() { var ctx *offiaccount.OffiAccount payload := []byte("{}") resp, err := mass.Send(ctx, payload) fmt.Println(resp, err) }
Output:
func SendAll ¶
func SendAll(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
根据标签进行群发
POST https://api.weixin.qq.com/cgi-bin/message/mass/sendall?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/offiaccount" "github.com/fastwego/offiaccount/apis/message/mass" ) func main() { var ctx *offiaccount.OffiAccount payload := []byte("{}") resp, err := mass.SendAll(ctx, payload) fmt.Println(resp, err) }
Output:
func SpeedGet ¶
func SpeedGet(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
获取群发速度
POST https://api.weixin.qq.com/cgi-bin/message/mass/speed/get?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/offiaccount" "github.com/fastwego/offiaccount/apis/message/mass" ) func main() { var ctx *offiaccount.OffiAccount payload := []byte("{}") resp, err := mass.SpeedGet(ctx, payload) fmt.Println(resp, err) }
Output:
func SpeedSet ¶
func SpeedSet(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
设置群发速度
POST https://api.weixin.qq.com/cgi-bin/message/mass/speed/set?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/offiaccount" "github.com/fastwego/offiaccount/apis/message/mass" ) func main() { var ctx *offiaccount.OffiAccount payload := []byte("{}") resp, err := mass.SpeedSet(ctx, payload) fmt.Println(resp, err) }
Output:
Types ¶
This section is empty.