Join Users

Assign users to an organization without logging in to Application Portal.

Operation Permissions

In Application Portal, the application must be granted the “Create or delete user accounts in the OU” permission.

Request Format

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

Request Parameters (Body)

Name

Mandatory/Optional

Data Type

Description

organizationId

Mandatory

String

The organization ID. How to get organizationId>>

userIds

Mandatory

List

The user ID to be assigned to the organization.

Response Parameters

Name

Data Type

Description

data

Boolean

true indicates that assignment of users was successful, false indicates that assignment of users failed.

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 “Create or delete user accounts in the OU” permission.

31404

Organization not found.

Samples

Request Sample

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

method: POST

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

Return Sample

{
  "code": 0,
  "message": "OK",
  "data": true
}

Java SDK Sample

public class AppPortalSdkTest{
    @Test
    public void joinUsers() {
            ArrayList<String> userIds = new ArrayList<>();
            userIds.add("user1");
            userIds.add("user2");
            userIds.add("user3");
            UsersJoinRequest usersJoinRequest = new UsersJoinRequest(userIds,"your_org_id");
            Response response = Poseidon.config(PConfig.init().appKey("your_access_key").appSecret("your_secret_key").debug())
                    .url("https://{apigw-address}").getResponse(usersJoinRequest, Response.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);

    }
}