获取用户所有部门
测试中
GET
/api/v2/users/departments/list
请求参数
Query 参数
orgId
string
可选
示例值:
61dd52c7ad9825f8df7f067a
Header 参数
x-authing-userpool-id
string
用户池 id
示例值:
61b95d6c96d42670da568408
Authorization
string
token
示例值:
Bearer sdfsdfsdf
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://core.authing.cn/api/v2/users/departments/list' \
--header 'x-authing-userpool-id: 61b95d6c96d42670da568408' \
--header 'Authorization: Bearer sdfsdfsdf'
返回响应
🟢200成功
application/json
Body
code
integer
必需
message
string
必需
data
object
必需
list
array [object {3}]
必需
totalCount
integer
必需
示例
{
"code": 200,
"message": "获取成功",
"data": {
"list": [
{
"department": {
"id": "61d697bbddb85f749e19830d",
"createdAt": "2022-01-06T07:18:19.491Z",
"updatedAt": "2022-01-06T07:18:19.491Z",
"userPoolId": "61b95d6c96d42670da568408",
"orgId": "61d6979f7457fcb1b9d24572",
"name": "organization-1-1",
"nameI18n": null,
"description": null,
"descriptionI18n": null,
"order": null,
"code": "6437",
"leaderUserId": null,
"__id": null,
"__parentid": null,
"__groupid": null,
"root": false,
"children": [
"61d698016534289b58624f11"
],
"path": [
"61d6979fc15b41814f80e2ed",
"61d697bbddb85f749e19830d"
],
"codePath": [
"112233",
"6437"
],
"namePath": [
"组织机构-1",
"organization-1-1"
]
},
"joinedAt": "2022-01-10T08:43:59.158Z",
"isMainDepartment": true
},
{
"department": {
"id": "61d698016534289b58624f11",
"createdAt": "2022-01-06T07:19:29.713Z",
"updatedAt": "2022-01-06T07:19:29.713Z",
"userPoolId": "61b95d6c96d42670da568408",
"orgId": "61d6979f7457fcb1b9d24572",
"name": "organization-1-1-1",
"nameI18n": null,
"description": null,
"descriptionI18n": null,
"order": null,
"code": "7628",
"leaderUserId": null,
"__id": null,
"__parentid": null,
"__groupid": null,
"root": false,
"children": [],
"path": [
"61d6979fc15b41814f80e2ed",
"61d697bbddb85f749e19830d",
"61d698016534289b58624f11"
],
"codePath": [
"112233",
"6437",
"7628"
],
"namePath": [
"组织机构-1",
"organization-1-1",
"organization-1-1-1"
]
},
"joinedAt": "2022-01-10T08:44:58.724Z",
"isMainDepartment": false
}
],
"totalCount": 2
}
}
修改于 2022-01-24 07:09:12