URL links in enterprise applications (including links in custom menus or messages) can obtain employee identity information through OAuth2.0. Note that the domain name of this URL must completely match the 'Trusted Domain Name' in the enterprise application settings , otherwise a 50001 error code will be returned when obtaining user information. 1. Enterprises obtain code If an enterprise requires employees to bring their identity information when they jump to the enterprise website, they need to construct the following link: https://open.weixin.qq.com/connect/oauth2/authorize?appid=CORPID&redirect_uri=REDIRECT_URI&response_type=code&scope=SCOPE&state=STATE#wechat_redirect
After the employee clicks it, the page will jump to redirect_uri/?code=CODE&state=STATE, and the enterprise can obtain the employee's userid based on the code parameter. 2. Get member information
Https request method: GET https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo?access_token=ACCESS_TOKEN&code=CODE&agentid=AGENTID
The administrator must have permission to use the agent; the agentid must be the same as the enterprise application ID where the link is redirected.
a) If it is correct, the return example is as follows:
The following is an example of what is returned when an error occurs:
|
<<: How to use custom menus in WeChat Enterprise Account Development
>>: WeChat Enterprise Account Development: Encryption Scheme and Global Return Code Description
The previous merger plan of China's Geely Aut...
In the past two years, vertical screen short vide...
There are two ways to bid for big searches now: t...
In the current sluggish market in 2019, many auto...
2019 was the year when major internet celebrities...
[[152481]] Why write such an article? Students wh...
What is AOP AOP is the abbreviation of Aspect Ori...
In the past 2020, American electric vehicle manuf...
Those who work in self-media know that whether or...
Introduction: my country is a country with a larg...
Omdia considers the healthcare artificial intelli...
Recently, I have often come into contact with som...
I am very happy that my first blog has received w...
This article was reviewed by Zhang Yinming, PhD i...
About this activity Mobile Internet has swept eve...