调用InviteAccountToResourceDirectory邀请外部账号加入资源目录。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | InviteAccountToResourceDirectory |
要执行的操作。取值:InviteAccountToResourceDirectory。 |
TargetEntity | String | 是 | someone@example.com |
被邀请账号ID或登录邮箱。 |
TargetType | String | 是 |
被邀请账号类型。
|
|
Note | String | 否 | 欢迎您加入 |
备注。 最大长度为1024个字符。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
Handshake | Struct |
邀请信息。 |
|
CreateTime | String | 2018-08-10T09:55:41Z |
邀请的创建时间。 |
ExpireTime | String | 2018-08-10T09:55:41Z |
邀请的过期时间。 |
HandshakeId | String | h-ycm4rp**** |
邀请ID。 |
MasterAccountId | String | 172841235500**** |
资源目录主账号ID。 |
MasterAccountName | String | Alice |
资源目录主账号名称。 |
ModifyTime | String | 2018-08-10T09:55:41Z |
邀请的修改时间。 |
Note | String | 欢迎您加入 |
备注。 |
ResourceDirectoryId | String | rd-abcdef**** |
资源目录ID。 |
Status | String | Pending |
邀请状态。
|
TargetEntity | String | someone@example.com |
被邀请账号ID或登录邮箱。 |
TargetType | String |
被邀请账号类型。
|
|
RequestId | String | 9B34724D-54B0-4A51-B34D-4512372FE1BE |
请求ID。 |
示例
请求示例
https://resource-manager.aliyuncs.com/?Action=InviteAccountToResourceDirectory
&TargetEntity=someone@example.com
&TargetType=Email
&<公共请求参数>
正常返回示例
XML
格式
<InviteAccountToResourceDirectoryResponse>
<RequestId>9B34724D-54B0-4A51-B34D-4512372FE1BE</RequestId>
<Handshake>
<HandshakeId>h-ycm4r****</HandshakeId>
<ResourceDirectoryId>rd-abcdef****</ResourceDirectoryId>
<MasterAccountId>172841235500****</MasterAccountId>
<MasterAccountName>Alice</MasterAccountName>
<TargetEntity>someone@example.com</TargetEntity>
<TargetType>Email</TargetType>
<Note>欢迎您加入</Note>
<Status>Pending</Status>
<CreateTime>2018-08-10T09:55:41Z</CreateTime>
<ModifyTime>2018-08-10T09:55:41Z</ModifyTime>
<ExpireTime>2018-08-17T09:55:41Z7</ExpireTime>
</Handshake>
</InviteAccountToResourceDirectoryResponse>
JSON
格式
{
"RequestId": "9B34724D-54B0-4A51-B34D-4512372FE1BE",
"Handshake": {
"HandshakeId": "h-ycm4rp****",
"ResourceDirectoryId": "rd-abcdef****",
"MasterAccountId": "172841235500****",
"MasterAccountName": "Alice",
"TargetEntity": "someone@example.com",
"TargetType": "Email",
"Note": "欢迎您加入",
"Status": "Pending",
"CreateTime": "2018-08-10T09:55:41Z",
"ModifyTime": "2018-08-10T09:55:41Z",
"ExpireTime": "2018-08-17T09:55:41Z7"
}
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | MissingParameter.TargetEntity | You must specify TargetEntity. | 邀请方信息缺失,请指定目标实体。 |
400 | InvalidParameter.TargetEntity | The TargetEntity is invalid. | 目标实体无效,请指定账号UID/账号登录邮箱。 |
400 | MissingParameter.TargetType | You must specify TargetType. | 邀请类型缺失,请指定目标类型。 |
400 | InvalidParameter.TargetType | The TargetType is invalid. | 邀请类型无效,请指定账号UID/账号登录邮箱。 |
400 | InvalidParameter.Note.Length | The length of the invitation note exceeds the limit. | 邀请备注长度超出限制,最多不能超过1024个字符或汉字。 |
400 | InvalidParameter.Note | The Note is invalid. | Note无效。 |
409 | LimitExceeded.Account | The maximum number of member accounts in a resource directory exceeds the limit. | 资源目录中的成员数量超出限制。 |
409 | LimitExceeded.InvitationRate | The number of invitations sent exceeds the limit. | 发送邀请数量超出限制,每日最多只能发送20条邀请。 |
409 | EntityAlreadyExists.Handshake | Handshakes with the same target entity already exist. | 被邀请方已存在邀请记录,请先处理邀请。 |
404 | EntityNotExists.ResourceDirectory | The resource directory for the account is not enabled. We recommend that you first enable the resource directory for the account. | 当前账号未启用资源目录,请先启用资源目录。 |
409 | NotSupport.AccountInAnotherResourceDirectory | The specified account is an Alibaba Cloud account or already exists in another resource directory. | 当前账号是主账号或已经在另一个资源目录内。 |
409 | LegalEntityMismatch | Your account does not have the same legal entity as the master account. | 被邀请方与当前账号法律主体不一致。 |
409 | Invalid.AccountType | The specified profile type of account is invalid. | 账号类型无效,请您使用企业类型账号。 |
访问错误中心查看更多错误码。