Updated on 2024-07-30 GMT+08:00

Listing Users

Function

List users in a department. If department_id is not specified, the user list of the organization to which the current sign-in user belongs is queried.

URI

GET /koodrive/ose/v1/userList

Table 1 Query Parameters

Parameter

Mandatory

Type

Description

deptId

No

String

Department ID.

isDirect

No

Boolean

Whether the user belongs to the root department. Default value: false.

offset

Yes

String

Offset. Minimum value: 0.

limit

Yes

String

Maximum number of records to be returned. Value range: 1 to 100.

keyWord

No

String

Search keyword. You can use name as the search criterion.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Authorization

Yes

String

Access token. Token authentication is used to call KooDrive APIs. A token indicates the permission. When an API is called, the token is added to the request header to obtain the operation permission. For details about how to obtain an access token, see the corresponding developer guide. The format is Bearer+{access_token}.

X-Traceid

No

String

Message log trace ID. The value contains 58 bits.

language

No

String

Language code, which complies with the internationalization specifications. For example, en-US indicates English (United States). English (United States) is used by default.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

code

String

Response code.

msg

String

Response message.

data

Array of userInfo objects

User information.

Table 4 userInfo

Parameter

Type

Description

name

String

Name.

userId

String

User ID.

deptId

String

Department ID.

deptName

String

Department name.

mobile

String

Mobile number.

role

Integer

Role.

status

Integer

Status.

id

String

Third-party user ID.

Example Requests

Lists 10 users in department 1243693141656107521, starting from the first user.

GET /koodrive/ose/v1/userList?deptId=1243693141656107521&offset=0&limit=10

Authorization:Bearer+10f88**********4791e9ff

Example Responses

Status code: 200

User list information.

{
  "list": [
    {
      "id": "1316083732377071000VW5TYWZlSW50ZWdlcg==",
      "userId": "1008600000293202821",
      "deptId": "1243693141656107500VW5TYWZlSW50ZWdlcg==",
      "deptName": "newDept",
      "mobile": "0086181****8439",
      "name": "Sam",
      "role": 1,
      "status": 0,
    },
    {
      "id": "1315783852559526700VW5TYWZlSW50ZWdlcg==",
      "userId": "1008600000292227464",
      "deptId": "1243693141656107500VW5TYWZlSW50ZWdlcg==",
      "deptName": "newDept",
      "mobile": "0086151****8338",
      "name": "test123",
      "role": 1,
      "status": 2
    }
  ],
  "total": 2,
  "code": 0,
  "msg": "success"
}

Status Codes

Status Code

Description

200

User list information.