Skip to content

Bind User via Mobile or Email Interface

Call this interface when using a mobile number or email to bind a platform user. Before calling this interface, you need to obtain a temporary token through the WeChat Mini Program Login Interface.


Request Description

Request Headers

Parameter NameNameRequiredTypeExample
X-operating-sys-versionClient Operating System VersionYesStringwindows10.1.1
X-device-fingerprintClient Device FingerprintYesString156aysdna213sc50
X-device-ipClient IPNoString192.168.1.2
X-agentUser-Agent InformationYesStringMozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X)
X-LUsed for Internationalization Language SettingsNoStringzh
X-client-idApplication Authorization IDYesStringnTo1eRIub60vPb54WeE6aojPwYwImtl4
X-state-tokenTemporary TokenYesStringeyJhbcOiJ……nEPRiIC4we0
content-typeContent Format TypeYesStringapplication/json

Request Example

  1. Mobile Number + SMS Verification Code
json
{
    "mobile":"11012345678",
    "verify_code":"232326"
}

Request Parameters

Parameter NameNameRequiredTypeDescription
mobileMobile NumberYesStringMobile number that receives the verification code
verify_codeSMS Verification CodeYesStringReceived verification code
To obtain the verification code, please refer to the Send SMS Verification Code Interface
type = BIND_MOBILE_SMS
  1. Email + Email Verification Code
json
{
    "email":"zhangsan@qq.com",
    "verify_code":"123456"
}

Request Parameters

Parameter NameNameRequiredTypeDescription
emailEmailYesStringEmail that receives the verification code
verify_codeEmail Verification CodeYesStringReceived verification code
To obtain the verification code, please refer to the Send Email Verification Code Interface
type = BIND_EMAIL_EMS

Response Example

Success Example

HTTP/1.1 200 OK

json
{
    "session_token": "btsiBjx85prcZu6I6Ki057Tmw3nSF2VO",
    "expire": 432000,
    "status": "SUCCESS",
    "id_token": " eyJraWQn0.eyJpc3MiOiJodHR…g1A7jG8O0uw"
}

Error Example

HTTP/1.1 400 Bad Request

json
{
    "error_code": "IDAAS.SDK.COMMON.1007",
    "error_msg": "state_token parameter error"
}

Response Parameters

Parameter NameNameTypeDescription
statusLogin Flow Status IdentifierStringSUCCESS: Login successful SOCIAL_BIND: Bind flow USER_REGISTER: Auto-register and bind flow ACCESS_DENIED: Access denied MFA_AUTH: Secondary authentication
expiresession_token Validity PeriodNumbersession_token validity period
session_tokenUser session_tokenStringUser session_token
id_tokenIdentity Token of the Logged-in User, Short-term ValidStringThis field is in JWT format and contains user identity information. You can refer to "Get User Information from id_token" to obtain user information. The token validity period defaults to 5 minutes.

BambooCloud IDaaS Open Platform