In the previous chapter, we explained that open_id obtains basic user information, so where does open_id come from? It can be seen in the fan list. This time I will explain how to get the fan list.
To obtain the fan list, you can view the document http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140840&token=&lang=zh_CN
The explanation is very detailed and obtained through next_openid Download 10,000. Generally, you need to do this when there are more than 10,000 fans. It is not necessary when the number of fans is small. Call the URL interface:
Request method: GET (please use https protocol)
https://api.weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN&next_openid=NEXT_OPENID
The code is as follows:
The return result is as follows:
You can get the next 1000 according to next_openid Stop fetching until the count of fetched data is empty.
The above is the detailed content of WeChat development: Tutorial on accesstoken to obtain user fan list. For more information, please follow other related articles on the PHP Chinese website!