User Login
is used login, system would reply access token
Request address
- API Address (requestURI) : /openapi/v1/user/login
Request parameters
| Parameter Name | Type | Requirement | Description |
|---|---|---|---|
| bizName | String | O | Business name, currently required for Trust business frontend |
| registerType | Integer | O | Registration type: 1-phoneNumber, 2-email, 3-one-click login |
| phoneNumberPrefix | Integer | R | Phone number prefix, country code, e.g., China 86, Hong Kong 852, USA 1 |
| phoneNumber | String | R | Phone number |
| String | R | ||
| password | String | R | Password |
| ip | String | O | IP address during login |
| countryId | String | O | Country/region during login, input country code, e.g., Hong Kong-HK, USA-US, China-CN |
| deviceModel | String | O | Device model |
Sample request
{
"password": "XM6i/reK/8Yd14hPYsvwbtP7a4zWZ0m43+5MzuuXfD2RnU0NOCMmZiRHua7YsePAP4iBdUKGuER1hf5jhxZwXwmsh41+TBgsR46fKKW889Tdx4upmQVNlP7oquQAeqNHVxRzyfaBGSWEciaTjzPopGrQf5TnFEKBpAvINZ/m1yc=",
"phoneNumberPrefix": "852",
"phoneNumber": "98763237",
"registerType": 1,
"ip":"14.155.42.142",
"countryId":"CN"
}
Response parameters
| Parameter Name | Type | Description |
|---|---|---|
| id | Long | Primary key |
| uid | String | UUID |
| bizCode | String | Business code |
| bizName | String | Business name |
| identificationLevel | Integer | Authentication level |
| nickname | String | Nickname generated based on phone number or email |
| phoneNumberPrefix | Integer | Phone number prefix |
| phoneNumber | String | Phone number |
| String | Email address | |
| loginType (Deprecated) | String | Type of login (deprecated) |
| registerType | String | Type of registration (1- phone, 2- email, 3- one-click login) |
| password | String | Password |
| birthday | LocalDate | Date of birth |
| countryId | String | Country/Region ID |
| country | String | Country name |
| surname | String | Surname |
| middleName | String | Middle name |
| givenName | String | Given name |
| fullName | String | Full name |
| idTypeId | String | ID type ID |
| idNumber | String | ID number |
| idType | String | ID type |
| channelId | String | Channel ID |
| inviterCode | String | Inviter's invitation code |
| inviterName | String | Inviter's name |
| customerManager | String | Assigned customer manager |
| city | String | City |
| address | String | Address |
| street | String | Street |
| houseNumber | String | House number |
| timeZone | String | User time zone |
| createTime | LocalDateTime | Creation time |
| updateTime | LocalDateTime | Last update time (including password update) |
| openAccountTime | LocalDateTime | Account opening time |
| userTypeTest | Integer | Whether it is a test account (0- no, 1- yes) |
| grayScale | Integer | Whether it is a gray-scale account (0- no, 1- yes) |
| status | Integer | Status (0- disabled, 1- enabled) |
| registerIp | String | IP address at registration |
| lastLoginIp | String | IP address of the last login |
| lastLoginTime | LocalDateTime | Time of the last login |
| lastLoginCountry | String | Country of the last login |
| registerSource | Integer | Registration source (0- user self-registration, 1- CRM admin registration) Trust business has special use, changing from 0 to 1 after customer manager supplements information |
Sample response
{
"code": "0",
"msg": "ok",
"data": {
"id": 139061,
"uid": "75b8ccad23f342c1a519718c7fb6c041",
"bizCode": "98227698",
"bizName": "MFT",
"identificationLevel": null,
"nickname": "98****37",
"phoneNumberPrefix": 852,
"phoneNumber": "98793237",
"email": null,
"loginType": "1",
"registerType": "1",
"password": "536e0a39a107e1319ad3894db4800410356af68313d16931",
"birthday": null,
"countryId": "HK",
"country": "中国香港特别行政区",
"surname": null,
"middleName": null,
"givenName": null,
"fullName": null,
"idTypeId": null,
"idNumber": null,
"idType": null,
"channelId": null,
"inviterCode": null,
"inviterName": null,
"customerManager": null,
"city": null,
"address": null,
"street": null,
"houseNumber": null,
"timeZone": "UTC+8:00",
"createTime": "2024-12-11T11:07:19.438744618",
"updateTime": "2024-12-11T11:07:19.443132556",
"openAccountTime": null,
"userTypeTest": null,
"grayScale": null,
"status": null,
"registerIp": "61.93.232.102",
"lastLoginIp": "61.93.232.102",
"lastLoginTime": null,
"lastLoginCountry": "中国香港特别行政区",
"registerSource": null
},
"success": true
}
Sample code
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\r\n \"password\": \"XM6i/reK/8Yd14hPYsvwbtP7a4zWZ0m43+5MzuuXfD2RnU0NOCMmZiRHua7YsePAP4iBdUKGuER1hf5jhxZwXwmsh41+TBgsR46fKKW889Tdx4upmQVNlP7oquQAeqNHVxRzyfaBGSWEciaTjzPopGrQf5TnFEKBpAvINZ/m1yc=\",\r\n \"phoneNumberPrefix\": \"852\",\r\n \"phoneNumber\": \"98763237\",\r\n\t\"registerType\": 1,\r\n \"ip\":\"14.155.42.142\",\r\n \"countryId\":\"CN\"\r\n}");
Request request = new Request.Builder()
.url("https://test-gateway.mcconnects.com/mc-crm/openapi/v1/user/login")
.method("POST", body)
.addHeader("token", "d425a12bdd2b58f59f079fcbb6d15e58")
.addHeader("Content-Type", "application/json")
.addHeader("Cookie", "token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOjEsImRldmljZSI6ImRlZmF1bHQtZGV2aWNlIiwiZWZmIjotMSwicm5TdHIiOiJYUkVaUERWdWVnNmFpYUUyTjIwS3hYVXVsaGlXdGdWTiIsInVzZXJNZXJjaGFudElkcyI6IioiLCJwZXJtaXNzSWQiOjEwMDAxLCJ1c2VybmFtZSI6ImFkbWluIn0.iXq5Kc1kHPhjm1mauj9vto8PD5A9dP-V5t3y2hp5FGI")
.build();
Response response = client.newCall(request).execute();
}