


Introduction to WeChat enterprise account development to obtain user information
When the user clicks on the application to jump to the URL we set, it does not actually bring any user information. In order to obtain user information, we need to use the OAuth2.0 interface provided by WeChat.
Obtaining user information is divided into two steps:
Construct the URL to obtain the code
Obtain member information according to the code
1. Construct the URL to obtain the code
If an enterprise requires employees to bring their identity information when jumping to the corporate webpage, the following link must be constructed:
https://open.weixin.qq.com/connect/oauth2/authorize?appid=CORPID&redirect_uri=REDIRECT_URI&response_type=code&scope=SCOPE&state=STATE#wechat_redirect
Parameter Description
Parameters | Must | Description |
---|---|---|
appid | is the CorpID## of the | enterprise |
is the callback link address redirected after | authorization. Please use urlencode to process the link | |
is the return type of | , which is fixed at this time: code | |
is | Application authorization scope, fixed at this time: snsapi_base | |
No | The state parameter will be included after redirection, and the enterprise can fill it in The parameter value of a-zA-Z0-9, the length cannot exceed 128 bytes | |
Yes | WeChat terminal uses this parameter Determine whether identity information needs to be brought |
- Request description
- Parameter description
must | Description | |
---|---|---|
is | Call interface certificate | |
is the code obtained by | through member authorization. The code brought by member authorization will be different each time. The code can only be used once and will automatically expire if not used for 10 minutes |
- Permission Description
- Return results
{ "UserId":"USERID", "DeviceId":"DEVICEID" }
<br>
The above is the detailed content of Introduction to WeChat enterprise account development to obtain user information. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SublimeText3 Linux new version
SublimeText3 Linux latest version

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

SublimeText3 Chinese version
Chinese version, very easy to use

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.
