Share this page

# Get list of users by query

## Description

Gets a list of users by using a query filter (available in versions 2020 SP3 and later).

You can also add an additional parameter (`"include=user-role"`) to return user project and project role assignments. This parameter is available in OpenText Enterprise Performance Engineering 2023 and later. The user role response is supported as JSON only; XML is not currently supported.

## URL

Copy code
Get list of users by query

    /Admin/rest/v1/users?query={<QUERY_NAME>[“<YOUR_QUERY_VALUE>”]}

Copy code
Get list of users by query and include user roles

    /Admin/rest/v1/users?query={<QUERY_NAME>[“<YOUR_QUERY_VALUE>”]}&include=user-roles

## Project query values

Below are the Query name options:

- ID. User's ID.
- Name. User's name.
- FullName. User's full name.
- Email. User's email address.

AdditionalData options that return the user's project and project role assignments when `&include=user-roles` is added to the query:

UsersRoles. User role data.

- Domain. The project's domain.

- ProjectName. The project's name.

- ProjectID. The project's ID.

- Role. The name of the role assigned to the project user. For the list of roles available in the project, see the Users page in OpenText Enterprise Performance Engineering Admin.

## HTTP method

GET: Returns a list of users according to the query.

## Request

Headers:

One of the following:

- Content-Type: application/xml

- Content-Type: application/json

Cookies:

ADM_LWSSO={AdmLwssoCookie};

Request body:

None

Request examples:

Copy code
Get list of users by query

    GET http://<LRE_Server>Admin/rest/v1/users?query={name["sa"]}
    Content-Type: application/xml
    Accept: application/xml
    Cookie: ADM_LWSSO={AdmLwssoCookie};

Copy code
Get list of users by query and include user role data

    GET http://<LRE_Server>Admin/rest/v1/users?query={name["sa"]}&include=user-roles
    Content-Type: application/xml
    Accept: application/xml
    Cookie: ADM_LWSSO={AdmLwssoCookie};

## Response

Headers:

One of:

- Accept: application/xml

- Accept: application/json

Cookies:

None

HTML Return Code:

One of the HTTP return codes.

HTML body:

The fields in the response can include any of the following depending on the query.

Element | Description
--- | ---
UserID | The user's ID.
UserName | The user's name.
FullName | The user's full name.
Status | The user's status: active or inactive.
DeactivationDate | The date when user's status was set to inactive.
LastUpdateDate | The date when the user was last updated.
TenantAdmin | Specifies whether the user is a tenant admin: true or false.
SiteAdmin | Specifies whether the user is a site admin: true or false.
AdminViewer | Specifies whether the user is an admin viewer: true or false.
Email | The user's email address.
Description | A description of the user.
Permission level | 1. Regular user 3. Admin Viewer 4. User Admin 5. Application Admin 6. Project Admin 7. Tenant Admin 9. Site Admin 10. System Admin
AdditionalData | Optional fields that return the user's project and project role assignments when `?include=user-roles` is added to the request. UsersRoles Domain. The project's domain. ProjectName. The project's name. ProjectID. The project's ID. Role. The name of the role assigned to the project user. For the list of roles available in the project, see the Users page in OpenText Enterprise Performance Engineering Admin. Note: These fields remain empty if the user was not assigned to any project.
UsIsLDAP | Specifies whether the user is LDAP: true or false.
LDAPServerID | The LDAP server ID.
LDAPUserName | The LDAP user name.
UsDomAuth | The user domain authentication.

Response examples:

Copy code
XML user response example (get list of users by query by name "sa"):

    <Users>
        <User>
            <ID>3</ID>
            <UserName>sa</UserName>
            <FullName>LRE Admin User</FullName>
            <Status>active</Status>
            <LastUpdateDate>2024-04-22T21:04:49.3519267</LastUpdateDate>
            <TenantAdmin>false</TenantAdmin>
            <SiteAdmin>true</SiteAdmin>
            <AdminViewer>false</AdminViewer>
            <Email />
            <Description>LRE Admin User created during installation</Description>
            <PermissionLevel>10</PermissionLevel>
            <UsIsLDAP>false</UsIsLDAP>
            <LDAPServerId>0</LDAPServerId>
            <LDAPUserName />
            <UsDomAuth />
        </User>
    </Users>

Copy code
JSON user response example (get list of users by query by name "sa"):

    [
        {
            "ID": 3,
            "UserName": "sa",
            "FullName": "LRE Admin User",
            "Status": "active",
            "LastUpdateDate": "2024-04-22T21:04:49.3519267",
            "TenantAdmin": false,
            "SiteAdmin": true,
            "AdminViewer": false,
            "Email": "",
            "Description": "LRE Admin User created during installation",
            "PermissionLevel": 10,
            "UsIsLDAP": false,
            "LDAPServerId": 0,
            "LDAPUserName": "",
            "UsDomAuth": "",
            "AdditionalData": null
        }
    ]

See also:

- Add a user
- Update a user
- Change a user's password
- Delete a user
- Assign project and role to user
- Get user by ID
- Get all users

Tips to improve your search results... OpenText™ Enterprise Performance Engineering Admin API Reference OpenText™ Enterprise Performance Engineering All View Local Help Center View Online Help Center(Undefined variable: _rscC_Basic_Variables.VersionLabel)