被邀请的阿里云账号调用AcceptHandshake接受邀请。
使用说明
被邀请的阿里云账号成功加入资源目录后,会成为资源目录的成员。资源目录默认使用被邀请的阿里云账号名称作为该成员的成员名称和账号名称。
本文将提供一个示例,被邀请的阿里云账号177242285274****
接受来自资源目录rd-3G****
的邀请,邀请ID是h-Ih8IuPfvV0t0****
。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | AcceptHandshake |
要执行的操作。取值:AcceptHandshake。 |
HandshakeId | String | 是 | h-Ih8IuPfvV0t0**** |
邀请ID。 您可以调用ListHandshakesForAccount获取邀请ID。 |
关于公共请求参数的详情,请参见公共参数。
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | 5828C836-3286-49A6-9006-15231BB19342 |
请求ID。 |
Handshake | Object |
邀请信息。 |
|
Status | String | Accepted |
邀请状态。取值:
|
ExpireTime | String | 2021-01-20T02:15:40Z |
邀请的过期时间(UTC时间)。 |
ResourceDirectoryId | String | rd-3G**** |
资源目录ID。 |
CreateTime | String | 2021-01-06T02:15:40Z |
邀请的创建时间(UTC时间)。 |
Note | String | 欢迎您加入 |
备注。 |
TargetEntity | String | 177242285274**** |
被邀请的阿里云账号ID或登录邮箱。 |
MasterAccountId | String | 151266687691**** |
资源目录的管理账号ID。 |
MasterAccountName | String | CompanyA |
资源目录的管理账号名称。 |
ModifyTime | String | 2021-01-06T02:16:40Z |
邀请的修改时间(UTC时间)。 |
TargetType | String | Account |
被邀请的阿里云账号类型。取值:
|
HandshakeId | String | h-Ih8IuPfvV0t0**** |
邀请ID。 |
示例
请求示例
https://resourcemanager.aliyuncs.com/?Action=AcceptHandshake
&HandshakeId=h-Ih8IuPfvV0t0****
&<公共请求参数>
正常返回示例
XML
格式
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>欢迎您加入</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
格式
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" : "欢迎您加入",
"CreateTime" : "2021-01-06T02:15:40Z",
"TargetType" : "Account",
"MasterAccountId" : "151266687691****",
"MasterAccountName" : "CompanyA",
"ExpireTime" : "2021-01-20T02:15:40Z",
"TargetEntity" : "177242285274****"
}
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | MissingParameter.HandshakeId | You must specify HandshakeId. | 邀请ID缺失,请指定目标ID。 |
400 | InvalidParameter.HandshakeId | The HandshakeId is invalid. | 邀请ID无效,邀请ID应以“h-”开头+16位数字或英文字母。 |
404 | EntityNotExists.Handshake | The specified handshake does not exist. | 邀请不存在,请指定正确的邀请。 |
404 | SpecifiedResourceDirectoryNotExists | The specified resource directory does not exist. You must specify a valid resource directory. | 资源目录不存在,请指定正确的资源目录。 |
409 | HandshakeStatusMismatch | The invitation is invalid. | 握手状态不匹配或邀请已失效。 |
409 | NotSupport.AccountInAnotherResourceDirectory | Your account is a management account for another resource directory or a member of another resource directory. | 您的账号是另一个资源目录的管理账号或是另一个资源目录内的成员。 |
409 | Invalid.AccountType | The specified profile type of account is invalid. | 账号类型无效,请您使用企业类型账号。 |
409 | NotSupport.Account.RealNameType | Your account is not a real-name of enterprise type, so you cannot accept the invitation. | 您的账号非企业类型实名,无法接受邀请。 |
访问错误中心查看更多错误码。