Invites an account to join a resource directory.
Usage notes
This topic provides an example on how to call the API operation to invite the account someone@example.com
to join a resource directory.
Debugging
Request parameters
Parameter |
Type |
Required |
Example |
Description |
Action | String | Yes | InviteAccountToResourceDirectory | The operation that you want to perform. Set the value to InviteAccountToResourceDirectory. |
TargetEntity | String | Yes | someone@example.com | The ID or logon email address of the account that you want to invite. |
TargetType | String | Yes | The type of the account. Valid values:
|
|
Note | String | No | Welcome | The comment on the invitation. The comment can be up to 1,024 characters in length. |
Tag.N.Key | String | No | k1 | A tag key. |
Tag.N.Value | String | No | v1 | A tag value. |
For more information about common request parameters, see Common parameters.
Response parameters
Parameter |
Type |
Example |
Description |
RequestId | String | 9B34724D-54B0-4A51-B34D-4512372FE1BE | The request ID. |
Handshake | Object | The information about the invitation. |
|
Status | String | Pending | The status of the invitation. Valid values:
|
ExpireTime | String | 2018-08-24T09:55:41Z | The time when the invitation expires. The time is displayed in UTC. |
ResourceDirectoryId | String | rd-abcdef**** | The ID of the resource directory. |
CreateTime | String | 2018-08-10T09:55:41Z | The time when the invitation was created. The time is displayed in UTC. |
Note | String | Welcome | The comment on the invitation. |
TargetEntity | String | someone@example.com | The ID or logon email address of the invited account. |
MasterAccountId | String | 172841235500**** | The ID of the management account of the resource directory. |
MasterAccountName | String | Alice | The name of the management account of the resource directory. |
ModifyTime | String | 2018-08-10T09:55:41Z | The time when the invitation was modified. The time is displayed in UTC. |
TargetType | String | The type of the invited account. Valid values:
|
|
HandshakeId | String | h-ycm4rp**** | The ID of the invitation. |
Examples
Sample requests
https://resourcemanager.aliyuncs.com/?Action=InviteAccountToResourceDirectory
&TargetEntity=someone@example.com
&TargetType=Email
&<Common request parameters>
Sample success responses
XML
format
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>Welcome</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
format
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" : "Welcome",
"Status" : "Pending",
"CreateTime" : "2018-08-10T09:55:41Z",
"ModifyTime" : "2018-08-10T09:55:41Z",
"ExpireTime" : "2018-08-24T09:55:41Z"
}
}
Error codes
HTTP status code |
Error code |
Error message |
Description |
400 | MissingParameter.TargetEntity | You must specify TargetEntity. | The TargetEntity parameter is not configured. Configure this parameter. |
400 | InvalidParameter.TargetEntity | The TargetEntity is invalid. | The value of the TargetEntity parameter is invalid. The value must be the ID or logon email address of an account. |
400 | MissingParameter.TargetType | You must specify TargetType. | The TargetType parameter is not configured. Configure this parameter. |
400 | InvalidParameter.TargetType | The TargetType is invalid. | The value of the TargetType parameter is invalid. The value can be Account or Email. |
400 | InvalidParameter.Note.Length | The length of the invitation note exceeds the limit. | The length of the comment on the invitation has exceeded the upper limit. The comment can be up to 1,024 characters in length. |
400 | InvalidParameter.Note | The Note is invalid. | The value of the Note parameter 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. | The current account has not been used to enable a resource directory. Use the account to enable a resource directory first. |
409 | LimitExceeded.Account | The maximum number of member accounts in a resource directory exceeds the limit. | The number of members in the resource directory has exceeded the upper limit. |
409 | LimitExceeded.InvitationRate | The number of invitations sent exceeds the limit. | The maximum number of invitations you can send per day has been reached. A maximum of 20 invitations can be sent per day. |
409 | EntityAlreadyExists.Handshake | Handshakes with the same target entity already exist. | The invited account has a pending invitation. The owner of the invited account must process the invitation first. |
409 | NotSupport.AccountInAnotherResourceDirectory | Your account is a management account for another resource directory or a member of another resource directory. | Your account is the management account or a member of another resource directory. |
409 | Invalid.AccountType | The specified profile type of account is invalid. | The account type is invalid. Use an enterprise account. |
For a list of error codes, see Service error codes.