Get Manageable User List

获取当前账号权限下可管理的所有用户列表。

约束条件

  • 用户需要有组织管理员权限

请求格式

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

请求参数(Body)

名称 必需/可选 数据类型 描述
pagination 可选 Pagination请求结构体 分页参数。见 Pagination请求结构体>> (若不提供,则默认按照每页1000条数据的格式返回第0页的数据)。

响应参数

名称 数据类型 描述
data List<JSONObject> 以分页列表展示的用户信息。详见 分页用户信息结构体

分页用户信息结构体

名称 数据类型 描述
pagination Pagination结构体 分页信息。
users List<JSONObject> 用户信息列表。详见 用户信息结构体

用户信息结构体

名称 数据类型 描述
id String 用户的ID。
name String 用户名称。
domain String 域名称。
description String 用户描述。
nickName String 用户昵称。
phoneArea String 用户注册电话的区号。
phone String 用户的注册手机号码。
email String 用户的注册邮箱。
createdTime String 用户帐号创建时间。
joinTime String 用户加入当前组织的时间。
type Integer 用户类型,0:App Portal账号,1:第三方域账号。
exists Boolean 用户是否在当前组织,true:存在,false:不存在,null:未启用。

错误码

代码 错误信息 描述
31400 Pagination is required 分页参数不能为空
31403 Need the primary admin permission. 用户需要有组织管理员权限才能查询可管理的用户列表

示例

请求示例

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

method: POST

headers: {"Authorization":"Bearer APP_PORTAL_S_TDKKeqfYBK3m5z3LRgKVqThWDYnRBN44"}

requestBody:
{
    "pagination": {
    "pageNo":0,
    "pageSize":5,
    "sorters":[]
    }
}

返回示例

{
    "code": 0,
    "message": "OK",
    "data": {
        "pagination": {
            "totalElements": 5,
            "pageNo": 0,
            "pageSize": 5
        },
        "users": [
            {
                "id": "userId_1",
                "name": "asd@aaa.com",
                "domain": "新增域测试",
                "description": "",
                "nickName": "",
                "phoneArea": "",
                "phone": "",
                "email": "asd@aaa.com",
                "createdTime": "2019-09-23 02:32:51.0",
                "joinTime": "2019-09-23 02:32:52.0",
                "type": 1
            },
            {
                "id": "userId_2",
                "name": "12345@qq.com",
                "domain": "yang",
                "description": "",
                "nickName": "",
                "phoneArea": "",
                "phone": "",
                "email": "12345@qq.com",
                "createdTime": "2019-09-20 06:46:34.0",
                "joinTime": "2019-09-20 06:46:34.0",
                "type": 1
            },
            {
                "id": "userId_3",
                "name": "435",
                "domain": "",
                "description": "",
                "nickName": "",
                "phoneArea": "",
                "phone": "",
                "email": "435@qq.com",
                "createdTime": "2019-09-19 08:24:17.0",
                "joinTime": "2019-09-19 08:24:17.0",
                "type": 0
            },
            {
                "id": "userId_4",
                "name": "jane",
                "domain": "",
                "description": "",
                "nickName": "",
                "phoneArea": "",
                "phone": "",
                "email": "jane@test.com",
                "createdTime": "2019-05-30 07:41:31.0",
                "joinTime": "2019-09-11 09:42:54.0",
                "type": 0
            },
            {
                "id": "userId_5",
                "name": "portal_test01",
                "domain": "",
                "description": "",
                "nickName": "quququ",
                "phoneArea": "",
                "phone": "123232323",
                "email": "portaltest01@email.com",
                "createdTime": "2019-05-14 08:38:31.0",
                "joinTime": "2019-09-06 14:09:01.0",
                "type": 0
            }
        ]
    }
}

Java SDK 调用示例

public class AppPortalSdkTest{
    @Test
    public void getManageableUserTest() {
        AdminUserListRequest adminUserListRequest = new AdminUserListRequest("your_access_token");
        AdminUserListResponse adminUserListResponse = Poseidon.config(PConfig.init().appKey("your_access_key").appSecret("your_secret_key").debug())
                .url("https://{apigw-address}").getResponse(adminUserListRequest, AdminUserListResponse.class);
        assertNotNull("Response should not be null", adminUserListResponse);
        assertNotNull("Response data should not be null", adminUserListResponse.data);
        assertNotNull("Current page could not be null", adminUserListResponse.data.pagination.pageNo);
    }
}