Get Organization User List

Authorize an application to get a list of all the users under a specified organization (OU) without logging in to the Application Portal.

Operation Permissions

User login to Application Portal is not required.

Prerequisite

The associated application must have access permissions (authorized by the organization administrator) to get the user information.

Request Format

POST https://{apigw-address}/app-portal-service/v2.0/user/organization/roster

Request Parameters (Body)

Name

Mandatory/Optional

Data Type

Description

orgId

Mandatory

String

The organization ID which the asset belongs to. How to get orgId >>

pagination

Optional

Pagination Request Struct

Lists the paging requirements in a request. If not specified, the default pagination size is 1000 pages, starting from 0. For more details, see Pagination Request Struct

Response Parameters

Name

Data Type

Description

data

Data Struct

The pagination and list of the users’ information.

Data Struct

Name

Data Type

Description

pagination

Pagination Struct

The pagination information.

users

Array of Users Struct

The list of the users’ information.

Pagination Struct

Name

Data Type

Description

pageNo

Integer

The request pages.

pageSize

Integer

The number of records in each page.

totalElements

Long

The total number of records.

Users Struct

Name

Data Type

Description

userId

String

The user ID.

email

String

The user’s registered email.

phone

String

The user’s registered phone number.

phoneArea

String

The area code of the user’s registered phone number.

name

String

The user name.

Samples

Request Sample

url: https://{apigw-address}/app-portal-service/v2.0/user/organization/roster
method: POST
requestBody:
{
  "orgId": "yourOrgId",
  "pagination": {
    "pageNo": 0,
    "pageSize": 1000,
    "sorters": []
  }
}

Return Sample

{
  "code": 200,
  "message": "",
  "data": {
    "users": [
      {
        "userId": "userId_1",
        "email": "1234",
        "phone": "",
        "phoneArea": "",
        "name": "1234"
      },
      {
        "userId": "userId_2",
        "email": "71019669@qq.com",
        "phone": "",
        "phoneArea": "",
        "name": "wyf"
      }
    ],
    "pagination": {
      "totalElements": 2,
      "pageNo": 0,
      "pageSize": 1000
    }
  }
}

Java SDK Sample

public class AppPortalSdkTest{
    @Test
    public void getOrganizationUserList() {
        OrganizationUserListRequest request = new OrganizationUserListRequest("your_org_id");

        OrganizationUserListResponse response = Poseidon.config(PConfig.init().appKey("your_access_key").appSecret("your_secret_key").debug())
                .url("https://{apigw-address}").getResponse(request, OrganizationUserListResponse.class);

        assertNotNull("Response should not be null", response);
        assertNotNull("Response data should not be null", response.data);
        assertNotNull("User could not be null", response.data.users);
        assertNotNull("User name could not be null", response.data.users.get(0).name);
    }
}