全部产品
Search
文档中心

资源管理:InviteAccountToResourceDirectory - 邀请外部账号加入资源目录

更新时间:Aug 28, 2026

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

接口说明

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

调试

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

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

resourcemanager:InviteAccountToResourceDirectory

create

*Handshake

acs:resourcemanager:*:{#accountId}:handshake/*

*Folder

acs:resourcemanager:*:{#accountId}:folder/{#ResourceDirectoryPath}

无 无

请求参数

名称

类型

必填

描述

示例值

TargetEntity

string

是

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

someone@example.com

TargetType

string

是

被邀请账号类型。

  • Account:账号 ID。

  • Email:账号登录邮箱。

Email

Note

string

否

备注。

最大长度为 1024 个字符。

欢迎您加入

Tag

array<object>

否

标签

object

否

标签

Key

string

否

标签键。

k1

Value

string

否

标签值。

v1

返回参数

名称

类型

描述

示例值

object

返回结果。

RequestId

string

请求 ID。

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

Handshake

object

邀请信息。

Status

string

邀请状态。取值:

  • Pending:等待确认。

  • Accepted:已接受。

  • Cancelled:已取消。

  • Declined:已拒绝。

  • Expired:超时。

Pending

ExpireTime

string

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

2018-08-24T09:55:41Z

ResourceDirectoryId

string

资源目录 ID。

rd-abcdef****

CreateTime

string

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

2018-08-10T09:55:41Z

Note

string

备注。

欢迎您加入

TargetEntity

string

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

someone@example.com

MasterAccountId

string

资源目录管理账号 ID。

172841235500****

MasterAccountName

string

资源目录管理账号名称。

Alice

ModifyTime

string

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

2018-08-10T09:55:41Z

TargetType

string

被邀请账号类型。取值:

  • Account:账号 ID。

  • Email:账号登录邮箱。

Email

HandshakeId

string

邀请 ID。

h-ycm4rp****

示例

正常返回示例

JSON格式

{
  "RequestId": "9B34724D-54B0-4A51-B34D-4512372FE1BE",
  "Handshake": {
    "Status": "Pending",
    "ExpireTime": "2018-08-24T09:55:41Z",
    "ResourceDirectoryId": "rd-abcdef****",
    "CreateTime": "2018-08-10T09:55:41Z",
    "Note": "欢迎您加入",
    "TargetEntity": "someone@example.com",
    "MasterAccountId": "172841235500****",
    "MasterAccountName": "Alice",
    "ModifyTime": "2018-08-10T09:55:41Z",
    "TargetType": "Email",
    "HandshakeId": "h-ycm4rp****"
  }
}

错误码

HTTP status code

错误码

错误信息

描述

400 MissingParameter.TargetEntity You must specify TargetEntity.
400 InvalidParameter.TargetEntity The TargetEntity is invalid.
400 MissingParameter.TargetType You must specify TargetType.
400 InvalidParameter.TargetType The TargetType is invalid.
400 InvalidParameter.Note.Length The length of the invitation note exceeds the limit.
400 InvalidParameter.Note The Note is invalid.
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.
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 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. 账号类型无效,请您使用企业类型账号。

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

变更历史

更多信息,参考变更详情。