Skip to content

数据同步

通用说明

平台支持定制化的数据同步接口,可以按需定制字段并提供全量同步和增量同步的调用支持。

部分常用数据的同步接口已经标准化,参考下文的通用同步接口说明,并申请对应接口即可。

如业务有额外的数据同步需求,请与我们联系。

对于定制接口,以下示例仅供参考,实际接口调用文档已最终交付版本为准。

支持的模式

  • client_credentials

请求方法

GET

请求地址

https://api.ecnu.edu.cn/api/v1/xxxxxxxxx

通用请求参数

参数名是否必填备注
ts增量时间戳,单位是秒,返回该时间戳之后产生变更的数据。输入 ts=0 即返回全量数据
full默认仅返回有效数据(有效的含义根据实际业务决定),如果 full 参数有值(无论是什么),都会返回全部数据,包括已经被删除的数据
pageSize单页大小,最大10000
pageNum第几页,从第一页开始

通用返回参数

字段名说明备注
totalNum数据总量
pageSize单页大小
pageNum第几页
rows数据列表数据在 rows 内
rows.created_at创建时间
rows.updated_at更新时间当数据任意字段内容更新时,updated_at 会自动更新时间,因此可用于增量同步
rows.deleted_mark删除时间如果上游系统删除了某条数据,则会产生对应的标记,同步数据时可以根据这些标记做对应的增量处理,1删除0未删除
rows.xxxxxxx业务字段业务字段

全量同步示例

curl -i -H "Authorization: Bearer e447e4b4b8e23973b42c44b8d5415603" "https://api.ecnu.edu.cn/api/v1/customized/xxxxxxxxx?pageSize=2&pageNum=1&ts=0"

返回示例

json
{
	"data": {
		"totalNum": 18839,
		"pageSize": 2,
		"rows": [{
			"deleted_mark":0,
			"created_at": "2021-12-22 20:05:15",
			"xxxx":"xxxx",
			"updated_at": "2023-05-09 02:15:35"
		},{
			"deleted_mark":0,
			"xxxx":"xxxx",
			"created_at": "2021-12-22 20:05:15",
			"updated_at": "2023-05-09 02:15:35",
		}],
	},
	"requestId": "6a0f0ef016232902185634755e05d2",
	"errCode": 0,
	"errMsg": "success",
	"apiLog": null
}

增加量同步示例

curl -i -H "Authorization: Bearer e447e4b4b8e23973b42c44b8d5415603" "https://api.ecnu.edu.cn/api/v1/customized/xxxxxxxxx?pageSize=10&pageNum=1&ts=1623161010"

即返回 updated_at2021-06-08 22:03:30 之后的数据

返回示例

json
{
	"data": {
		"totalNum": 1,
		"pageSize": 10,
		"rows": [{
			"deleted_mark":1,
			"created_at": "2021-12-22 20:05:15",
			"xxxx":"xxxx",
			"updated_at": "2023-05-09 02:15:35"
		}],
	},
	"requestId": "6a0f0ef016232902185634755e05d2",
	"errCode": 0,
	"errMsg": "success",
	"apiLog": null
}

通用人员信息同步

请求地址

https://api.ecnu.edu.cn/api/v1/sync/userinfo

请求参数

参数名是否必填备注
ts增量时间戳,单位是秒,返回该时间戳之后产生变更的数据。输入 ts=0 即返回全量数据
full默认仅返回在校且未标记删除的数据,如果 full 参数有值(无论是什么),都会返回全部数据
pageSize单页大小,最大10000
pageNum第几页,从第一页开始

返回参数

参数名类型备注
created_atstring数据创建的时间
updated_atstring数据更新的时间
deleted_markint是否已删除的标记,0未删,1已删除
userIdstring学工号
namestring姓名
departmentIdstring部门编号
departmentstring部门名称
activestring是否在校,1在校,0离校
userTypestring用户类型,本科生、研究生、教职工、丽娃人员、临时人员、博士后

返回示例

json
{
	"data": {
		"totalNum": 58838,
		"pageSize": 2,
		"rows": [{
			"created_at": "2021-12-22 20:05:14",
			"updated_at": "2023-05-09 02:15:33",
			"deleted_mark": 0,
			"userId": "******",
			"name": "**",
			"departmentId": "011004",
			"department": "运动训练系",
			"active": "1",
			"userType": "本科生"
		}, {
			"created_at": "2021-12-22 20:05:14",
			"updated_at": "2023-05-09 02:15:33",
			"deleted_mark": 0,
			"userId": "******",
			"name": "**",
			"departmentId": "0155",
			"department": "数学科学学院",
			"active": "1",
			"userType": "本科生"
		}],
		"pageNum": 1
	},
	"errCode": 0,
	"requestId": "955371B1-9685-43DE-8328-94D02DB59015",
	"errMsg": "success"
}

通用人事信息同步

说明

获取人事信息(含临时人员),提供全量同步和增量同步的调用支持。

以下示例仅供参考,实际接口调用文档已最终交付版本为准。

支持的模式

  • client_credentials

请求方法

GET

请求地址

https://api.ecnu.edu.cn/api/v1/sync/userinfo/rsuserinfo

请求参数

参数名是否必填备注
pageSize单页大小
pageNum第几页,从第一页开始
ts增量时间戳,返回该时间戳之后产生变更的数据。输入 ts=0 即返回全量数据
full默认仅返回在校且未标记删除的数据,如果 full 参数有值(无论是什么),都会返回全部数据

返回参数

参数名类型备注
created_atstring数据创建的时间
updated_atstring数据更新的时间
deleted_markstring是否已删除的标记,0未删,1已删除
useridstring学工号
namestring姓名
departmentIdstring部门编号
departmentstring部门名称
statusstring在校状态,字典详见 教职工在校状态。其中对于临时人员部分,在校部分取 on,离校部分取 quit
statusnamestring在职状态名称
xbmstring性别
userTypestring身份,教职工/临时人员

返回示例

json
{
	"data": {
		"totalNum": 11210,
		"pageSize": 2,
		"rows": [{
			"created_at": "2021-12-22 20:05:16",
			"updated_at": "2024-04-23 14:51:28",
			"deleted_mark": 0,
			"userId": "19****",
			"name": "刘****",
			"departmentId": "01***1",
			"department": "**系",
			"statusname": "离退休",
			"status": "retire",
			"xbm": "1",
			"userType": "教职工"
		}, {
			"created_at": "2021-12-22 20:05:16",
			"updated_at": "2024-04-23 14:51:28",
			"deleted_mark": 0,
			"userId": "19******",
			"name": "宋*",
			"departmentId": "0****",
			"department": "***系",
			"statusname": "离退休",
			"status": "retire",
			"xbm": "1",
			"userType": "教职工"
		}],
		"pageNum": 1
	},
	"errCode": 0,
	"requestId": "368D4F9B-153B-4B93-AC61-36F5F8ECEEF7",
	"errMsg": "success"
}

通用博士后信息同步

说明

获取博士后信息,提供全量同步和增量同步的调用支持。

以下示例仅供参考,实际接口调用文档已最终交付版本为准。

支持的模式

  • client_credentials

请求方法

GET

请求地址

https://api.ecnu.edu.cn/api/v1/sync/userinfo/bsh

请求参数

参数名是否必填备注
pageSize单页大小
pageNum第几页,从第一页开始
ts增量时间戳,返回该时间戳之后产生变更的数据。输入 ts=0 即返回全量数据
full默认仅返回在校且未标记删除的数据,如果 full 参数有值(无论是什么),都会返回全部数据

返回参数

参数名类型备注
created_atstring数据创建的时间
updated_atstring数据更新的时间
deleted_markstring是否已删除的标记,0未删,1已删除
useridstring学工号
namestring姓名
departmentIdstring部门编号
departmentstring部门名称
statusstring在校部分取 on,离校部分取 quit 。可与教职工部分保持兼容
statusnamestring在职状态名称
xbmstring性别
userTypestring身份,博士后

返回示例

json
{
    "data": {
        "totalNum": 400,
        "pageSize": 2,
        "rows": [
            {
                "created_at": "2021-12-22 20:05:21",
                "updated_at": "2022-08-18 02:30:59",
                "deleted_mark": 0,
                "userId": "20****",
                "name": "汪*",
                "departmentId": "0***",
                "department": "物理与电子科学学院",
                "statusname": "在职",
                "status": "on",
                "xbm": "2",
                "userType": "博士后"
            },
            {
                "created_at": "2021-12-22 20:05:21",
                "updated_at": "2023-04-27 02:15:49",
                "deleted_mark": 0,
                "userId": "20*****",
                "name": "钭*",
                "departmentId": "0****",
                "department": "地理科学学院",
                "statusname": "在职",
                "status": "on",
                "xbm": "2",
                "userType": "博士后"
            }
        ],
        "pageNum": 1
    },
    "errCode": 0,
    "requestId": "e0e0635ecebd612aee0c43866ab6d0b6",
    "errMsg": "success",
    "apiLog": null
}

通用学生信息同步

说明

获取学生信息,提供全量同步和增量同步的调用支持。

以下示例仅供参考,实际接口调用文档已最终交付版本为准。

支持的模式

  • client_credentials

请求方法

GET

请求地址

https://api.ecnu.edu.cn/api/v1/sync/userinfo/studentinfo

请求参数

参数名是否必填备注
pageSize单页大小
pageNum第几页,从第一页开始
type人员类型,如本科生/研究生
ts增量时间戳,返回该时间戳之后产生变更的数据。输入 ts=0 即返回全量数据
full默认仅返回在校且未标记删除的数据,如果 full 参数有值(无论是什么),都会返回全部数据

返回参数

参数名类型备注
created_atstring数据创建的时间
updated_atstring数据更新的时间
deleted_markint是否已删除的标记,0未删,1已删除
useridstring学工号
namestring姓名
departmentIdstring部门编号
departmentstring部门名称
activestring在校状态
userTypestring身份,教职工/临时人员

返回示例

json
{
	"data": {
		"totalNum": 11210,
		"pageSize": 2,
		"rows": [{
			"created_at": "2025-09-05 02:15:52",
			"updated_at": "2025-09-05 02:15:52",
			"deleted_mark": 0,
			"userId": "100****01",
			"name": "计**",
			"departmentId": "0***03",
			"department": "生***学院",
			"active": "0",
			"userType": "本科生"
			},
			{
			"created_at": "2025-09-05 02:15:52",
			"updated_at": "2025-09-05 02:15:52",
			"deleted_mark": 0,
			"userId": "1*****102",
			"name": "宗**",
			"departmentId": "01***3",
			"department": "生****学学院",
			"active": "0",
			"userType": "本科生"
			}],
		"pageNum": 1
	},
	"errCode": 0,
	"requestId": "368D4F9B-153B-4B93-AC61-36F5F8ECEEF7",
	"errMsg": "success"
}

通用本科生信息同步

说明

获取本科信息,提供全量同步和增量同步的调用支持。

以下示例仅供参考,实际接口调用文档已最终交付版本为准。

支持的模式

  • client_credentials

请求方法

GET

请求地址

https://api.ecnu.edu.cn/api/v1/sync/userinfo/studentinfo_bk

请求参数

参数名是否必填备注
pageSize单页大小
pageNum第几页,从第一页开始
ts增量时间戳,返回该时间戳之后产生变更的数据。输入 ts=0 即返回全量数据
full默认仅返回在校且未标记删除的数据,如果 full 参数有值(无论是什么),都会返回全部数据

返回参数

参数名类型备注
created_atstring数据创建的时间
updated_atstring数据更新的时间
deleted_markint是否已删除的标记,0未删,1已删除
xhstring学号
xmstring姓名
glyxmstring管理院系码
glyxstring管理院系
stystring实体院系
stymstring实体院系代码
zyyxstring专业院系
zyyxmstring专业院系代码
zyhstring专业代码
zystring专业名称
njstring年级
xlccstring学历层次
xxxsstring学习形式
sfzxstring是否在校
lxrqstring离校日期

返回示例

json
{
	"data": {
		"totalNum": 11210,
		"pageSize": 2,
		"rows": [            {
                "xh": "10****00301",
                "xm": "高**",
                "glyxm": "0***03",
                "glyx": "**系",
                "sty": "**系",
                "stym": "0***03",
                "zyyx": "**系",
                "zyyxm": "0***03",
                "zyh": "0160",
                "zy": "*学",
                "nj": "2022",
                "xlcc": "本科",
                "xxxs": "普通全日制",
                "sfzx": "1",
                "lxrq": "2026-07-01",
                "deleted_mark": 0,
                "updated_at": "2025-09-24 14:03:39",
                "created_at": "2021-10-27 16:47:40"
            },
            {
                "xh": "101****409",
                "xm": "李**",
                "glyxm": "0**01",
                "glyx": "中国***学系",
                "sty": "中国***学系",
                "stym": "0**01",
                "zyyx": "中国***学系",
                "zyyxm": "0**01",
                "zyh": "01**",
                "zy": "****学",
                "nj": "2022",
                "xlcc": "本科",
                "xxxs": "普通**制",
                "sfzx": "1",
                "lxrq": "2026-07-01",
                "deleted_mark": 0,
                "updated_at": "2025-09-24 14:03:40",
                "created_at": "2021-10-27 16:47:40"
            }],
		"pageNum": 1
	},
	"errCode": 0,
	"requestId": "368D4F9B-153B-4B93-AC61-36F5F8ECEEF7",
	"errMsg": "success"
}