# API Refrence
Authing provides a REST-based scan code login interface, which developers can call directly.
Generate QR code for APP scan code login.
This interface will return QR code ID (random) and QR code link.
Example of generated QR code:
Use Online QR Code Decoding Tool (opens new window) to view the QR code data as follows:
{
"scene": "APP_AUTH",
"random": "SzZrszCJNCFfVBDUCKLDtAYNBR96SK",
"userPoolId": "5fae2648201cfd526f0ec354",
"createdAt": "2020-11-13T06:23:25.396Z",
"expiresIn": 120,
"customData": {}
}
Query QR code scanning status
Request result field description:
- status
- 0: Code is not scanned.
- 1: After scanning the code but the user has not clicked to agree to authorize or cancel authorization, the user's avatar and nickname will be returned at this time, but it does not contain other confidential information, which can be used for front-end avatar display.
- 2: User agrees to authorization
- 3: User cancels authorization
- -1: Expired
- userInfo:
- By default, after the user scans the QR code, it will contain two fields: nickname and photo
- Developers can also configure to return complete user information (including login credentials token)
- ticket: used to exchange for complete user information. **This field will only appear after the user agrees to the authorization. **See below for details.
Use ticket in exchange for user information
Note: By default, this interface is only allowed to be called on the server side, that is, it needs to be initialized with the user pool key.
The default validity time of the ticket is 300 s.
Developers can access the Authing console (opens new window) Basic Configuration -> Basic Settings -> App scan code to log in to the Web Define the configuration to modify. **See the custom configuration item page for details. **
Scan code marked on APP
The APP needs to meet two conditions:
- The user must be logged in
- The user's user pool ID matches the QR code user pool ID.
The APP agrees to the authorization and the scanned interface needs to be called before calling this interface.
The APP needs to meet two conditions:
- The user must be logged in
- The user's user pool ID matches the QR code user pool ID.
To cancel authorization on the APP side, you need to call the scanned interface before calling this interface.
The APP needs to meet two conditions:
- The user must be logged in
- The user's user pool ID matches the QR code user pool ID.