组织信息对外API
组织信息对外api描述SID向应用提供的标准接口,以便外部应用调用。标准接口如下:
一、根据组织id获取所有部门id
当业务系统要同步身份平台的部门信息时, 需要根据组织查询所有部门id
请求⽅式: POST(HTTPS或HTTP)
请求地址: http://self.xxx.edu.cn/linkid/api/organization/public/findAllSonOrganizationIds
注:https方式类似。
请求参数:
["RJXZZZ"]
参数说明:
参数 | 类型 | 是否必须 | 说明 |
---|---|---|---|
request body | 列表 | 是 | 组织id |
返回结果:
{
"code": 200,
"message": "OK",
"data": [
"RJXZZZ",
"R5f91237eef72960006ea0d2d"
]
}
参数说明:
参数 | 类型 | 说明 |
---|---|---|
code | int | 返回状态code |
message | String | 返回状态消息 |
data | 自定义对象 | 返回值为部门id列表 |
请求实例:
curl --location --request POST 'https://idself07.rghall.com.cn/linkid/api/organization/public/findAllSonOrganizationIds' \
--header 'Authorization: Bearer AT-3-eGtb4mKEaU3267KIcMDd2CW5HeozNliC' \
--header 'Content-Type: application/json' \
--data-raw '[ "RJXZZZ"]'
二、根据部门id查询部门详细信息
当业务系统要同步身份平台的部门信息时, 需要根据组织查询所有部门id, 然后根据部门id查询部门详细信息
请求⽅式: GET(HTTPS或HTTP)
请求地址: http://self.xxx.edu.cn/linkid/api/organization/public/findById/{id}
注:https方式类似。
请求参数:
请求示例:
https://ljw.sso.rghall.com.cn/linkid/api/organization/public/findById/R5f91237eef72960006ea0d2d
参数说明:
参数 | 类型 | 是否必须 | 说明 |
---|---|---|---|
id | string | 是 | 部门id(该id是<根据组织id获取所有部门id接口>返回的部门id,后续建议用code查询) |
返回结果:
{
"code": 200,
"message": "OK",
"data": {
"id": "R5f91237eef72960006ea0d2d",
"code": "a",
"desc": null,
"name": "a",
"parent": "RJXZZZ",
"category": "未分类部门",
"createUser": null,
"address": null,
"tel": null,
"official": true,
"version": null,
"isDeleted": false,
"updatedTime": "2020-10-22T06:15:26.598+0000",
"organizationIndex": 1
}
}
参数说明:
参数 | 类型 | 说明 |
---|---|---|
code | int | 返回状态code |
message | String | 返回状态消息 |
data | 自定义对象 | 返回值为部门信息列表 |
id | string | 部门id |
code | string | 部门编码 |
desc | string | 部门描述 |
name | string | 部门名称 |
parent | string | 父部门id |
category | string | 部门分类 |
createUser | string | 创建人 |
address | string | 部门地址 |
tel | string | 部门电话 |
official | boolean | 是否正式部门 |
version | string | 数据版本, 增量采集数据使用 |
isDeleted | boolean | 部门是否删除 |
updatedTime | string | 部门更新时间 |
organizationIndex | int | 部门排序 |
三、同步组织(1.9版本)
业务系统向sid同步组织信息变更
请求⽅式: POST(HTTPS或HTTP)
请求地址: http://self.xxx.edu.cn/linkid/api/public/organization/save
注:https方式类似。
请求参数:
[
{
"code": "a",
"desc": null,
"name": "a",
"parent": "RJXZZZ",
"category": "未分类部门",
"createUser": null,
"address": null,
"tel": null,
"official": true,
"organizationIndex": 1
}, {
"code": "b",
"desc": null,
"name": "b",
"parent": "RJXZZZ",
"category": "未分类部门",
"createUser": null,
"address": null,
"tel": null,
"official": true,
"organizationIndex": 2
}
]
参数说明:
参数 | 类型 | 说明 |
---|---|---|
code | string | 部门编码 |
desc | string | 部门描述 |
name | string | 部门名称 |
parent | string | 父部门编码 |
category | string | 部门分类 |
createUser | string | 创建人 |
address | string | 部门地址 |
tel | string | 部门电话 |
official | boolean | 是否正式部门 |
organizationIndex | int | 部门排序 |
返回结果:
{
"code": 200,
"message": "OK",
"data": true
}
参数说明:
参数 | 类型 | 说明 |
---|---|---|
code | int | 返回状态code |
message | String | 返回状态消息 |
data | Boolean | 返回保存结果 |
四、查询组织(1.9版本)
业务系统向sid查询组织信息
请求⽅式: GET(HTTPS或HTTP)
请求地址: http://self.xxx.edu.cn/linkid/api/public/organization/find/{code}
注:https方式类似。
请求参数:
curl http://self.xxx.edu.cn/linkid/api/public/organization/find/a
参数说明:
参数 | 类型 | 说明 |
---|---|---|
code | string | 部门编码 |
返回结果:
{
"code": 200,
"message": "OK",
"data": {
"code": "a",
"desc": null,
"name": "a",
"parent": "RJXZZZ",
"category": "未分类部门",
"createUser": null,
"address": null,
"tel": null,
"official": true,
"organizationIndex": 1
}
}
参数说明:
参数 | 类型 | 说明 |
---|---|---|
code | int | 返回状态code |
message | String | 返回状态消息 |
data | Object | 返回保存结果 |
code | string | 部门编码 |
desc | string | 部门描述 |
name | string | 部门名称 |
parent | string | 父部门编码 |
category | string | 部门分类 |
createUser | string | 创建人 |
address | string | 部门地址 |
tel | string | 部门电话 |
official | boolean | 是否正式部门 |
organizationIndex | int | 部门排序 |
五、删除组织(1.9版本)
业务系统向sid同步组织被删除
请求⽅式: GET(HTTPS或HTTP)
请求地址: http://self.xxx.edu.cn/linkid/api/public/organization/delete/{code}
注:https方式类似。
请求参数:
curl http://self.xxx.edu.cn/linkid/api/public/organization/delete/a
参数说明:
参数 | 类型 | 说明 |
---|---|---|
code | string | 部门编码 |
返回结果:
{
"code": 200,
"message": "OK",
"data": true
}
参数说明:
参数 | 类型 | 说明 |
---|---|---|
code | int | 返回状态code |
message | String | 返回状态消息 |
data | Boolean | 返回删除结果 |
六、根据组织code获取下级所有部门code(1.9版本)
当业务系统要同步身份平台的部门信息时, 需要根据组织查询所有部门id
请求⽅式: POST(HTTPS或HTTP)
请求地址: http://self.xxx.edu.cn/linkid/api/public/organization/findAllSonOrganizationCodes
注:https方式类似。
请求参数:
["RJXZZZ"]
参数说明:
参数 | 类型 | 是否必须 | 说明 |
---|---|---|---|
request body | 列表 | 是 | 组织id |
返回结果:
{
"code": 200,
"message": "OK",
"data": [
"RJXZZZ",
"BM_001"
]
}
参数说明:
参数 | 类型 | 说明 |
---|---|---|
code | int | 返回状态code |
message | String | 返回状态消息 |
data | 自定义对象 | 返回值为部门code列表 |
接口调用失败请查看开发指南-Token与Api调用失败须知
七、同步组织V2(1.9版本)
业务系统向sid同步组织信息变更
请求⽅式: POST(HTTPS或HTTP)
请求地址: http://self.xxx.edu.cn/linkid/api/public/organization/save/v2
注:https方式类似。
请求参数:
[
{
"code": "a",
"desc": null,
"name": "a",
"parent": "RJXZZZ",
"category": "未分类部门",
"createUser": null,
"address": null,
"tel": null,
"official": true,
"organizationIndex": 1
}, {
"code": "b",
"desc": null,
"name": "b",
"parent": "RJXZZZ",
"category": "未分类部门",
"createUser": null,
"address": null,
"tel": null,
"official": true,
"organizationIndex": 2
}
]
参数说明:
参数 | 类型 | 说明 |
---|---|---|
code | string | 部门编码 |
desc | string | 部门描述 |
name | string | 部门名称 |
parent | string | 父部门编码 |
category | string | 部门分类 |
createUser | string | 创建人 |
address | string | 部门地址 |
tel | string | 部门电话 |
official | boolean | 是否正式部门 |
organizationIndex | int | 部门排序 |
返回结果:
{
"code": 200,
"message": "OK",
"data": {
"successTotal": 1,
"failTotal": 1,
"failDetails": [
{
"originalName": "test1",
"originalCode": "100010",
"originalParentCode": null,
"failReason": "部门名称不能重复"
}
]
}
}
参数说明:
参数 | 类型 | 说明 |
---|---|---|
code | int | 返回状态code |
message | String | 返回状态消息 |
data | Boolean | 返回保存结果 |
successTotal | int | 部门操作成功总数 |
failTotal | int | 部门操作失败总数 |
failDetails | list | 部门失败明细集合 |
originalName | String | 来源部门名称 |
originalCode | String | 来源部门编码 |
originalParentCode | String | 来源父部门编码 |
failReason | String | 失败原因 |