Obtain the user blacklist list through accesstoken (WeChat development tutorial)

Source: Internet
Author: User
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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.