调用InviteAccountToResourceDirectory邀请外部账号加入资源目录。
接口说明
本文将提供一个示例,邀请外部账号someone@example.com加入资源目录。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
resourcemanager:InviteAccountToResourceDirectory |
create |
*Handshake
*Folder
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| TargetEntity |
string |
是 |
被邀请账号 ID 或登录邮箱。 |
someone@example.com |
| TargetType |
string |
是 |
被邀请账号类型。
|
|
| 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 |
| 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 |
被邀请账号类型。取值:
|
|
| 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. | 账号类型无效,请您使用企业类型账号。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。