Documentation ¶
Overview ¶
Package subscribe 订阅消息
Index ¶
- func AddTemplate(ctx *miniprogram.Miniprogram, payload []byte) (resp []byte, err error)
- func DeleteTemplate(ctx *miniprogram.Miniprogram, payload []byte) (resp []byte, err error)
- func GetCategory(ctx *miniprogram.Miniprogram) (resp []byte, err error)
- func GetPubTemplateKeyWordsById(ctx *miniprogram.Miniprogram) (resp []byte, err error)
- func GetPubTemplateTitleList(ctx *miniprogram.Miniprogram) (resp []byte, err error)
- func GetTemplateList(ctx *miniprogram.Miniprogram) (resp []byte, err error)
- func Send(ctx *miniprogram.Miniprogram, payload []byte) (resp []byte, err error)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddTemplate ¶
func AddTemplate(ctx *miniprogram.Miniprogram, payload []byte) (resp []byte, err error)
组合模板并添加至帐号下的个人模板库
POST https://api.weixin.qq.com/wxaapi/newtmpl/addtemplate?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/miniprogram" "github.com/fastwego/miniprogram/apis/subscribe" ) func main() { var ctx *miniprogram.Miniprogram payload := []byte("{}") resp, err := subscribe.AddTemplate(ctx, payload) fmt.Println(resp, err) }
Output:
func DeleteTemplate ¶
func DeleteTemplate(ctx *miniprogram.Miniprogram, payload []byte) (resp []byte, err error)
删除帐号下的个人模板
POST https://api.weixin.qq.com/wxaapi/newtmpl/deltemplate?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/miniprogram" "github.com/fastwego/miniprogram/apis/subscribe" ) func main() { var ctx *miniprogram.Miniprogram payload := []byte("{}") resp, err := subscribe.DeleteTemplate(ctx, payload) fmt.Println(resp, err) }
Output:
func GetCategory ¶
func GetCategory(ctx *miniprogram.Miniprogram) (resp []byte, err error)
获取小程序账号的类目
GET https://api.weixin.qq.com/wxaapi/newtmpl/getcategory?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/miniprogram" "github.com/fastwego/miniprogram/apis/subscribe" ) func main() { var ctx *miniprogram.Miniprogram resp, err := subscribe.GetCategory(ctx) fmt.Println(resp, err) }
Output:
func GetPubTemplateKeyWordsById ¶
func GetPubTemplateKeyWordsById(ctx *miniprogram.Miniprogram) (resp []byte, err error)
获取模板标题下的关键词列表
GET https://api.weixin.qq.com/wxaapi/newtmpl/getpubtemplatekeywords?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/miniprogram" "github.com/fastwego/miniprogram/apis/subscribe" ) func main() { var ctx *miniprogram.Miniprogram resp, err := subscribe.GetPubTemplateKeyWordsById(ctx) fmt.Println(resp, err) }
Output:
func GetPubTemplateTitleList ¶
func GetPubTemplateTitleList(ctx *miniprogram.Miniprogram) (resp []byte, err error)
获取帐号所属类目下的公共模板标题
GET https://api.weixin.qq.com/wxaapi/newtmpl/getpubtemplatetitles?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/miniprogram" "github.com/fastwego/miniprogram/apis/subscribe" ) func main() { var ctx *miniprogram.Miniprogram resp, err := subscribe.GetPubTemplateTitleList(ctx) fmt.Println(resp, err) }
Output:
func GetTemplateList ¶
func GetTemplateList(ctx *miniprogram.Miniprogram) (resp []byte, err error)
获取当前帐号下的个人模板列表
GET https://api.weixin.qq.com/wxaapi/newtmpl/gettemplate?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/miniprogram" "github.com/fastwego/miniprogram/apis/subscribe" ) func main() { var ctx *miniprogram.Miniprogram resp, err := subscribe.GetTemplateList(ctx) fmt.Println(resp, err) }
Output:
func Send ¶
func Send(ctx *miniprogram.Miniprogram, payload []byte) (resp []byte, err error)
发送订阅消息
POST https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/miniprogram" "github.com/fastwego/miniprogram/apis/subscribe" ) func main() { var ctx *miniprogram.Miniprogram payload := []byte("{}") resp, err := subscribe.Send(ctx, payload) fmt.Println(resp, err) }
Output:
Types ¶
This section is empty.