tags

package
v1.0.0-beta.6 Latest Latest
Warning

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

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

Documentation

Overview

Package tags 用户标签管理

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func BatchTagging

func BatchTagging(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)

批量为用户打标签

标签功能目前支持公众号为用户打上最多20个标签

See: https://developers.weixin.qq.com/doc/offiaccount/User_Management/User_Tag_Management.html

POST https://api.weixin.qq.com/cgi-bin/tags/members/batchtagging?access_token=ACCESS_TOKEN

Example
package main

import (
	"fmt"

	"github.com/fastwego/offiaccount"
	"github.com/fastwego/offiaccount/apis/user/tags"
)

func main() {
	var ctx *offiaccount.OffiAccount

	payload := []byte("{}")
	resp, err := tags.BatchTagging(ctx, payload)

	fmt.Println(resp, err)
}
Output:

func BatchUnTagging

func BatchUnTagging(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)

批量为用户取消标签

标签功能目前支持公众号为用户打上最多20个标签

See: https://developers.weixin.qq.com/doc/offiaccount/User_Management/User_Tag_Management.html

POST https://api.weixin.qq.com/cgi-bin/tags/members/batchuntagging?access_token=ACCESS_TOKEN

Example
package main

import (
	"fmt"

	"github.com/fastwego/offiaccount"
	"github.com/fastwego/offiaccount/apis/user/tags"
)

func main() {
	var ctx *offiaccount.OffiAccount

	payload := []byte("{}")
	resp, err := tags.BatchUnTagging(ctx, payload)

	fmt.Println(resp, err)
}
Output:

func Create

func Create(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)

创建标签

一个公众号,最多可以创建100个标签

See: https://developers.weixin.qq.com/doc/offiaccount/User_Management/User_Tag_Management.html

POST https://api.weixin.qq.com/cgi-bin/tags/create?access_token=ACCESS_TOKEN

Example
package main

import (
	"fmt"

	"github.com/fastwego/offiaccount"
	"github.com/fastwego/offiaccount/apis/user/tags"
)

func main() {
	var ctx *offiaccount.OffiAccount

	payload := []byte("{}")
	resp, err := tags.Create(ctx, payload)

	fmt.Println(resp, err)
}
Output:

func Delete

func Delete(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)

删除标签

请注意,当某个标签下的粉丝超过10w时,后台不可直接删除标签。此时,开发者可以对该标签下的openid列表,先进行取消标签的操作,直到粉丝数不超过10w后,才可直接删除该标签

See: https://developers.weixin.qq.com/doc/offiaccount/User_Management/User_Tag_Management.html

POST https://api.weixin.qq.com/cgi-bin/tags/delete?access_token=ACCESS_TOKEN

Example
package main

import (
	"fmt"

	"github.com/fastwego/offiaccount"
	"github.com/fastwego/offiaccount/apis/user/tags"
)

func main() {
	var ctx *offiaccount.OffiAccount

	payload := []byte("{}")
	resp, err := tags.Delete(ctx, payload)

	fmt.Println(resp, err)
}
Output:

func Get

func Get(ctx *offiaccount.OffiAccount) (resp []byte, err error)

获取公众号已创建的标签

See: https://developers.weixin.qq.com/doc/offiaccount/User_Management/User_Tag_Management.html

GET https://api.weixin.qq.com/cgi-bin/tags/get?access_token=ACCESS_TOKEN

Example
package main

import (
	"fmt"

	"github.com/fastwego/offiaccount"
	"github.com/fastwego/offiaccount/apis/user/tags"
)

func main() {
	var ctx *offiaccount.OffiAccount

	resp, err := tags.Get(ctx)

	fmt.Println(resp, err)
}
Output:

func GetTagIdList

func GetTagIdList(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)

获取用户身上的标签列表

标签功能目前支持公众号为用户打上最多20个标签

See: https://developers.weixin.qq.com/doc/offiaccount/User_Management/User_Tag_Management.html

POST https://api.weixin.qq.com/cgi-bin/tags/getidlist?access_token=ACCESS_TOKEN

Example
package main

import (
	"fmt"

	"github.com/fastwego/offiaccount"
	"github.com/fastwego/offiaccount/apis/user/tags"
)

func main() {
	var ctx *offiaccount.OffiAccount

	payload := []byte("{}")
	resp, err := tags.GetTagIdList(ctx, payload)

	fmt.Println(resp, err)
}
Output:

func GetUsersByTag

func GetUsersByTag(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)

获取标签下粉丝列表

See: https://developers.weixin.qq.com/doc/offiaccount/User_Management/User_Tag_Management.html

POST https://api.weixin.qq.com/cgi-bin/user/tag/get?access_token=ACCESS_TOKEN

Example
package main

import (
	"fmt"

	"github.com/fastwego/offiaccount"
	"github.com/fastwego/offiaccount/apis/user/tags"
)

func main() {
	var ctx *offiaccount.OffiAccount

	payload := []byte("{}")
	resp, err := tags.GetUsersByTag(ctx, payload)

	fmt.Println(resp, err)
}
Output:

func Update

func Update(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)

编辑标签

See: https://developers.weixin.qq.com/doc/offiaccount/User_Management/User_Tag_Management.html

POST https://api.weixin.qq.com/cgi-bin/tags/update?access_token=ACCESS_TOKEN

Example
package main

import (
	"fmt"

	"github.com/fastwego/offiaccount"
	"github.com/fastwego/offiaccount/apis/user/tags"
)

func main() {
	var ctx *offiaccount.OffiAccount

	payload := []byte("{}")
	resp, err := tags.Update(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