组织操作
接口调用说明
此页面上的所有端点都以BaseUrl为首拼接,您的baseUrl如下所示:
https://${yourOneAuthDomain}
SSWS Token:
请求以下的API需要包含api_token, 通过管理员登录OneAuth的控制台,【API】-【Token】-【创建token】来创建调用管理API的Token
创建组织
GET **${baseUrl}/api/v1/account/org
获取租户下的用户列表的详情
请求示例
curl -X 'POST' \
'http://${yourOneAuthDomain}/api/v1/account/org?orgName=AB' \
-H 'accept: application/json' \
-H 'Authorization: SSWS ${api_token}'
响应示例
参数 | 描述 | 类型 |
---|---|---|
orgId | 组织的Id,唯一标识 | String |
success | 是否成功 | bool |
查询组织列表
GET ${baseUrl}/api/v1/account/org
查看组织列表
请求示例
curl -X 'GET' \
'http://${yourOneAuthDomain}/api/v1/account/org?page=1&limit=10' \
-H 'accept: application/json' \
-H 'Authorization: SSWS ${api_token}'
响应示例
{
"count": 2,
"organizations": [
{
"orgId": "WAoUgfsM",
"name": "AB集团",
"originId": "AB集团"
},
{
"orgId": "bjHCUb5E",
"name": "CD集团",
"originId": "AB集团"
}
]
}
响应的参数如下。
参数 | 描述 | 类型 |
---|---|---|
orgId | 组织id | String |
name | 组织名称 | String |
originId | 组织外部名称 | String |
查看组织详情
GET ${baseUrl}/api/v1/account/org/{OrgId}
获取指定组织的信息
请求示例
curl -X 'GET' \
'http://${yourOneAuthDomain}/api/v1/account/org/WAoUgfsM' \
-H 'accept: application/json' \
-H 'Authorization: SSWS ${api_token}'
响应示例
{
"orgId": "WAoUgfsM",
"name": "AB集团",
"originId": "AB集团",
"type": "local",
"memberCount": 1452,
"editable": true
}
参数 | 描述 | 类型 |
---|---|---|
orgId | 组织的唯一标识 | String |
name | 组织的名字 | String |
originId | 外部Id | Sting |
type | 本地 or 其他身份源 | String |
memberCount | 用户成员的数量 | String |
editable | 是否可以编辑 | Bool |
更新组织名称
GET ${baseUrl}/api/v1/account/org/{orgId}
更新指定组织的信息 请求示例
curl -X 'PUT' \
'http://192.168.1.199:8002/api/v1/account/org/bjHCUb5E?name=Demo' \
-H 'accept: application/json' \
-H 'Authorization: SSWS ${api_token}'
查看组织下的部门树
GET ${baseUrl}/api/v1/account/org/{orgId}/tree
获取指定组织树(未包含成员), 仅包含部门的信息,不包含部门人员信息
请求示例
curl -X 'GET' \
'http://${yourOneAuthDomain}/api/v1/account/org/WAoUgfsM/tree' \
-H 'accept: application/json' \
-H 'Authorization: SSWS ${api_token}'
响应示例
{
"levelCount": 553,
"treeStruct": [
{
"parentId": "53dYhGNsrNKZG7RV",
"name": "风控线",
"depId": "hvanixnw",
"originId": "50049451"
},
{
"parentId": "",
"name": "顾问",
"depId": "53dYhGNs",
"originId": "50035673"
}
]
}
参数 | 描述 | 类型 |
---|---|---|
levelCount | 部门数量 | String |
name | 部门的名字 | String |
originId | 外部Id | Sting |
parentId | 父部门节点的部门Id | String |
depId | 部门名称 | String |