Get User Base Info

Get basic information about a user, such as the user ID, based on the user’s email, account and domain, or phone number and phone area code.

Operation Permissions

In Application Portal, the application must be granted the “Obtain the ID, username, email, and phone number of all users in the OU” permission.

Request Format

POST https://{apigw-address}/app-portal-service/v2.2/user/getUserBaseInfo

Request Parameters (Body)

Name

Mandatory/Optional

Data Type

Description

organizationId

Mandatory

String

The OU ID. How to get organizationId>>

email

Optional

String

The user’s email address.

name

Optional

String

The user name.

domain

Optional

String

The domain name.

phoneArea

Optional

String

The area code for the phone number.

phone

Optional

String

The phone number.

Response Parameters

Name

Data Type

Description

data

SimpleUserListDTO Struct

The list of basic information about the user.

SimpleUserListDTO Struct

Name

Data Type

Description

users

List<SimpleUserDTO>

The list of basic information about the user.

SimpleUserDTO Struct

Name

Data Type

Description

id

String

The user ID.

name

String

The user name.

domain

String

The domain that the user belongs to.

email

String

The user’s email address.

Error Codes

Code

Description

31400

Errors such as incorrect parameters, empty parameters, and so on.

31403

The application has not been granted the “Obtain the ID, username, email, and phone number of all users in the OU” permission.

31404

Errors such as organization not found, user not found, and so on.

Samples

Request Sample

url: https://{apigw-address}/app-portal-service/v2.2/user/getUserBaseInfo

method: POST

requestBody:
{"organizationId":"yourOrgId", "email":"yourEmail"}

Return Sample

{
  "code": 0,
  "message": "OK",
  "data": {"users": [{"id": "userId1", "name": "userName1", "domain": "", "email": "email1"}]}
}

Java SDK Sample

public class AppPortalSdkTest{
    @Test
        public void getUserBaseInfo() {
            UserGetBaseInfoRequest userGetBaseInfoRequest = new UserGetBaseInfoRequest("your_org_id", "your_email", null, null, null, null);
            UserGetBaseInfoResponse userGetBaseInfoResponse = Poseidon.config(PConfig.init().appKey("your_access_key").appSecret("your_secret_key").debug())
                    .url("https://{apigw-address}").getResponse(userGetBaseInfoRequest, UserGetBaseInfoResponse.class);

            System.out.println("List organization res: " + JSON.toJSONString(userGetBaseInfoResponse));

            assertNotNull("Response should not be null", userGetBaseInfoResponse);
            assertNotNull("Response data should not be null", userGetBaseInfoResponse.data);
            assertNotNull("Response users should not be null", userGetBaseInfoResponse.data.users);
    }
}