文档

InviteAccountToResourceDirectory

更新时间:

调用InviteAccountToResourceDirectory邀请外部账号加入资源目录。

使用说明

本文将提供一个示例,邀请外部账号someone@example.com加入资源目录。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称

类型

是否必选

示例值

描述

Action String InviteAccountToResourceDirectory

要执行的操作。取值:InviteAccountToResourceDirectory

TargetEntity String someone@example.com

被邀请账号ID或登录邮箱。

TargetType String Email

被邀请账号类型。

  • Account:账号ID。
  • Email:账号登录邮箱。
Note String 欢迎您加入

备注。

最大长度为1024个字符。

Tag.N.Key String k1

标签键。

Tag.N.Value String v1

标签值。

关于公共请求参数的详情,请参见公共参数

返回数据

名称

类型

示例值

描述

RequestId String 9B34724D-54B0-4A51-B34D-4512372FE1BE

请求ID。

Handshake Object

邀请信息。

Status String Pending

邀请状态。

  • Pending:等待确认。
  • Accepted:已接受。
  • Cancelled:已取消。
  • Declined:已拒绝。
  • Expired:超时。
ExpireTime String 2018-08-24T09:55:41Z

邀请的过期时间(UTC时间)。

ResourceDirectoryId String rd-abcdef****

资源目录ID。

CreateTime String 2018-08-10T09:55:41Z

邀请的创建时间(UTC时间)。

Note String 欢迎您加入

备注。

TargetEntity String someone@example.com

被邀请账号ID或登录邮箱。

MasterAccountId String 172841235500****

资源目录管理账号ID。

MasterAccountName String Alice

资源目录管理账号名称。

ModifyTime String 2018-08-10T09:55:41Z

邀请的修改时间(UTC时间)。

TargetType String Email

被邀请账号类型。

  • Account:账号ID。
  • Email:账号登录邮箱。
HandshakeId String h-ycm4rp****

邀请ID。

示例

请求示例

https://resourcemanager.aliyuncs.com/?Action=InviteAccountToResourceDirectory
&TargetEntity=someone@example.com
&TargetType=Email
&<公共请求参数>

正常返回示例

XML格式

HTTP/1.1 200 OK
Content-Type:application/xml

<InviteAccountToResourceDirectoryResponse>
    <RequestId>9B34724D-54B0-4A51-B34D-4512372FE1BE</RequestId>
    <Handshake>
        <HandshakeId>h-ycm4rp****</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-24T09:55:41Z</ExpireTime>
    </Handshake>
</InviteAccountToResourceDirectoryResponse>

JSON格式

HTTP/1.1 200 OK
Content-Type:application/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-24T09:55:41Z"
  }
}

错误码

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无效。
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 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. 被邀请方已存在邀请记录,请先处理邀请。
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. 账号类型无效,请您使用企业类型账号。

访问错误中心查看更多错误码。

  • 本页导读 (1)
文档反馈