国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Table of Contents
1. Interface Introduction
Home WeChat Applet WeChat Development WeChat public platform development to obtain followers list

WeChat public platform development to obtain followers list

Mar 04, 2017 am 11:41 AM
Micro-channel public platform

This article introduces how to use advanced interfaces to develop the function of obtaining the follower list on the WeChat public platform.

1. Interface Introduction

Official accounts can obtain the account’s follower list through this interface. The follower list consists of a string of OpenID ( The encrypted WeChat account (each user’s OpenID for each official account is unique). A single pull call can pull up to 10,000 OpenIDs of followers, and you can pull multiple times to meet your needs.

Interface call request description

http請求方式:?GET(請使用https協(xié)議)
https://api.weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN&next_openid=NEXT_OPENID
Parameter Whether it is required Description
access_token is Call interface credentials
next_openid is The first OPENID to be pulled, if not filled in, it will be pulled from the beginning by default

Return instructions

Return when correct JSON data packet:

{"total":2,"count":2,"data":{"openid":["","OPENID1","OPENID2"]},"next_openid":"NEXT_OPENID"}

##ParametersDescriptiontotalThe total number of users following the public account#countThe number of OPENIDs pulled, the maximum value is 10000dataList data, list of OPENIDnext_openidPull the OPENID of the next user in the list
Return JSON data packet in case of error (example is invalid AppID error):

{"errcode":40013,"errmsg":"invalid?appid"}

Attachment: When the number of followers exceeds 10,000

When the number of followers of the public account exceeds 10,000, you can fill in the value of next_openid and pull the list multiple times to meet the needs.

Specifically, when calling the interface, the next_openid value returned from the previous call is used as the next_openid value in the next call.

Examples are as follows:

公眾賬號A擁有23000個關(guān)注的人,想通過拉取關(guān)注接口獲取所有關(guān)注的人,那么分別請求url如下:
https://api.weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN?
返回結(jié)果:

{
??"total":23000,
??"count":10000,
??"data":{"
?????openid":[
????????"OPENID1",
????????"OPENID2",
????????...,
????????"OPENID10000"
?????]
???},
???"next_openid":"NEXT_OPENID1"
}

https://api.weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN&next_openid=NEXT_OPENID1
返回結(jié)果:

{???"total":23000,
???"count":10000,
???"data":{?????"openid":[???????"OPENID10001",
???????"OPENID10002",
???????...,
???????"OPENID20000"
?????]
???},
???"next_openid":"NEXT_OPENID2"}

https://api.weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN&next_openid=NEXT_OPENID1
返回結(jié)果(關(guān)注者列表已返回完時,返回next_openid為空):

$access_token?=?"";

$url?=?"https://api.weixin.qq.com/cgi-bin/user/get?access_token=$access_token";
$result?=?https_request($url);
$jsoninfo?=?json_decode($result,?true);
var_dump($result);


2. Program implementation

?=?""?=?"https://api.weixin.qq.com/cgi-bin/user/get?access_token="?=?https_request(?=?json_decode(,?(

After CMB, the return will be similar to the following:

{
???"total":23000,
???"count":10000,
???"data":{
?????"openid":[
???????"OPENID10001",
???????"OPENID10002",
???????...,
???????"OPENID20000"
?????]
???},
???"next_openid":"NEXT_OPENID2"
}

For numbers exceeding 10,000, just execute the above program in a loop, store these openids in the database, and obtain the list of followers.

The main function of this interface is to cooperate with the interface to obtain basic user information and user grouping to obtain the basic information and grouping of all followers.

For more articles related to WeChat public platform development and obtaining followers list, please pay attention to the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)