You can log on to the public platform to blacklist fans. It provides a blacklist management API that developers can directly use to perform operations. You can log on to the public platform to blacklist fans. It provides a blacklist management API that developers can directly use to perform operations.
Get the blacklist list can view the document http://mp.weixin.qq.com/wiki? T = resource/res_main & id = mp1471422259_pJMWA & token = & lang = zh_CN
Interface request URL:
API call request description
Http request method: POST (please use https protocol) https://api.weixin.qq.com/cgi-bin/tags/members/getblacklist? Access_token = ACCESS_TOKEN
JSON data description
{"begin_openid":"OPENID1"}
If begin_openid is empty, it is pulled from the beginning by default.
The sample code is as follows:
It means that we do not have one in the blacklist.
Then we start to pull a person to the blacklist to call the blacklisted interface.
Interface URL:
Http request method: POST (please use https protocol) https://api.weixin.qq.com/cgi-bin/tags/members/batchblacklist? Access_token = ACCESS_TOKEN
Parameter description
Parameters |
Required? |
Description |
Access_token |
Yes |
Interface call credential |
Openid_list |
Yes |
Openid of the user who needs to be blacklisted. up to 20 OpenIDs can be blacklisted at a time. |
JSON data description
{ "opened_list":["OPENID1”,” OPENID2”]}
The code is as follows:
Since the user can be blacklisted, the user can be removed.
The following code calls the interface to cancel blacklisting users:
Http request method: POST (please use https protocol) https://api.weixin.qq.com/cgi-bin/tags/members/batchunblacklist? Access_token = ACCESS_TOKEN
Parameter description
Parameters |
Required? |
Description |
Access_token |
Yes |
Interface call credential |
Openid_list |
Yes |
Openid of the user who needs to be blacklisted. up to 20 OpenIDs can be blacklisted at a time. |
JSON data description
{ "opened_list":["OPENID1”,” OPENID2”]}
The code is as follows:
Now, this chapter describes the functions of getting the user blacklist list, blacklisting users, blacklisting users, and blacklisting users.
The above is the detailed description of getting the user blacklist list (development tutorial) through accesstoken. For more information, see other related articles on php Chinese network!