Employee Identity (EIAM)
WeChat Authorization Mobile Binding or User Registration
This interface is called when binding a platform user with a WeChat mobile number or registering a user using a WeChat mobile number. Before calling this interface, you need to obtain a temporary token through the WeChat Mini Program Login API.
# Request Specification
POST https://{your_domain}/api/v2/sdk/social/wechat-mobile-register-bind
# Request Headers
| Parameter Name | Chinese Name | Required | Type | Example |
|---|---|---|---|---|
| X-operating-sys-version | Client Operating System Version | Yes | String | windows10.1.1 |
| X-device-fingerprint | Client Device Fingerprint | Yes | String | 156aysdna213sc50 |
| X-device-ip | Client IP Address | 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 | For Internationalization Language Setting | No | String | zh |
| X-client-id | Application Authorization ID | Yes | String | nTo1eRIub60vPb54WeE6aojPwYwImtl4 |
| X-state-token | Temporary Token | Yes | String | eyJhbcOiJ……nEPRiIC4we0 |
| content-type | Content Format Type | Yes | String | application/json |
# Request Example
{
"wechat_code":"6213b8e364d3f0eaf7cf196bfe49675553b4919d6e664b70d5eaa6cbf8531afe"
}
1
2
3
2
3
# Request Parameters
| Parameter Name | Chinese Name | Required | Type | Description |
|---|---|---|---|---|
| wechat_code | WeChat Mobile Number Authorization Code | Yes | String | The authorization code returned by WeChat Mini Program after the user grants permission via the WeChat mobile number authorization pop-up triggered by the mini program. |
# Response Example
Success Example:
HTTP/1.1 200 OK
Content-Type: application/json
{
"session_token": "btsiBjx85prcZu6I6Ki057Tmw3nSF2VO",
"expire": 432000,
"status": "SUCCESS",
"id_token": " eyJraWQn0.eyJpc3MiOiJodHR…g1A7jG8O0uw"
}
Error Example:
HTTP/1.1 400 Bad Request
{
"error_code": "IDAAS.SDK.COMMON.1007",
"error_msg": "state_token parameter error"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Response Parameters
| Parameter Name | Chinese Name | Type | Description |
|---|---|---|---|
| status | Login Process Status Identifier | String | SUCCESS: Login successful SOCIAL_BIND: Binding process. Choose a method to bind the user: Bind User via WeChat Authorized Mobile Number; Bind User via Mobile Number or Email; Bind User via Username and Password USER_REGISTER: Binding or Registration process. Choose a method to bind/register the user: Bind or Register User via WeChat Authorized Mobile Number; Bind or Register User via Other Mobile Number. ACCESS_DENIED: Access Denied MFA_AUTH: Multi-Factor Authentication |
| expire | session_token Validity Period | Number | Session_token validity period |
| session_token | User session_token | String | User session_token |
| id_token | Identity token of the logged-in user, short-term valid | String | This field is in JWT format and contains user identity information. Refer to "Get User Information Based on id_token" to retrieve user information. The token validity period defaults to 5 minutes. |
I am ready. Please provide the Markdown content you need translated.
