Accepts an invitation.
Usage notes
After an invited Alibaba Cloud account joins a resource directory, it becomes a member of the resource directory. By default, the name of the invited Alibaba Cloud account is used as the display name of the account in the resource directory.
This topic provides an example on how to call the API operation to accept the invitation
h-Ih8IuPfvV0t0****
that is initiated to invite the Alibaba Cloud account 177242285274****
to join the resource directory rd-3G****
.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | AcceptHandshake |
The operation that you want to perform. Set the value to AcceptHandshake. |
HandshakeId | String | Yes | h-Ih8IuPfvV0t0**** |
The ID of the invitation. You can call the ListHandshakesForAccount operation to obtain the ID. |
For more information about common request parameters, see Common parameters.
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 5828C836-3286-49A6-9006-15231BB19342 |
The ID of the request. |
Handshake | Object |
The information of the invitation. |
|
Status | String | Accepted |
The status of the invitation. Valid values:
|
ExpireTime | String | 2021-01-20T02:15:40Z |
The time when the invitation expires. The time is displayed in UTC. |
ResourceDirectoryId | String | rd-3G**** |
The ID of the resource directory. |
CreateTime | String | 2021-01-06T02:15:40Z |
The time when the invitation was created. The time is displayed in UTC. |
Note | String | Welcome |
The comment on the invitation. |
TargetEntity | String | 177242285274**** |
The ID or logon email address of the invited Alibaba Cloud account. |
MasterAccountId | String | 151266687691**** |
The ID of the management account of the resource directory. |
MasterAccountName | String | CompanyA |
The name of the management account of the resource directory. |
ModifyTime | String | 2021-01-06T02:16:40Z |
The time when the invitation was modified. The time is displayed in UTC. |
TargetType | String | Account |
The type of the invited Alibaba Cloud account. Valid values:
|
HandshakeId | String | h-Ih8IuPfvV0t0**** |
The ID of the invitation. |
Examples
Sample requests
https://resourcemanager.aliyuncs.com/?Action=AcceptHandshake
&HandshakeId=h-Ih8IuPfvV0t0****
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<AcceptHandshakeResponse>
<RequestId>5828C836-3286-49A6-9006-15231BB19342</RequestId>
<Handshake>
<Status>Accepted</Status>
<ModifyTime>2021-01-06T02:16:40Z</ModifyTime>
<ResourceDirectoryId>rd-3G****</ResourceDirectoryId>
<HandshakeId>h-Ih8IuPfvV0t0****</HandshakeId>
<Note>Welcome</Note>
<CreateTime>2021-01-06T02:15:40Z</CreateTime>
<TargetType>Account</TargetType>
<MasterAccountId>151266687691****</MasterAccountId>
<MasterAccountName>CompanyA</MasterAccountName>
<ExpireTime>2021-01-20T02:15:40Z</ExpireTime>
<TargetEntity>177242285274****</TargetEntity>
</Handshake>
</AcceptHandshakeResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "5828C836-3286-49A6-9006-15231BB19342",
"Handshake" : {
"Status" : "Accepted",
"ModifyTime" : "2021-01-06T02:16:40Z",
"ResourceDirectoryId" : "rd-3G****",
"HandshakeId" : "h-Ih8IuPfvV0t0****",
"Note" : "Welcome",
"CreateTime" : "2021-01-06T02:15:40Z",
"TargetType" : "Account",
"MasterAccountId" : "151266687691****",
"MasterAccountName" : "CompanyA",
"ExpireTime" : "2021-01-20T02:15:40Z",
"TargetEntity" : "177242285274****"
}
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | MissingParameter.HandshakeId | You must specify HandshakeId. | The error message returned because the HandshakeId parameter is not specified. Specify this parameter. |
400 | InvalidParameter.HandshakeId | The HandshakeId is invalid. | The error message returned because the value of the HandshakeId parameter is invalid. The value must start with h- followed by 16 characters. Valid characters include letters and digits. |
404 | EntityNotExists.Handshake | The specified handshake does not exist. | The error message returned because the invitation does not exist. Specify a valid invitation. |
404 | SpecifiedResourceDirectoryNotExists | The specified resource directory does not exist. You must specify a valid resource directory. | The error message returned because the specified resource directory does not exist. Specify a valid resource directory. |
409 | HandshakeStatusMismatch | The invitation is invalid. | The error message returned because the invitation is invalid. |
409 | NotSupport.AccountInAnotherResourceDirectory | Your account is a management account for another resource directory or a member of another resource directory. | The error message returned because your account is the management account or a member of another resource directory. |
409 | Invalid.AccountType | The specified profile type of account is invalid. | The error message returned because the account type is invalid. Use an enterprise account. |
409 | NotSupport.Account.RealNameType | Your account is not a real-name of enterprise type, so you cannot accept the invitation. | The error message returned because your account does not pass enterprise real-name verification and you cannot accept the invitation. |
For a list of error codes, visit the API Error Center.