In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly shows you "how the Wechat public platform gets the basic information of users". The content is simple and clear. I hope it can help you solve your doubts. Now let the editor lead you to study and learn the article "how the Wechat public platform gets the basic information of users".
1. Access to basic user information
After the follower interacts with the official account, the official account can get the follower's OpenID (encrypted WeChat account, and each user's OpenID is unique to each official account. For different official accounts, the openid of the same user is different. Through this API, official account can obtain basic user information based on OpenID, including nickname, profile picture, gender, city, language and time of following.
Get basic user information
Developers can get basic user information through OpenID. Please use https protocol.
API call request description
Http request method: GET https://api.weixin.qq.com/cgi-bin/user/info?access_token=ACCESS_TOKEN&openid=OPENID&lang=zh_CN
Parameter description
Whether the parameter must indicate that access_token is the calling API credential openid is the identity of the ordinary user, and whether the unique lang of the current official account returns the national and regional language version, zh_CN simplified, zh_TW traditional, en English
Return description
Normally, Wechat will return the following JSON packets to the official account:
{"subscribe": 1, "openid": "o7Lp5t6n59DeX3U0C7Kric9qEx-Q", "nickname": "Fang times", "sex": 1, "language": "zh_CN", "city": "Shenzhen", "province": "Guangdong", "country": "China", "headimgurl": "http://wx.qlogo.cn/mmopen/Kkv3HV30gbEZmoo1rTrP4UjRRqzsibUjT9JClPJy3gzo0NkEqzQ9yTSJzErnsRqoLIct5NdLJgcDMicTEBiaibzLn34JLwficVvl6/0"," subscribe_time ": 1389684286}
Parameter description
Parameter indicates whether the subscribe user subscribes to the official account ID. A value of 0 means that the user does not follow the official account and cannot pull the rest of the information. The identity of the openid user. The gender of the sex user, which is the nickname of the current unique nickname user on the official account. A value of 1 is male, and a value of 2 is female. If the value is 0, it is the language of the province user in the province where the country user is located in the city where the unknown city user is located. The simplified Chinese is the zh_CNheadimgurl user avatar, and the last value represents the size of the square avatar (optional values are 0, 46, 64, 96, 132). 0 represents a 640mm 640 square avatar). If the user does not have an avatar, this item is empty subscribe_time user follow time, which is a timestamp. If the user has followed many times, take the last follow time
Wechat will return information such as error code when an error occurs. An example of JSON packet is as follows (this example is an invalid AppID error):
{"errcode": 40013, "errmsg": "invalid appid"} II. Program implementation = "5ic8RoqZd7IBUtE0aGXUhcdKBnrwlO1iqtvyJJUgIcDcopJIH7x90QH4yiK_z08fqp4WOD7kfKPDtET29BRYNZO-sSIITaxIj4u72LYAYcFH6t1fiSVzjUuqYWOtHiw0LGDorxx5Qj6SN0Z7GtYGTA" = "o7Lp5t6n59DeX3U0C7Kric9qEx-Q" = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=&openid=&lang=zh_CN" = https_request (above is all the content of the article" how to get basic user Information on Wechat Public platform ". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.