Queries the information of all the member accounts in a resource directory.

Note Only an enterprise management account can be used to call this operation.

In this example, an enterprise management account is used to query the information of all the member accounts in the resource directory of the enterprise management account. The returned result shows that the resource directory contains two member accounts: member account whose Alibaba Cloud account ID is 184311716100**** and member account whose Alibaba Cloud account ID is 181761095690****.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ListAccounts

The operation that you want to perform. Set the value to ListAccounts.

PageNumber Integer No 1

The number of the page to return.

Pages start from page 1. Default value: 1.

PageSize Integer No 10

The number of entries to return on each page.

Valid values: 1 to 100. Default value: 10.

For more information about common request parameters, see Common parameters.

Response parameters

Parameter Type Example Description
TotalCount Integer 2

The total number of entries returned.

RequestId String 7B8A4E7D-6CFF-471D-84DF-195A7A241ECB

The ID of the request.

PageSize Integer 5

The number of entries returned per page.

PageNumber Integer 1

The page number of the returned page.

Accounts Array of Account

The information of the member accounts.

Account
Status String CreateSuccess

The status of the member account. Valid values:

  • CreateSuccess: The member account is created.
  • PromoteVerifying: The upgrade of the member account is under confirmation.
  • PromoteFailed: The upgrade of the member account failed.
  • PromoteExpired: The upgrade of the member account expired.
  • PromoteCancelled: The upgrade of the member account is canceled.
  • PromoteSuccess: The member account is upgraded.
  • InviteSuccess: The owner of the member account accepted the invitation.
Type String ResourceAccount

The type of the member account.

  • CloudAccount: cloud account
  • ResourceAccount: resource account
DisplayName String test

The name of the member account.

FolderId String fd-QRzuim****

The ID of the folder.

ResourceDirectoryId String rd-3G****

The ID of the resource directory.

JoinTime String 2021-01-18T08:01:50.522Z

The time when the member account joined the resource directory. The time is displayed in UTC.

AccountId String 181761095690****

The Alibaba Cloud account ID of the member account.

JoinMethod String created

The way in which the member account joins the resource directory. Valid values:

  • invited: The member account is invited to join the resource directory.
  • created: The member account is directly created in the resource directory.
ModifyTime String 2021-01-18T08:04:37.668Z

The time when the member account was modified. The time is displayed in UTC.

Examples

Sample requests

https://resourcemanager.aliyuncs.com/?Action=ListAccounts
&<Common request parameters>

Sample success responses

XML format

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

<?xml version="1.0" encoding="UTF-8" ?>
<ListAccountsResponse>
    <TotalCount>2</TotalCount>
    <PageSize>10</PageSize>
    <RequestId>85655883-7FCD-4367-B642-5AF0F49E78F8</RequestId>
    <PageNumber>1</PageNumber>
    <Accounts>
        <Account>
            <Status>CreateSuccess</Status>
            <ModifyTime>2021-03-31T06:04:58.374Z</ModifyTime>
            <JoinMethod>created</JoinMethod>
            <ResourceDirectoryId>rd-3G****</ResourceDirectoryId>
            <Type>ResourceAccount</Type>
            <AccountId>184311716100****</AccountId>
            <DisplayName>Info</DisplayName>
            <JoinTime>2021-03-31T03:23:27.803Z</JoinTime>
            <FolderId>r-Wm****</FolderId>
        </Account>
        <Account>
            <Status>CreateSuccess</Status>
            <ModifyTime>2021-01-18T08:04:37.668Z</ModifyTime>
            <JoinMethod>created</JoinMethod>
            <ResourceDirectoryId>rd-3G****</ResourceDirectoryId>
            <Type>ResourceAccount</Type>
            <AccountId>181761095690****</AccountId>
            <DisplayName>test</DisplayName>
            <JoinTime>2021-01-18T08:01:50.522Z</JoinTime>
            <FolderId>fd-QRzuim****</FolderId>
        </Account>
    </Accounts>
</ListAccountsResponse>

JSON format

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

{
  "TotalCount" : 2,
  "PageSize" : 10,
  "RequestId" : "85655883-7FCD-4367-B642-5AF0F49E78F8",
  "PageNumber" : 1,
  "Accounts" : {
    "Account" : [ {
      "Status" : "CreateSuccess",
      "ModifyTime" : "2021-03-31T06:04:58.374Z",
      "JoinMethod" : "created",
      "ResourceDirectoryId" : "rd-3G****",
      "Type" : "ResourceAccount",
      "AccountId" : "184311716100****",
      "DisplayName" : "Info",
      "JoinTime" : "2021-03-31T03:23:27.803Z",
      "FolderId" : "r-Wm****"
    }, {
      "Status" : "CreateSuccess",
      "ModifyTime" : "2021-01-18T08:04:37.668Z",
      "JoinMethod" : "created",
      "ResourceDirectoryId" : "rd-3G****",
      "Type" : "ResourceAccount",
      "AccountId" : "181761095690****",
      "DisplayName" : "test",
      "JoinTime" : "2021-01-18T08:01:50.522Z",
      "FolderId" : "fd-QRzuim****"
    } ]
  }
}

Error codes

HTTP status code Error code Error message Description
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 error message returned because the resource directory for the account is not enabled. Enable the resource directory for the account.

For a list of error codes, visit the API Error Center.