All Products
Search
Document Center

Drive and Photo Service:LinkAccount

Last Updated:Aug 04, 2025

Associates an account with a user.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request syntax

POST /v2/account/link HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
bodyobjectNo

The request parameters.

user_idstringYes

The ID of the user with which you want to associate an account.

xxx
typestringYes

The account type. Valid values:

  • mobile: a mobile number.
  • email: an email address.
  • ding: a DingTalk account.
  • ram: an Alibaba Cloud Resource Access Management (RAM) user.
  • wechat: a WeCom account.
  • ldap: a Lightweight Directory Access Protocol (LDAP) account.
  • custom: a custom account.
ding
identitystringYes

The unique identifier of the account, such as a mobile number.

eyy***
extrastringNo

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

ParameterTypeDescriptionExample
Token

The information about the access token of the user.

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.