Associates an account with a user.
Debugging
Authorization information
There is currently no authorization information disclosed in the API.
Request syntax
POST /v2/account/link HTTP/1.1
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| body | object | No | The request parameters. | |
| user_id | string | Yes | The ID of the user with which you want to associate an account. | xxx |
| type | string | Yes | The account type. Valid values:
| ding |
| identity | string | Yes | The unique identifier of the account, such as a mobile number. | eyy*** |
| extra | string | No | The additional information about the unique identifier of the account. For example, if type is set to mobile, set the value of extra to a country code. For example, a value of 86 specifies a mobile number in the Chinese mainland. If you do not specify this parameter, 86 is used by default. | 86 |
Response parameters
Examples
Sample success responses
JSONformat
{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJjOWI3YTVhYTA0ZDE0YWUzODY3ZmRjODg2ZmEwMWRhNCIsImN1c3RvbUpzb24iOiJ7XCJjbGllbnRJZFwiOlwiMjVkelgzdmJZcWt0Vnh5WFwiLFwiZG9tYWluSWRcIjpcImJqMjlcIixcInNjb3BlXCI6W1wiRFJJVkUuQUxMXCIsXCJTSEFSRS5BTExcIixcIkZJTEUuQUxMXCIsXCJVU0VSLkFMTFwiLFwiVklFVy5BTExcIixcIlNUT1JBR0UuQUxMXCIsXCJTVE9SQUdFRklMRS5MSVNUXCIsXCJCQVRDSFwiLFwiT0FVVEguQUxMXCIsXCJJTUFHRS5BTExcIixcIklOVklURS5BTExcIixcIkFDQ09VTlQuQUxMXCJdLFwicm9sZVwiOlwidXNlclwiLFwicmVmXCI6XCJodHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vXCIsXCJkZXZpY2VfaWRcIjpcImIyODIwNWU1YzU5NzRjY2JiODI3MDNiNjhkYjhjNDUxXCJ9IiwiZXhwIjoxNjQ4NjE0NDkzLCJpYXQiOjE2NDg2MDcyMzN9.d3HVLvv_LFw2QhPrhvjH_kICWQJX9sKKt7NjQEqI_xE2JO_b7D8rPsFTZz93PLvZ7MhCmudTjGImUpd-ehFnI4Go-1S7BGaKaHFILvP-sWy18Wpikowjxx9mSbzBM_cO6D1LI-kyYhXKWHgVdADfVIPniTDA7-ffhUpi7cAebEs",
"refresh_token": "060e78d36afb4879b51e4264e9541c16",
"expires_in": 3600,
"token_type": "Bearer",
"user_id": "DING-xxxxx",
"user_name": "pdsuser",
"avatar": "aliyunpds.com/a.jpg",
"nick_name": "pdsuser",
"default_drive_id": 1,
"role": "admin",
"status": "enabled",
"expire_time": "2019-09-01T06:57:48.813Z",
"is_first_login": false,
"device_id": "8574ecc3d4904dc095cc49202e74db94",
"device_name": "4683C25F",
"domain_id": "bj1"
}Error codes
For a list of error codes, visit the Service error codes.
