subscribe

package
v1.0.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package subscribe 订阅消息

Index

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)

组合模板并添加至帐号下的个人模板库

See: https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/subscribe-message/subscribeMessage.addTemplate.html

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)

删除帐号下的个人模板

See: https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/subscribe-message/subscribeMessage.deleteTemplate.html

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)

获取小程序账号的类目

See: https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/subscribe-message/subscribeMessage.getCategory.html

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)

获取模板标题下的关键词列表

See: https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/subscribe-message/subscribeMessage.getPubTemplateKeyWordsById.html

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)

获取帐号所属类目下的公共模板标题

See: https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/subscribe-message/subscribeMessage.getPubTemplateTitleList.html

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)

获取当前帐号下的个人模板列表

See: https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/subscribe-message/subscribeMessage.getTemplateList.html

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)

发送订阅消息

See: https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/subscribe-message/subscribeMessage.send.html

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.

Jump to

Keyboard shortcuts

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