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
Recently, two national SUVs, Great Wall CS75 and ...
In terms of underlying logic and final results, t...
How to use Sina Blog to accurately attract traffi...
How many calories are in a 500ml bottle of Fat Ho...
The reporter learned from the Ministry of Emergen...
On October 20, American Internet giant Google ann...
Introduction: The World Cup has made 4K TV a hot ...
On June 8, BYD issued an announcement regarding &...
Whether playing King of Glory, reading articles o...
1. Earn money by completing tasks This is very co...
Preface How can you make users addicted to your p...
Through some special channels , I got 22,000 vide...
WeChat Mini Program is an application that users ...
There are two main types of community activities....
Over the past few years, it has become clear that...