Skip to content

用户标签管理

开发者可以使用用户标签管理的相关接口,实现对公众号的标签进行创建、查询、修改、删除等操作,也可以对用户进行打标签、取消标签等操作。

获取标签列表

OfficialAccountApp.UserTag.List(ctx)

微信官方文档

创建标签

OfficialAccountApp.UserTag.Create(ctx,"[tagName]")

微信官方文档

编辑标签

OfficialAccountApp.UserTag.Update(ctx,"[tagID]", "[tagName]")

微信官方文档

删除标签

OfficialAccountApp.UserTag.Delete(ctx,"[tagID]")

微信官方文档

获取标签下粉丝列表

nextOpenID := ""
OfficialAccountApp.UserTag.UsersOfTag(ctx,"[tagID]", nextOpenID)

微信官方文档

批量为用户打标签

OfficialAccountApp.UserTag.TagUsers(ctx,[]string{"[openID1]", "[openID2]"}, "[tagID]")

微信官方文档

批量为用户取消标签

OfficialAccountApp.UserTag.UntagUsers(ctx,[]string{"[openID1]", "[openID2]"}, "[tagID]")

微信官方文档

获取用户身上的标签列表

OfficialAccountApp.UserTag.UserTags(ctx,"[openID]")

微信官方文档

使用示例

参考: PowerWechatTutorial

用户标签管理 has loaded