Get Users Structure List

Get the organization structures of users without logging in to Application Portal.

Operation Permissions

In Application Portal, the application must be granted the “Obtain all user permissions in the OU” permission.

Request Format

POST https://{apigw-address}/app-portal-service/v2.2/userStructures/structureList

Request Parameters (Body)

Name Mandatory/Optional Data Type Description
organizationId Mandatory String The organization ID. How to get organizationId>>
userIds Mandatory List The list of user IDs.
locale Optional String

The language code. If unspecified, it is set to the default value.

  • en_US for English
  • zh_CN for Chinese
  • es_ES for Spanish
  • ja_JP for Japanese

Response Parameters

Name Data Type Description
data Data Struct The information about users and their corresponding organization structures.

Data Struct

Name Data Type Description
usersStructures UsersStructureListResponse Struct The information about users and their corresponding organization structures.

UsersStructureListResponse Struct

Name Data Type Description
usersUserStructures UsersUserStructureDTO Struct The information about users and their corresponding organization structures.
userStructures UserStructureInfoDTO Struct The organization structure information.

UsersUserStructureDTO Struct

Name Data Type Description
userId String The user ID.
structureIds List The list of organization structure IDs.

UserStructureInfoDTO Struct

Name Data Type Description
id String The organization structure ID.
name String The organization structure name.

Error Codes

Code Description
31400 Errors such as incorrect parameters, empty parameters, character limits exceeded, and so on.
31403 The application has not been granted the “Obtain all user permissions in the OU” permission.
31404 Organization not found.

Samples

Request Sample

url: https://{apigw-address}/app-portal-service/v2.2/userStructures/structureList

method: POST

requestBody:
{"organizationId":"yourOrgId","userIds": ["user1","user2","user3"]}

Return Sample

{
    "code": 0,
    "message": "OK",
    "data": {
        "usersUserStructures": [
            {
                "userId": "u15689477086181",
                "structureIds": [
                    "sg16137846308541409",
                    "sg16137851224531195",
                    "sg16243347949301778",
                    "sg16112213077111"
                ]
            }
        ],
        "userStructures": [
            {
                "name": "messageProduce",
                "id": "sg16112213077111"
            },
            {
                "name": "testOrg",
                "id": "sg16137846308541409"
            },
            {
                "name": "OU1_ユーザーは選択 OU1_ユーザーは選択 OU1_ユーザーは選択",
                "id": "sg16137851224531195"
            },
            {
                "name": "structureName001",
                "id": "sg16243347949301778"
            }
        ]
    }
}

Java SDK Sample

public class AppPortalSdkTest{
    @Test
    public void getUsersStructureList() {
            ArrayList<String> userIds = new ArrayList<>();
            userIds.add("user1");
            userIds.add("user2");
            userIds.add("user3");
            UsersStructureListRequest usersStructureListRequest = new UsersStructureListRequest(userIds,"your_org_id","your_locale");
            UsersStructureListResponse response = Poseidon.config(PConfig.init().appKey("your_access_key").appSecret("your_secret_key").debug())
                    .url("https://{apigw-address}").getResponse(usersStructureListRequest, UsersStructureListResponse.class);

            System.out.println("List organization res: " + JSON.toJSONString(response));
            assertNotNull("Response should not be null", response);
            assertNotNull("Response data should not be null", response.data);

    }
}