All Products
Search
Document Center

CloudSSO:ListUsers

Last Updated:Jun 14, 2024

Queries users.

Operation description

This topic provides an example on how to query users in the d-00fc2p61**** directory. The returned result shows that the directory contains two users. The user AliceLee is synchronized from an external identity provider (IdP). The user user1 is manually created within CloudSSO.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
cloudsso:ListUsersList
  • User
    acs:cloudsso:{#regionId}:{#accountId}:directory/{#DirectoryId}/user/*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DirectoryIdstringYes

The ID of the resource directory.

d-00fc2p61****
StatusstringNo

The status of the user. The parameter can be used to filter users. Valid values:

  • Enabled: The logon of the user is enabled.
  • Disabled: The logon of the user is disabled.
Enabled
ProvisionTypestringNo

The type of the user. The parameter can be used to filter users. Valid values:

  • Manual: The user is manually created.
  • Synchronized: The user is synchronized from an external identity provider (IdP).
Manual
FilterstringNo

The filter condition.

You must specify the value in the <Attribute> <Operator> <Value> format. The value is not case-sensitive. You can set <Attribute> only to UserName and Operator only to eq or sw. The value eq indicates Equals, and the value sw indicates Start With.

For example, if you set the Filter parameter to UserName sw test, the operation queries the users whose names start with test. If you set the Filter parameter to UserName eq testuser, the operation queries the user whose name is testuser.

UserName sw test
MaxResultsintegerNo

The number of entries per page.

Valid values: 1 to 100.

Default value: 10.

10
NextTokenstringNo

The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of the NextToken parameter.

When you call this operation for the first time, if the total number of entries to return is larger than the value of the MaxResults parameter, the entries are truncated. The system returns entries based on the value of the MaxResults parameter, and does not return the excess entries. In this case, the value of the response parameter IsTruncated is true, and the NextToken parameter is returned. In the next call, you can use the value of the NextToken parameter and maintain the settings of the other request parameters to query the excess entries. You can repeat the call until the value of the IsTruncated parameter becomes false. This way, all entries are returned.

K1c3o9K7pFxoTtxH1Nm7MMLb7zrDGvftYBQBPDVv7AD3a8yhRb3Mk8L9ivmN6bFSjfkZNTAg3h4****

Response parameters

ParameterTypeDescriptionExample
object

The returned results.

NextTokenstring

The pagination token that is used in the next request to retrieve a new page of results.

Note This parameter is returned only when the IsTruncated parameter is true.
K1c3o9K7pFxoTtxH1Nm7MMLb7zrDGvftYBQBPDVv7AD3a8yhRb3Mk8L9ivmN6bFSjfkZNTAg3h4****
RequestIdstring

The request ID.

734D9AAC-9A8E-5DF6-A633-ADE70FF2A9B1
MaxResultsinteger

The number of entries per page.

10
TotalCountsinteger

The total number of entries returned.

2
IsTruncatedboolean

Indicates whether the queried entries are truncated. Valid values:

  • true
  • false
false
Usersobject []

The users.

Statusstring

The status of the user. Valid values:

  • Enabled: The logon of the user is enabled.
  • Disabled: The logon of the user is disabled.
Enabled
UserNamestring

The name of the user.

AliceLee@example.onmicrosoft.com
Emailstring

The email address of the user.

AliceLee@example.onmicrosoft.com
Descriptionstring

The description of the user.

This is a user.
UserIdstring

The ID of the user.

u-00bikzkuzbb58luh****
FirstNamestring

The first name of the user.

Alice
CreateTimestring

The time when the user was created. The value is displayed in UTC.

2021-06-30T09:20:08Z
ProvisionTypestring

The type of the user. Valid values:

  • Manual: The user is manually created.
  • Synchronized: The user is synchronized from an external IdP.
Synchronized
DisplayNamestring

The display name of the user.

AliceLee
UpdateTimestring

The time when the information about the user was modified. The value is displayed in UTC.

2021-06-30T09:20:08Z
LastNamestring

The last name of the user.

Lee
ExternalIdobject

The identifier information about the user synchronized from an external IdP.

Idstring

The identifier of the user that is synchronized from an external IdP.

c73******a5fdd5
Issuerstring

The method for external identity synchronization. Only System for Cross-domain Identity Management (SCIM) synchronization is supported.

SCIM

Examples

Sample success responses

JSONformat

{
  "NextToken": "K1c3o9K7pFxoTtxH1Nm7MMLb7zrDGvftYBQBPDVv7AD3a8yhRb3Mk8L9ivmN6bFSjfkZNTAg3h4****",
  "RequestId": "734D9AAC-9A8E-5DF6-A633-ADE70FF2A9B1",
  "MaxResults": 10,
  "TotalCounts": 2,
  "IsTruncated": false,
  "Users": [
    {
      "Status": "Enabled",
      "UserName": "AliceLee@example.onmicrosoft.com",
      "Email": "AliceLee@example.onmicrosoft.com",
      "Description": "This is a user.",
      "UserId": "u-00bikzkuzbb58luh****",
      "FirstName": "Alice",
      "CreateTime": "2021-06-30T09:20:08Z",
      "ProvisionType": "Synchronized",
      "DisplayName": "AliceLee",
      "UpdateTime": "2021-06-30T09:20:08Z",
      "LastName": "Lee",
      "ExternalId": {
        "Id": "c73******a5fdd5\n",
        "Issuer": "SCIM"
      }
    }
  ]
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-03-29The response structure of the API has changedsee changesets
Change itemChange content
Output ParametersThe response structure of the API has changed.