Email and Email Verification Code Login
During the email verification code login API call, the graphic captcha verification must be passed first. On success, the user'ssession_token, and failure information is returned otherwise. Auto-registration can be supported based on Enterprise Center registration configuration.
Request Description
Request Headers
| Parameter Name | Chinese Name | Required | Type | Example |
|---|---|---|---|---|
| X-operating-sys-version | Caller client OS version | Yes | String | windows10.1.1 |
| X-device-fingerprint | Caller client device fingerprint | Yes | String | 156aysdna213sc50 |
| X-device-ip | Caller client IP | No | String | 192.168.1.2 |
| X-agent | User-Agent information | Yes | String | Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) |
| X-L | Used for internationalization language setting | No | String | zh |
| X-client-id | Application authorization ID | Yes | String | nTo1eRIub60vPb54WeE6aojPwYwImtl4 |
| content-type | Content format type | Yes | String | application/json |
Request Example
json
{
"emial":"zhangsan@qq.com",
"verify_code":"123456"
}Request Parameters
| Parameter Name | Chinese Name | Required | Type | Description |
|---|---|---|---|---|
| Yes | String | Email used to receive the verification code | ||
| verify_code | Verification code | Yes | String | Received verification code For obtaining the verification code, seeSend Email Verification Code API type=LOGIN_EMS |
Response Example
Success Example
HTTP/1.1 200 OK
json
{
"session_token": "btsiBjx85prcZu6I6Ki057Tmw3nSF2VO",
"expire": 432000,
"status": "SUCCESS",
"id_token": "eyJ0NiJ9.eyJ1cI6IjIifX0.DeWt4QuZXso"
}Error Example
HTTP/1.1 400 Bad Request
json
{
"error_code": "IDAAS.SDK.CAPTCHA.0007",
"error_msg": "Incorrect verification code"
}Response Parameters
| Parameter Name | Chinese Name | Type | Description |
|---|---|---|---|
| status | Login flow status identifier | String | Possible values returned by this field are as follows: SUCCESS: login successful |
| expire | session_token validity period | Number | Session_token validity period. Within the validity period, session_token can be used to obtain ticket |
| session_token | User session_token | String | User session_token; this token can be used to call IDaaS APIs to obtain a new id_token |
| id_token | Short-term valid API call token | String | This field is in JWT format and contains user identity information. Refer toGet User Info from id_tokento obtain user information. The token validity period is5minutes by default and can be configured |
Error Codes
| Status Code | Error Codes | Chinese Error Message | English Error Message | Resolution |
|---|---|---|---|---|
| 400 | IDAAS.SDK.PARAM.0001 | 设备信息不完整 | Device information is incomplete | Please check whether the input device information is complete |
| 400 | IDAAS.SDK.PARAM.0002 | clientId不能为空 | clientId cannot be empty | Please check whether the input clientId is empty |
| 400 | IDAAS.SDK.PARAM.0003 | 应用未注册,请先注册应用 | The app is not registered, please register the app first | Please check whether the input clientId is correct |
| 400 | IDAAS.SDK.PARAM.0009 | 验证码不能为空 | Verification code cannot be empty | Please check whether the input verification code is empty |
| 400 | IDAAS.SDK.USER.0004 | 手机号不能为空 | Mobile number cannot be empty | Please check whether the input mobile number is empty |
| 400 | IDAAS.SDK.CAPTCHA.0007 | 验证码不正确 | Incorrect verification code | Please check whether the input verification code is correct |
| 400 | IDAAS.SDK.USER.0001 | 用户未找到 | User not found | Please register first and try again |
| 400 | IDAAS.SDK.USER.0039 | 用户已被禁用 | User is disabled | Please contact the administrator |
| 500 | IDAAS.SDK.COM.0002 | 系统繁忙,请稍后再试 | System busy, please try again later | Please call again or contact BambooCloud staff |