成员管理
获取部门成员详情
(school/user/list)
请求方式:GET(HTTPS)
请求地址:https://oapi.szns.edu.cn/school/user/list?access_token=ACCESS_TOKEN&department_id=DEPARTMENT_ID&fetch_child=FETCH_CHILD
参数说明:
参数 | 必须 | 说明 |
---|---|---|
access_token | 是 | 调用接口凭证 |
department_id | 是 | 获取的部门id |
fetch_child | 否 | 1/0:是否递归获取子部门下面的成员 |
返回结果:
{
"errcode": 0,
"errmsg": "ok",
"students":[
{
"student_userid": "zhangsan",
"name": "张三",
"department": [1, 2],
"virtaul_department": [3, 4],
"parents": [
{
"parent_userid": "zhangsan_parent1",
"relation": "爸爸",
"is_subscribe": 1,
"name":"xxx"
},
{
"parent_userid": "zhangsan_parent2",
"relation": "妈妈",
"is_subscribe": 0
}
]
},
{
"student_userid": "lisi",
"name": "李四",
"department": [4, 5],
"parents": [
{
"parent_userid": "lisi_parent1",
"relation": "爷爷",
"is_subscribe": 1,
"name":"xxx"
},
{
"parent_userid": "lisi_parent2",
"relation": "妈妈",
"is_subscribe": 1,
"name":"xxx"
}
]
}
]
}
参数说明:
参数 | 说明 |
---|---|
errcode | 返回码 |
errmsg | 对返回码的文本描述内容 |
students | 学生列表 |
students.student_userid | 学生UserID |
students.name | 学生名字 |
students.department | 学生所在的班级id列表,不超过20个 |
students.virtaul_department | 学生所在的兴趣虚拟班班级id列表,不超过20个 |
students.parents | 学生家长列表 |
students.parents.parent_userid | 家长的userid |
students.parents.relation | 学生与家长的关系 |
students.parent.is_subscribe | 家长是否关注了“学校通知”,0-未关注,1-已关注 |
students.parent.name | 家长姓名 |
读取学生或家长
(school/user/get)
请求方式:GET(HTTPS)
请求地址:https://oapi.szns.edu.cn/school/user/get?access_token=ACCESS_TOKEN&userid=USERID
参数说明:
参数 | 必须 | 说明 |
---|---|---|
access_token | 是 | 调用接口凭证 |
userid | 是 | 家校通讯录的userid,家长或者学生的userid。不区分大小写,长度为1~64个字节 |
返回结果:
{
"errcode": 0,
"errmsg": "ok",
"user_type": 1,
"student":{
"student_userid": "zhangsan",
"name": "张三",
"department": [1, 2],
"joinDate": "2020-08-07",
"isStay": 1,
"isStudying": 2,
"birthday": "2020-08-07",
"parents":[
{
"parent_userid": "zhangsan_parent1",
"relation": "爸爸",
"is_subscribe": 1,
"name":"xxxxx"
},
{
"parent_userid": "zhangsan_parent2",
"relation": "妈妈",
"is_subscribe": 0
}
]
},
"parent":{
"parent_userid": "zhangsan_parent2",
"is_subscribe": 1,
"name":"xxxxx",
"children":[
{
"student_userid": "zhangsan",
"relation": "妈妈"
},
{
"student_userid": "lisi",
"relation": "伯母"
}
]
}
}
参数说明:
参数 | 说明 |
---|---|
errcode | 返回码 |
errmsg | 对返回码的文本描述内容 |
user_type | 用户类型:1表示学生,2表示家长 |
student | 学生字段,user_type为1时返回该字段 |
student.gender | 学生性别 |
student.student_userid | 学生UserID |
student.name | 学生名字 |
student.department | 学生所在的班级id列表,不超过20个 |
student.student_no | 学生学号 |
student.joinDate | 入学日期 |
student.isStay | 是否住宿 |
student.isStudying | 是否在读 |
student.birthday | 出生日期 |
student.parents | 学生家长列表 |
student.parents.parent_userid | 家长的userid |
student.parents.relation | 与家长的关系 |
student.parents.name | 家长姓名 |
parent | 学生家长,user_type为2时返回该字段 |
parent.parent_userid | 家长的userid |
parents.relation | 学生与家长的关系 |
parent.is_subscribe | 家长是否关注了“学校通知”,0-未关注,1-已关注 |
parent.children | 家长孩子列表 |
parent.children.student_userid | 学生的userid |
parent.children.relation | 家长与孩子关系 |
拉取学生在教师下有权限的班级列表
(user/class/get)
请求方式:GET(HTTPS)
请求地址:https://oapi.szns.edu.cn/user/class/get?access_token=ACCESS_TOKEN&student_userid=USERID&teacher_userid=USERID
参数说明:
参数 | 必须 | 说明 |
---|---|---|
access_token | 是 | 调用接口凭证 |
student_userid | 是 | 家校通讯录的userid,学生的userid。不区分大小写,长度为1~64个字节 |
teacher_userid | 是 | 家校通讯录的userid,教师的userid。不区分大小写,长度为1~64个 |
返回结果:
{
"errcode": 0,
"errmsg": "ok",
"departments":[
{
"id": 123,
"subject": "语文班"
},
{
"id": 124,
"subject": "一班"
}
]
}
参数说明:
参数 | 说明 |
---|---|
errcode | 返回码 |
errmsg | 对返回码的文本描述内容 |
departments | 有权限的班级列表 |
departments.id | 班级ID |
departments.subject | 班级名 |
获取用户部门信息
(user/department/get)
请求方式:POST(HTTPS)
请求地址:https://oapi.szns.edu.cn/user/department/get?access_token=ACCESS_TOKEN
参数说明:
参数 | 必须 | 说明 |
---|---|---|
access_token | 是 | 调用接口凭证 |
请求体参数:
参数 | 必须 | 说明 |
---|---|---|
orgUserIds | 是 | 用户 orgUserIds 列表 |
departmentType | 是 | 架构类型 全部:0,学生:1,教职工:2,校友:4,退休教师:5,临时组:6,虚拟组:7,课程班:8,上级单位:9,教学班(高校):10 |
请求体:
{
"orgUserIds":[
"111",
"222"
],
"departmentType":7
}
返回结果:
{
"errcode": 0,
"errmsg": "ok",
"users": {
"123": {
"departments": [
{
"departmentId": 7,
"departmentName": "xxx组",
"level": 2,
"parentId": 1,
"fullPath": "/xxxx学校/xxx组",
"typeId": 7
},
{
"departmentId": 8,
"departmentName": "xxx系",
"level": 5,
"parentId": 3,
"fullPath": "/xxx学校/xx组/xx部/xx系",
"typeId": 7
}
]
}
}
}
参数说明:
参数 | 类型 | 说明 |
---|---|---|
data | map[string]DepartmentByUsersList | Key:OrgUserId; Value:用户组织架构信息 |
DepartmentByUsersList
参数 | 类型 | 描述 |
---|---|---|
departments | []DepartmentUsers | 用户的部门列表 |
DepartmentUsers
参数 | 类型 | 描述 |
---|---|---|
departmentId | Int | 架构id |
departmentName | string | 架构名称 |
level | int | 架构层级 |
parentId | int | 父级Id |
fullPath | string | 所属架构全路径 |
typeId | int | 架构类型 全部:0,学生:1,教职工:2,校友:4,退休教师:5,临时组:6,虚拟组:7,课程班:8,上级单位:9,教学班(高校):10 |