主要使用场景:组织机构接口7.0
该接口能获取下一级组织列表(包含直属组织、下级组织),不越级提供下N级
获取接口访问凭证:accessToken
| url | https://api.tze.cn/user/openapi/org-tree/get-child-list?accessToken={{accessToken}}&org_id=34a84298f98511eaa05a8e7bcf652d8f |
| 请求方式 | get |
| 是否需要鉴权 | 是 |
| 请求数限制 | 否 |
| 接口方向 | 第三方应用->开放平台 |
| 序号 | 字段名 | 约束 | 类型 | 长度 | 说明 |
|---|---|---|---|---|---|
1 |
org_id |
必选 |
String |
当前组织id | |
2 |
child_type |
可选 |
String |
下级类型(1直属组织,2下级组织,3关联组织),与参数is_filter互斥,不能同时使用,多个使用英文逗号分隔 | |
3 |
is_filter |
可选 |
Int |
是否过滤为不同的类型(按照直属,下级,关联3类返回)(1是,0否,默认否,选择1时返回的结构不同,请注意) | |
4 |
org_type |
可选 |
String |
下级机构的类型("1": "机构","2": "学校","3": "校区","4": "部门","5": "学段","6": "年级","7": "班级","8": "企业机构","9": "教学工作室","10": "平台"),多个使用英文逗号分隔 |
| 序号 | 字段名 | 约束 | 类型 | 长度 | 说明 |
|---|---|---|---|---|---|
1 |
code |
必选 |
string |
结果编码,000000:成功, 100001:失败 | |
2 |
message |
必选 |
string |
结果描述 | |
3 |
result |
可选 |
json[] |
结果描述 | |
3.1 |
org_id |
必选 |
string |
组织id | |
3.2 |
org_name |
必选 |
string |
组织名称 | |
3.3 |
org_type |
必选 |
string |
组织类型("1": "机构","2": "学校","3": "校区","4": "部门","5": "学段","6": "年级","7": "班级","8": "企业机构","9": "教学工作室","10": "平台") | |
3.4 |
child_type |
必选 |
string |
所属类别,1直属组织,2下级组织 | |
3.5 |
has_child |
可选 |
string |
是否有下级组织,0:没有;1:有 | |
3.6 |
has_platform |
必选 |
string |
是否有开通平台,0:没有;1:有 | |
3.7 |
display_order |
必选 |
int |
排序 |
请求示例
http://api.tze.cn/user/openapi/org-tree/get-child-list?accessToken={{accessToken}}&org_id=34a84298f98511eaa05a8e7bcf652d8f
返回示例
{
"code": "000000",
"result": [
{
"org_id": "fc861290f98511eabe9c8e7bcf652d8f",
"org_name": "苏州关南中学",
"org_type": "2",
"has_child": "0",
"has_platform": "0",
"child_type": "1",
"display_order": "1600416445"
},
{
"org_id": "94385396006b11ebbd58fa377e40e9a5",
"org_name": "测试机构",
"org_type": "1",
"has_child": "0",
"has_platform": "0",
"child_type": "1",
"display_order": "1601174760"
},
{
"org_id": "41622ed20c2b11eb9cb1e6c13199e9ac",
"org_name": "振华中学",
"org_type": "2",
"has_child": "0",
"has_platform": "0",
"child_type": "1",
"display_order": "1602466545"
},
{
"org_id": "2764eed80c2c11eb871ae6c13199e9ac",
"org_name": "苏州市立达中学校",
"org_type": "2",
"has_child": "0",
"has_platform": "0",
"child_type": "1",
"display_order": "1602466934"
},
{
"org_id": "dd3a77640c2c11eba155e6c13199e9ac",
"org_name": "苏州市振吴实验学校",
"org_type": "2",
"has_child": "0",
"has_platform": "0",
"child_type": "1",
"display_order": "1602467239"
},
{
"org_id": "357a7df20c2d11ebaab5e6c13199e9ac",
"org_name": "苏州市盲聋学校",
"org_type": "2",
"has_child": "0",
"has_platform": "0",
"child_type": "1",
"display_order": "1602467387"
},
{
"org_id": "227f37fa0c2e11eba155e6c13199e9ac",
"org_name": "苏州市景范中学校",
"org_type": "2",
"has_child": "0",
"has_platform": "0",
"child_type": "1",
"display_order": "1602467785"
},
{
"org_id": "4a98af960c2e11ebaab5e6c13199e9ac",
"org_name": "江苏省新苏师范学校附属小学",
"org_type": "2",
"has_child": "0",
"has_platform": "0",
"child_type": "1",
"display_order": "1602467852"
},
{
"org_id": "b9180e760c2e11eba155e6c13199e9ac",
"org_name": "苏州市彩香实验中学校",
"org_type": "2",
"has_child": "0",
"has_platform": "0",
"child_type": "1",
"display_order": "1602468037"
},
{
"org_id": "abafa674218a11eb9411862a97ea0e3b",
"org_name": "苏州市电化教育馆",
"org_type": "1",
"has_child": "0",
"has_platform": "0",
"child_type": "1",
"display_order": "1604816503"
}
],
"_timestamp": "1631156317.7171",
"_runtime": "0.0597"
}
| 序号 | 字段名 | 约束 | 类型 | 长度 | 说明 |
|---|---|---|---|---|---|
1 |
msgType |
必选 |
String |
10 |
消息类型,此时固定为:text |
1.1 |
text |
必选 |
Json |
- |
text消息体 |
1.1.1 |
content |
必选 |
String |
消息内容 |
{
"msgtype": "text",
"text": {
"content": "zhxy msg text test 12"
}
}
| 序号 | 字段名 | 约束 | 类型 | 长度 | 说明 |
|---|---|---|---|---|---|
1 |
msgType |
必选 |
String |
10 |
消息类型,此时固定为:link |
2 |
link |
必选 |
Json |
- |
link消息体 |
2.1 |
pcUrl |
必选 |
String |
PC端消息点击链接地址 |
|
2.2 |
appUrl |
必选 |
String |
移动客户端点击消息时跳转到的H5地址 |
|
2.3 |
title |
必选 |
String |
消息标题 |
|
2.4 |
busiId |
必选 |
String |
对应业务的id |
|
2.5 |
content |
必选 |
String |
消息描述 |
|
2.6 |
picUrl |
必选 |
String |
图文消息的图片链接,支持JPG、PNG格式,较好的效果为大图640*320,小图80*80。如不填,在客户端不显示图片 |
{
"msgtype": "link",
"link": {
"pcUrl": "http://www.baidu.com",
"appUrl": "http://www.baidu.com",
"picUrl": "http://xxx.yyy.com/zzz.jpg",
"content": "百度一下",
"title": "百度",
"busiId":"AQWER1234"
}
}
| 序号 | 字段名 | 约束 | 类型 | 长度 | 说明 |
|---|---|---|---|---|---|
1 |
msgType |
必选 |
String |
10 |
消息类型,此时固定为:oa |
2 |
busiId |
必选 |
String |
- |
该条oa消息在业务系统对应的id |
3 |
pcUrl |
必选 |
String |
消息点击链接地址 |
|
4 |
appUrl |
必选 |
String |
移动客户端点击消息时跳转到的H5地址 |
|
5 |
oa |
必选 |
Json |
- |
oa类型消息体 |
5.1 |
head |
必选 |
Json |
255 |
消息头部Json |
5.1.1 |
text |
必选 |
String |
255 |
消息的头部标题 |
5.1.2 |
bgColor |
可选 |
String |
消息头部的背景颜色。长度限制为8个英文字符,其中前2为表示透明度,后6位表示颜色值。不要添加0x。默认值:FFCC0000 |
|
5.2 |
body |
可选 |
Json |
消息体 |
|
5.2.1 |
title |
可选 |
String |
消息体的标题 |
|
5.2.2 |
content |
可选 |
String |
消息体的正文 |
|
5.2.3 |
imageUrl |
可选 |
String |
消息体中的图片url |
|
5.2.4 |
fileCount |
可选 |
String |
自定义的附件数目。此数字仅供显示,不作验证 |
|
5.2.5 |
author |
可选 |
String |
自定义的作者名字 |
|
5.2.6 |
form |
可选 |
Json数组 |
消息体的表单,最多6个 |
|
5.2.7 |
key |
可选 |
String |
消息体的关键字 |
|
5.2.8 |
value |
可选 |
String |
消息体的关键字对应的值 |