有奖捉虫:办公协同&微信生态&物联网文档专题 HOT

接口描述

根据分页信息和过滤条件查询组织机构信息。返回结果在同一层级不保证顺序,不存在递归查询。业务端在使用时,需要全量拉取到所有的组织机构,并根据 parent 来确定组织机构之间的父子关系、order 来确定同一层级的组织机构机构之间的顺序。

HTTP 请求方法

GET

请求路径

/scim/api/v2/Organizations?startIndex=10&count=10&filter=displayName eq "组织机构"

请求参数

参数名称
必选
类型
参数类型
描述
startIndex
int
url
开始下标 。默认:1
count
int
url
每一页查询记录数。默认:10;为 -1时,表示查询所有
filter
string
url
查询条件,仅支持组织机构名、更新时间单一条件查询,不支持复杂的逻辑条件查询。操作符仅支持 eq、gt。filter 条件符合 scim 语法
access_token
String
header
access_token,获取 access_token 参数请参见 调用方式
说明
filter 查询条件:
组织机构名查询:filter=displayName eq "test"。
组织机构code查询:filter=code eq "code"。
组织机构parent查询:filter=parent eq "bba542c4263f"。
更新时间查询:filter=lastModified gt "2011-05-13T04:42:34Z"。
displayName、code、parent 仅支持 eq 操作符,meta、lastModified 仅支持 gt 和 lt。

响应状态码

状态码
返回值
描述
200
ok
请求成功

返回字段

参数名称
类型
描述
schemas
array,string
scim的schema,返回字符串数组固定值:
urn:ietf:params:scim:api:messages:2.0:ListResponse
totalResults
int
总记录数
itemsPerPage
int
每页大小,等于入参的 count
startIndex
string
入参的 startIndex
Resources
array,object
数组。首字母 R 大写
- schemas
array,string
scim 的 schema,返回字符串数组固定值:
urn:ietf:params:scim:schemas:core:2.0:Organization
- id
string
组织机构 id
- displayName
string
组织机构名称
- order
long
组织机构同一层级顺序
- code
string
组织机构编码
- parent
string
父组织机构 id
- meta
object
scim 的标准,组织机构的元数据
- resourceType
string
资源类型,固定值 Organization
- created
string
创建时间,格式为:2010-01-23T04:56:22Z
- lastModified
string
最后修改时间,格式为:2010-01-23T04:56:22Z
- version
string
版本号

接口示例

入参示例

http://<host>:<ip>/scim/api/v2/Organizations?startIndex=10&count=10&filter=meta.lastModified gt "2018-04-19T13:47:13Z"

返回示例

{
"schemas": [
"urn:ietf:params:scim:api:messages:2.0:ListResponse"
],
"totalResults": 20,
"itemsPerPage": 10,
"startIndex": 10,
"Resources": [
{
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:Organization"
],
"id": "758f9a69-0a48-43ab-9d76-6cce766c5aaa",
"displayName": "test",
"code": "组织机构编码",
"parent":"458f9a69-0a48-43ab-9d76-6cce766c5aaa",
"meta": {
"resourceType": "Organization",
"created": "2010-01-23T04:56:22Z",
"version":"0",
"lastModified": "2010-01-23T04:56:22Z"
}
}
]
}