mass

package
v1.0.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package mass 群发消息

Index

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)

删除群发

See: https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Batch_Sends_and_Originality_Checks.html

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)

查询群发消息发送状态

See: https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Batch_Sends_and_Originality_Checks.html

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)

上传图文消息素材

See: https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Batch_Sends_and_Originality_Checks.html

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 需通过此接口特别地得到

See: https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Batch_Sends_and_Originality_Checks.html

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次),请勿滥用

See: https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Batch_Sends_and_Originality_Checks.html

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列表群发

See: https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Batch_Sends_and_Originality_Checks.html

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)

根据标签进行群发

See: https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Batch_Sends_and_Originality_Checks.html

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)

获取群发速度

See: https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Batch_Sends_and_Originality_Checks.html

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)

设置群发速度

See: https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Batch_Sends_and_Originality_Checks.html

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.

Jump to

Keyboard shortcuts

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