# 本科教学类APIs

本组API用于获取本科教学类相关信息,不包含研究生数据

  • 使用本组API前请先阅读概述,令牌的获取参考此处,构造请求请参考此处,返回数据请参考此处,除非特殊注明,所有数据资源API有着通用的返回结构
  • 本科教学类基于GraphQL协议老版本接口说明请参考此处

# 申请

申请本科教学类API接口,请通过数据资源申请 (opens new window)完成申请。

# 学生基本信息

# 请求参数

参数名 类型 必填 参数说明
accountNo string jAccount账号
xh string 学号
glyx string 管理院系代码
lxbj string 离校标记(N:未离校 Y:离校)
timestamp string 更新时间(yyyy-MM-dd/yyyy-MM-dd HH:mm:ss),取大于等于该时间戳的数据
first int 分页起始位置 分页参数说明
offset int 分页偏移量

# 响应参数

所有数据资源API响应参数都有相同的通用结构

  • 学生信息 Structure
{
    "accountNo":{string}                                 //jAccount
    "xh":{string}                                        //学号
    "xm":{string}                                        //姓名
    "xbdm":{string}                                      //性别代码
    "xbmc":{string}                                      //性别名称
    "csrq":{string}                                      //出生日期
    "mzdm":{string}                                      //民族代码
    "mzmc":{string}                                      //民族名称
    "zzmmdm":{string}                                    //政治面貌代码
    "zzmmmc":{string}                                    //政治面貌名称
    "jg":{string}                                        //籍贯代码
    "jgmc":{string}                                      //籍贯名称
    "hyzkdm":{string}                                    //婚姻状况代码
    "hyzkmc":{string}                                    //婚姻状况名称
    "gbdm":{string}                                      //国别代码
    "gbmc":{string}                                      //国别名称
    "zjlb":{string}                                      //证件类别代码
    "zjlbmc":{string}                                    //证件类别名称
    "sfzhm":{string}                                     //证件号码
    "xldm":{string}                                      //学历代码
    "xlmc":{string}                                      //学历名称
    "sydqm":{string}                                     //生源地区代码
    "sydqmc":{string}                                    //生源地区名称
    "email":{string}                                     //邮箱
    "sj":{string}                                        //手机号码
    "pyfsdm":{string}                                    //培养方式代码
    "pyfsmc":{string}                                    //培养方式名称
    "glyx":{string}                                      //管理院系代码
    "glyxmc":{string}                                    //管理院系名称
    "bh":{string}                                        //班号
    "zydm":{string}                                      //专业代码
    "zymc":{string}                                      //专业名称
    "lxbj":{string}                                      //离校标记
    "lxbjmc":{string}                                    //离校标记名称
    "xqdm":{string}                                      //校区代码
    "xqmc":{string}                                      //校区名称
    "xslbdm":{string}                                    //学生类别代码(见下方代码表)
    "xslbmc":{string}                                    //学生类别名称(见下方代码表)
    "xslbmx":{string}                                    //学生类别明细代码
    "xslbmxmc":{string}                                  //学生类别明细名称
    "xjztdm":{string}                                    //学籍状态代码(见下方代码表)
    "xjztmc":{string}                                    //学籍状态名称(见下方代码表)
    "xz":{string}                                        //学制
    "xxfsdm":{string}                                    //学习方式代码
    "xxfsmc":{string}                                    //学习方式名称
    "sflxs":{string}                                     //是否留学生代码
    "sflxsmc":{string}                                   //是否留学生名称
    "rxnj":{string}                                      //入校时间
    "yjbysj":{string}                                    //预计毕业时间
    "sjbysj":{string}                                    //实际毕业时间
    "byxwdm":{string}                                    //毕业学位代码
    "byxwmc":{string}                                    //毕业学位名称
    "nj":{string}                                        //年级
    "isLkry":{string}                                    //是否理科荣誉计划学生(0:否 1:是)
    "isGkry":{string}                                    //是否工科荣誉计划学生(0:否 1:是)
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57

# 请求示例

GET /v1/stu/profile?access_token=token HTTP/1.1
Host: graphql.sjtu.edu.cn

xh=316203900000
1
2
3
4

# 响应示例


示例 成功返回的数据
HTTP/1.1 200 
Content-Type: application/json;charset=UTF-8

{
	"errno": 0,
	"error": null,
	"total": 1,
	"entities": [{
		"accountNo": null,
		"xh": "0000000000000",
		"xm": "李四",
		"xbdm": "1",
		"xbmc": "男性",
		"csrq": "1999-01-01 00:00:00",
		"mzdm": "01",
		"mzmc": "汉族",
		"zzmmdm": "03",
		"zzmmmc": "共青团员",
		"jg": "410000",
		"jgmc": "河南省",
		"hyzkdm": "0",
		"hyzkmc": "未婚",
		"gbdm": "CN",
		"gbmc": "中国",
		"zjlb": "01",
		"zjlbmc": "身份证",
		"sfzhm": "3xx1xx19990101xxxx",
		"xldm": "11",
		"xlmc": "硕士研究生",
		"sydqm": "410000",
		"sydqmc": "河南省",
		"email": null,
		"sj": "12800000000",
		"pyfsdm": "1",
		"pyfsmc": "非定向",
		"glyx": "45000",
		"glyxmc": "智慧能源创新学院",
		"bh": "B2145091",
		"zydm": "085800",
		"zymc": "能源动力",
		"lxbj": "N",
		"lxbjmc": "在校",
		"xqdm": "1",
		"xqmc": "闵行",
		"xslbdm": "211",
		"xslbmc": "硕士研究生(普通)",
		"xslbmx": null,
		"xslbmxmc": null,
		"xjztdm": "99",
		"xjztmc": "正常",
		"xz": "2.5",
		"xxfsdm": "4",
		"xxfsmc": "全日制",
		"sflxs": "0",
		"sflxsmc": "否",
		"rxnj": "2020-09-01",
		"yjbysj": "2024-03-31",
		"sjbysj": "2024-03-31",
		"byxwdm": "30858",
		"byxwmc": "能源动力硕士专业学位",
		"nj": "2018",
		"isLkry": "0",
		"isGkry": "1"
	}]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
  • 学生类别代码表 Data
Value Description 层级
100 本科生 1
110 本科生 2
111 本科生(中国国籍) 3
112 本科生(外国留学生) 3
120 联合培养 2
121 上海中医药大学本科生 3
122 宁夏大学本科生 3
123 新疆大学本科生 3
124 新疆医科大学本科生 3
125 香港大学本科生 3
130 交换生 2
131 外国交换生 3
132 中国交换生 3
133 夏季学期交换生 3
134 英才计划 3
140 暑期生 1
150 本科预科生 1
200 硕士研究生 1
210 硕士研究生(本校全日制) 2
211 硕士研究生(普通) 3
212 硕士研究生(定向、委托培养) 3
213 硕士研究生(本校职工在职攻读) 3
214 硕士研究生(留学生) 3
220 专业学位硕士研究生 2
221 专业学位硕士研究生 3
222 专业学位硕士研究生(全时方式) 3
223 专业学位硕士研究生(本校职工在职攻读) 3
224 硕士专业学位留学生 3
230 联合培养研究生 2
300 博士研究生 1
310 博士研究生(本校全日制) 2
311 博士研究生(普通) 3
312 博士研究生(定向、委托培养) 3
313 博士研究生(本校职工在职攻读) 3
314 博士研究生(留学生) 3
320 专业学位博士研究生 2
321 专业学位博士研究生 3
322 专业学位博士研究生(全时方式) 3
323 专业学位博士研究生(本校职工在职攻读) 3
324 博士专业学位留学生 3
700 留学生非学位生 1
990 跨校辅修、进修 1
991 上海西南片跨校辅修 2
992 旁听进修 2
993 总装中晋高 2
994 宁夏大学跨校辅修 2
995 西藏大学跨校辅修 2
996 军转干培训 2
998 学森计划 3
  • 学籍状态代码表 Data
Value Description
06 正常离校
11 毕业离校
12 结业离校
13 结业转毕业
14 延期转毕业
15 退学离校
16 外校交换生
17 未报到
18 保留入学资格
19 数据冻结
20 肄业离校
21 正常在校
22 复学在校
23 短期游学
24 长期游学
25 延期在校
31 其他休学
32 委培在校
41 跨校辅修
42 旁听进修
51 转学离校
52 提前毕业
54 委培离校
56 延期转结业
57 取消学籍

# 课程信息

课程相关API接口仅返回当前学年数据

# 请求参数

参数名 类型 必填 参数说明
rscGh string 任课老师工号
orgId string 开课学院代码
courseKcdm string 课程代码
courseSchoolyear string 学年 (例:2022-2023)
courseTerm string 学期
instructionalClassId string 课程号
timestamp string 更新时间(yyyy-MM-dd/yyyy-MM-dd HH:mm:ss),取大于等于该时间戳的数据
first int 分页起始位置
offset string 分页偏移量

# 响应参数

所有数据资源API响应参数都有相同的通用结构

  • 课程信息 Structure
{
    "courseId":{string}                                  //课程ID
    "courseKcdm":{string}                                //课程代码
    "courseName":{string}                                //课程名称
    "courseNameEn":{string}                              //课程英文名称
    "rscGh":{string}                                     //教职工工号
    "jwGh":{string}                                      //教务处工号
    "orgId":{string}                                     //开课学院代码
    "courseTypeName":{string}                            //课程类别
    "courseHours":{double}                               //学时
    "courseCredit":{double}                              //学分
    "courseSchoolyear":{string}                          //学年
    "courseTerm":{string}                                //学期
    "remark":{string}                                    //备注
    "grade":{string}                                     //年级
    "instructionalClassId":{string}                      //课程号
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

# 请求示例

GET /v1/course/info?access_token=token HTTP/1.1
Host: graphql.sjtu.edu.cn

instructionalClassId=(2022-2023-1)-CS2122-1&courseSchoolyear=2022-2023
1
2
3
4

# 响应示例


示例 成功返回的数据
HTTP/1.1 200 
Content-Type: application/json;charset=UTF-8

{
	"errno": 0,
	"error": null,
	"total": 1,
	"entities": [{
		"courseId": "DDCU1MB839CC942DESH3F8163EE1DCCC",
		"courseKcdm": "AD017",
		"courseName": "美术实践与欣赏",
		"courseNameEn": "Art Practice and Appreciation",
		"rscGh": "00000",
		"jwGh": "00000",
		"orgId": "43000",
		"courseTypeName": "理论",
		"courseHours": 32,
		"courseCredit": 2,
		"courseSchoolyear": "2022-2023",
		"courseTerm": "1",
		"remark": "备注信息",
		"grade": "2020",
		"instructionalClassId": "(2022-2023-1)-CS2122-1"
	}]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

# 排课信息

课程相关API接口仅返回当前学年数据

# 请求参数

参数名 类型 必填 参数说明
rscGh string 任课老师工号
courseSchoolyear string 学年 (例:2022-2023)
courseTerm string 学期
instructionalClassId string 课程号
timestamp string 更新时间(yyyy-MM-dd/yyyy-MM-dd HH:mm:ss),取大于等于该时间戳的数据
first int 分页起始位置
offset string 分页偏移量

# 响应参数

所有数据资源API响应参数都有相同的通用结构

  • 排课信息 Structure
{
    "courseId":{string}                                  //课程ID
    "courseWeekday":{string}                             //星期
    "courseWeekStart":{string}                           //课程起始周
    "courseWeekEnd":{string}                             //课程结束周
    "courseWeek":{string}                                //周次
    "courseWeekOrder":{string}                           //周序号
    "courseSection":{string}                             //节次
    "courseSectionOrder":{stirng}                        //课程节次序号
    "instructionalClassId":{string}                      //课程号
    "courseClassroom":{string}                           //教室
    "courseSchoolyear":{string}                          //学年
    "courseTerm":{string}                                //学期
    "rscGh":{string}                                     //教职工工号
    "jwGh":{string}                                      //教务处工号
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

# 请求示例

GET /v1/course/plan?access_token=token HTTP/1.1
Host: graphql.sjtu.edu.cn

instructionalClassId=(2022-2023-1)-CS2522-1&courseSchoolyear=2022-2023
1
2
3
4

# 响应示例


示例 成功返回的数据
HTTP/1.1 200 
Content-Type: application/json;charset=UTF-8

{
	"errno": 0,
	"error": null,
	"total": 1,
	"entities": [{
		"courseId": "DDC0ADB839CC942DE055F8163EE1DCCC",
		"courseWeekday": "4",
		"courseWeekStart": "1",
		"courseWeekEnd": "8",
		"courseWeek": "1",
		"courseWeekOrder": null,
		"courseSection": "1",
		"courseSectionOrder": "0",
		"instructionalClassId": "(2022-2023-1)-CS2522-1",
		"courseClassroom": "东中院2-203",
		"courseSchoolyear": "2022-2023",
		"courseTerm": "1",
		"rscGh": "08337",
		"jwGh": "08337"
	}]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

# 选课信息

课程相关API接口仅返回当前学年数据

# 请求参数

参数名 类型 必填 参数说明
xh string 学号
courseId string 课程ID
courseSchoolyear string 学年 (例:2022-2023)
courseTerm string 学期
timestamp string 更新时间(yyyy-MM-dd/yyyy-MM-dd HH:mm:ss),取大于等于该时间戳的数据
first int 分页起始位置
offset string 分页偏移量

# 响应参数

所有数据资源API响应参数都有相同的通用结构

  • 选课信息 Structure
{
    "xh":{string}                                        //学号
    "courseId":{string}                                  //课程ID 
    "courseSchoolyear":{string}                          //学年
    "courseTerm":{string}                                //学期

}
1
2
3
4
5
6
7

# 请求示例

GET /v1/account/selection?access_token=token HTTP/1.1
Host: graphql.sjtu.edu.cn

xh=020721910253
1
2
3
4

# 响应示例


示例 成功返回的数据
HTTP/1.1 200 
Content-Type: application/json;charset=UTF-8

{
	"errno": 0,
	"error": null,
	"total": 1,
	"entities": [{
		"xh": "020722910296",
		"courseId": "202209-08200-BME8302-1654530911012",
		"courseSchoolyear": "2022-2023",
		"courseTerm": "1 "
	}]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14