Remove Organization Structures

不登录 Application Portal 的状态下给用户移除组织结构。

操作权限

需要在 Application Portal 给应用授权“在本 OU 给用户授权”的权限。

请求格式

POST https://{apigw-address}/app-portal-service/v2.2/structure/removeStructures

请求参数(Body)

名称 必需/可选 数据类型 描述
organizationId 必需 String 组织 ID。如何获取 organizationId 信息>>
userId 必需 String 用户 ID。
structureIds 必需 List 要给用户移除的组织结构 ID。

响应参数

名称 数据类型 描述
data Boolean true 表示移除成功,false 表示移除失败。

错误码

代码 描述
31400 参数错误,长度错误,不能为空等
31403 应用未被授权“在本 OU 给用户授权”的权限
31404 未找到组织

示例

请求示例

url: https://{apigw-address}/app-portal-service/v2.2/structure/removeStructures

method: POST

requestBody:
{"organizationId":"yourOrgId", "userId":"yourUserId","structureIds": ["st1","st2","st3"]}

返回示例

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

Java SDK 调用示例

public class AppPortalSdkTest{
    @Test
    public void removeOrganizationStructures() {
            ArrayList<String> StructureIds = new ArrayList<>();
            StructureIds.add("st1");
            StructuresRemoveRequest structuresRemoveRequest = new StructuresRemoveRequest("your_org_id", "your_user_id",StructureIds);
            Response response = Poseidon.config(PConfig.init().appKey("your_access_key").appSecret("your_secret_key").debug())
                    .url("https://{apigw-address}").getResponse(structuresRemoveRequest, Response.class);

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

            assertNotNull("Response should not be null", structuresRemoveRequest);
            assertNotNull("Response data should not be null", response.data);

    }
}