All Products
Search
Document Center

Resource Management:AcceptHandshake

Last Updated:Jun 05, 2024

Accepts an invitation.

Operation description

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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
resourcemanager:AcceptHandshakeWrite
  • Handshake
    acs:resourcemanager:*:{#accountId}:handshake/{#HandshakeId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
HandshakeIdstringYes

The ID of the invitation.

You can call the ListHandshakesForAccount operation to obtain the ID.

h-Ih8IuPfvV0t0****

For more information about common request parameters, see Common parameters.

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

5828C836-3286-49A6-9006-15231BB19342
Handshakeobject

The information of the invitation.

Statusstring

The status of the invitation. Valid values:

  • Pending: The invitation is waiting for confirmation.
  • Accepted: The invitation is accepted.
  • Cancelled: The invitation is canceled.
  • Declined: The invitation is rejected.
  • Expired: The invitation expires.
Accepted
ExpireTimestring

The time when the invitation expires. The time is displayed in UTC.

2021-01-20T02:15:40Z
ResourceDirectoryIdstring

The ID of the resource directory.

rd-3G****
CreateTimestring

The time when the invitation was created. The time is displayed in UTC.

2021-01-06T02:15:40Z
Notestring

The comment on the invitation.

Welcome
TargetEntitystring

The ID or logon email address of the invited Alibaba Cloud account.

177242285274****
MasterAccountIdstring

The ID of the management account of the resource directory.

151266687691****
MasterAccountNamestring

The name of the management account of the resource directory.

CompanyA
ModifyTimestring

The time when the invitation was modified. The time is displayed in UTC.

2021-01-06T02:16:40Z
TargetTypestring

The type of the invited Alibaba Cloud account. Valid values:

  • Account: indicates the ID of the Alibaba Cloud account.
  • Email: indicates the logon email address of the Alibaba Cloud account.
Account
HandshakeIdstring

The ID of the invitation.

h-Ih8IuPfvV0t0****

Examples

Sample success responses

JSONformat

{
  "RequestId": "5828C836-3286-49A6-9006-15231BB19342",
  "Handshake": {
    "Status": "Accepted",
    "ExpireTime": "2021-01-20T02:15:40Z",
    "ResourceDirectoryId": "rd-3G****",
    "CreateTime": "2021-01-06T02:15:40Z",
    "Note": "Welcome",
    "TargetEntity": "177242285274****",
    "MasterAccountId": "151266687691****",
    "MasterAccountName": "CompanyA",
    "ModifyTime": "2021-01-06T02:16:40Z",
    "TargetType": "Account",
    "HandshakeId": "h-Ih8IuPfvV0t0****"
  }
}

Error codes

HTTP status codeError codeError messageDescription
400MissingParameter.HandshakeIdYou must specify HandshakeId.-
400InvalidParameter.HandshakeIdThe HandshakeId is invalid.-
404EntityNotExists.HandshakeThe specified handshake does not exist.-
404SpecifiedResourceDirectoryNotExistsThe specified resource directory does not exist. You must specify a valid resource directory.The specified resource directory does not exist. You must specify a valid resource directory.
409HandshakeStatusMismatchThe invitation is invalid.The invitation is invalid.
409NotSupport.AccountInAnotherResourceDirectoryYour account is a management account for another resource directory or a member of another resource directory.Your account is the management account or a member of another resource directory.
409Invalid.AccountTypeThe specified profile type of account is invalid.The specified AccountType is invalid.
409NotSupport.Account.RealNameTypeYour account is not a real-name of enterprise type, so you cannot accept the invitation.You cannot accept the invitation because your account has not passed enterprise real-name verification.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history