public interface WxMpUserTagService
提供微信公众号用户标签的创建、查询、更新、删除等功能。 通过标签可以方便地对用户进行分组管理和精准营销。 一个公众号最多可以创建100个标签。
详情请见:用户标签管理
Created by Binary Wang on 2016/9/2.| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
batchTagging(Long tagId,
String[] openids)
批量为用户打标签
可以为多个用户同时打上同一个标签。
|
boolean |
batchUntagging(Long tagId,
String[] openids)
批量为用户取消标签
可以为多个用户同时取消同一个标签。
|
WxUserTag |
tagCreate(String name)
创建标签
一个公众号,最多可以创建100个标签。
|
Boolean |
tagDelete(Long tagId)
删除标签
删除标签后,该标签下的所有用户将被取消标签。
|
List<WxUserTag> |
tagGet()
获取公众号已创建的标签
|
WxTagListUser |
tagListUser(Long tagId,
String nextOpenid)
获取标签下粉丝列表
可用于获取某个标签下的所有用户信息,支持分页查询。
|
Boolean |
tagUpdate(Long tagId,
String name)
编辑标签
可以修改标签的名称,但不能修改标签ID。
|
List<Long> |
userTagList(String openid)
获取用户身上的标签列表
可查询某个用户被打上的所有标签ID。
|
WxUserTag tagCreate(String name) throws WxErrorException
创建标签 一个公众号,最多可以创建100个标签。
name - 标签名字(30个字符以内)WxErrorException - 微信API调用异常,可能包括:
List<WxUserTag> tagGet() throws WxErrorException
获取公众号已创建的标签
WxErrorException - 微信API调用异常,可能包括:
Boolean tagUpdate(Long tagId, String name) throws WxErrorException
编辑标签 可以修改标签的名称,但不能修改标签ID。
tagId - 标签ID,不能为nullname - 新的标签名字(30个字符以内)WxErrorException - 微信API调用异常,可能包括:
Boolean tagDelete(Long tagId) throws WxErrorException
删除标签 删除标签后,该标签下的所有用户将被取消标签。
tagId - 标签ID,不能为nullWxErrorException - 微信API调用异常,可能包括:
WxTagListUser tagListUser(Long tagId, String nextOpenid) throws WxErrorException
获取标签下粉丝列表 可用于获取某个标签下的所有用户信息,支持分页查询。
tagId - 标签ID,不能为nullnextOpenid - 第一个拉取用户的openid,不填从头开始拉取WxErrorException - 微信API调用异常,可能包括:
boolean batchTagging(Long tagId, String[] openids) throws WxErrorException
批量为用户打标签 可以为多个用户同时打上同一个标签。
tagId - 标签ID,不能为nullopenids - 用户openid数组,不能为null或空数组WxErrorException - 微信API调用异常,可能包括:
boolean batchUntagging(Long tagId, String[] openids) throws WxErrorException
批量为用户取消标签 可以为多个用户同时取消同一个标签。
tagId - 标签ID,不能为nullopenids - 用户openid数组,不能为null或空数组WxErrorException - 微信API调用异常,可能包括:
List<Long> userTagList(String openid) throws WxErrorException
获取用户身上的标签列表 可查询某个用户被打上的所有标签ID。
openid - 用户的openid,不能为null或空字符串WxErrorException - 微信API调用异常,可能包括:
Copyright © 2026. All rights reserved.