GET https://lxapi.lexiangla.com/cgi-bin/v1/roadmaps
支持分页参数和排序:(通用说明?)
支持时间范围过滤
参数 | 是否必须 | 默认值 | 说明 |
---|---|---|---|
sort | 否 | created_at | 排序参数,支持按学习地图的created_at排序 |
team_id | 否 | 无 | K吧id |
$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->get('roadmaps');
document
{
"data": [
{
"type": "roadmap",
"id": "5964",
"attributes": {
"title": "培训班",
"checkpoint_count": 1,
"content": "<p>111</p>",
"created_at": "2024-05-30 19:24:12",
"cover": "",
"subject_type": "training",
"status": 1,
"to_staff_count": 0,
"passed_staff_count": 0
},
"links": {
"platform": "https://km.lexiangla.com/learning/5964/list"
},
"relationships": {
"category": {
"data": {
"type": "category",
"id": "86579fb0830211eb8e4ed62729524115"
}
}
}
},
{
"type": "roadmap",
"id": "5963",
"attributes": {
"title": "学习地图",
"checkpoint_count": 1,
"content": "<p>111</p>",
"created_at": "2024-05-30 17:09:56",
"cover": "",
"subject_type": "learning",
"status": 1,
"to_staff_count": 33190,
"passed_staff_count": 0
},
"links": {
"platform": "https://km.lexiangla.com/learning/5963/list"
},
"relationships": {
"category": {
"data": {
"type": "category",
"id": "30d984a486d111ebbaf14a7697629675"
}
}
}
}
],
"links": {
"first": "https://lxapi.lexiangla.com/cgi-bin/v1/roadmaps?per_page=2&page=1",
"last": "https://lxapi.lexiangla.com/cgi-bin/v1/roadmaps?per_page=2&page=1975",
"prev": null,
"next": "https://lxapi.lexiangla.com/cgi-bin/v1/roadmaps?per_page=2&page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1975,
"path": "https://lxapi.lexiangla.com/cgi-bin/v1/roadmaps",
"per_page": 2,
"to": 2,
"total": 3950
},
"included": [
{
"type": "category",
"id": "86579fb0830211eb8e4ed62729524115",
"attributes": {
"name": "分类1",
"weight": 0
}
},
{
"type": "category",
"id": "30d984a486d111ebbaf14a7697629675",
"attributes": {
"name": "分类2",
"weight": -600
}
}
]
}
参数 | 说明 |
---|---|
data.attributes.title | 项目主题 |
data.attributes.checkpoint_count | 任务数 |
data.attributes.content | 介绍详情 |
data.attributes.cover | 封面链接 |
data.attributes.subject_type | 类型:learning(学习地图),training(培训班) |
data.attributes.to_staff_count | 应完成人数 |
data.attributes.passed_staff_count | 已完成人数 |
data.attributes.created_at | 创建时间 |
data.attributes.status | 项目状态;1:进行中,2:已结项 |
data.links | 项目链接 |
data.relationships.category | 关联的项目分类实体id |
GET https://lxapi.lexiangla.com/cgi-bin/v1/roadmaps/{roadmap_id}
参数 | 是否必须 | 默认值 | 说明 |
---|---|---|---|
roadmap_id | 是 | 无 | 项目id |
document
{
"data": {
"type": "roadmap",
"id": "2892",
"attributes": {
"title": "项目",
"checkpoint_count": 2,
"content": "",
"created_at": "2022-08-18 09:44:27",
"cover": "https://xxx.lexiangla.com/assets/41d599461e9711eda4f2befdeb73193e",
"subject_type": "learning",
"status": 1,
"point_plus": 1
},
"links": {
"platform": "https://km.lexiangla.com/learning/2892/list"
},
"relationships": {
"credit_rule": {
"data": {
"type": "credit_rule",
"id": 139066293
}
},
"category": {
"data": {
"type": "category",
"id": "30d984a486d111ebbaf14a7697629675"
}
},
"owner": {
"data": {
"type": "staff",
"id": "zhangsan"
}
},
"managers": {
"data": [
{
"type": "staff",
"id": "lisi"
}
]
},
"certificates": {
"data": [
{
"type": "certificate",
"id": 387
}
]
}
}
},
"included": [
{
"type": "credit_rule",
"id": 139066293,
"attributes": {
"rule_name": "roadmap_finish",
"credit": 100
}
},
{
"type": "category",
"id": "30d984a486d111ebbaf14a7697629675",
"attributes": {
"name": "分类",
"weight": -1
}
},
{
"type": "staff",
"id": "zhangsan",
"attributes": {
"name": "zhangsan",
"english_name": null
}
},
{
"type": "staff",
"id": "jessie",
"attributes": {
"name": "lisi",
"english_name": null,
"organization": "1 "
}
},
{
"type": "certificate",
"id": 387,
"attributes": {
"title": "新证书",
"code_fixed": "gg",
"code_weight": 5,
"total_num": 3,
"period": 0,
"created_at": "2022-08-08 10:09:42",
"updated_at": "2022-08-15 10:04:22",
"preview": "https://xxx.lexiangla.com/assets/90fac7e01c3e11ed9658a21b4ed08376",
"valid_num": "3"
}
}
]
}
参数 | 说明 |
---|---|
data.attributes.title | 项目主题 |
data.attributes.checkpoint_count | 任务数 |
data.attributes.content | 项目介绍 |
data.attributes.created_at | 创建时间 |
data.attributes.cover | 封面链接 |
data.attributes.subject_type | 类型:learning(学习地图),training(培训班) |
data.attributes.status | 项目状态:0:草稿,1:进行中,2:已结项 |
data.links | 项目链接 |
data.attributes.point_plus | 额外积分 |
data.relationships.owner | 创建人 |
data.relationships.category | 项目分类 |
data.relationships.managers | 项目负责人 |
data.relationships.certificates | 项目证书,如果创建/编辑页关闭证书开关,则不返回 |
data.relationships.credit_rule | 项目学分,如果创建/编辑页关闭学分开关,则不返回 |
data.included.credit_rule.attributes.credit | 学分奖励的100倍数,需除以100后得到完成项目可获的学分奖励 |
GET https://lxapi.lexiangla.com/cgi-bin/v1/roadmaps/{roadmap_id}/checkpoints
参数 | 是否必须 | 默认值 | 说明 |
---|---|---|---|
roadmap_id | 是 | 无 | 项目id |
document
{
"data": [
{
"type": "checkpoint",
"id": 22952,
"attributes": {
"title": "项目课程",
"sequence": 1,
"is_from_assistant": 0
},
"relationships": {
"target": {
"data": {
"type": "clazz",
"id": "f5ee2b5af87a11ee9cb0fa108558f26f"
}
}
}
},
{
"type": "checkpoint",
"id": 22953,
"attributes": {
"title": "项目考试",
"sequence": 2,
"is_from_assistant": 0
},
"relationships": {
"target": {
"data": {
"type": "exam",
"id": "084b2d8ef87b11ee8c66fa108558f26f"
}
}
}
},
{
"type": "checkpoint",
"id": 22954,
"attributes": {
"title": "项目作业",
"sequence": 3,
"is_from_assistant": 0
},
"relationships": {
"target": {
"data": {
"type": "assignment",
"id": "212b9e1af87b11eeb413fa108558f26f"
}
}
}
},
{
"type": "checkpoint",
"id": 22955,
"attributes": {
"title": "项目问卷",
"sequence": 4,
"is_from_assistant": 0
},
"relationships": {
"target": {
"data": {
"type": "survey",
"id": "39065f02f87b11ee9b32fa108558f26f"
}
}
}
},
{
"type": "checkpoint",
"id": 22956,
"attributes": {
"title": "项目链接任务",
"sequence": 5,
"is_from_assistant": 0
},
"relationships": {
"target": {
"data": {
"type": "hyper_link",
"id": "4a266a7af87b11ee847dfa108558f26f"
}
}
}
}
],
"included": [
{
"type": "clazz",
"id": "f5ee2b5af87a11ee9cb0fa108558f26f",
"attributes": {
"type": 1,
"course_count": 1,
"title": "项目课程",
"description": "<p>课程</p>",
"cover_img": "",
"is_required": 0,
"privilege_type": 1,
"comment_count": 0,
"created_at": "2024-04-12 11:15:49",
"updated_at": "2024-04-12 11:15:49",
"recommended_at": null,
"participants_count": 0,
"app_source_type": "roadmap"
},
"links": {
"platform": "https://km.lexiangla.com/classes/f5ee2b5af87a11ee9cb0fa108558f26f?type=1",
"manager": "https://km.lexiangla.com/classes/f5ee2b5af87a11ee9cb0fa108558f26f/settings?map=5622&type=1"
}
},
{
"type": "exam",
"id": "084b2d8ef87b11ee8c66fa108558f26f",
"attributes": {
"title": "项目考试",
"content": "",
"staff_count": 38,
"privilege_type": 1,
"pass_score": null,
"duration": null,
"finished_privilege": 2,
"ended_privilege": 3,
"exam_times_limit": 1,
"limit_switch_count": 0,
"enable_face_recognition": 0,
"is_shuffled": 0,
"started_at": "2024-04-12 11:16:19",
"ended_at": "2034-04-12 11:16:19",
"tips_when_start": 0,
"tips_before_start": 0,
"tips_before_end": 0,
"created_at": "2024-04-12 11:16:19",
"updated_at": "2024-04-12 11:18:45",
"status": "running",
"staffs_count": 38,
"app_source_type": "roadmap"
},
"links": {
"platform": "https://km.lexiangla.com/exams/084b2d8ef87b11ee8c66fa108558f26f"
}
},
{
"type": "assignment",
"id": "212b9e1af87b11eeb413fa108558f26f",
"attributes": {
"title": "项目作业",
"content": "",
"summary": "",
"finished_type": 0,
"evaluation_method": 1,
"enable_required_comment": 0,
"total_score": 100,
"passing_score": 60
}
},
{
"type": "survey",
"id": "39065f02f87b11ee9b32fa108558f26f",
"attributes": {
"title": "项目问卷",
"summary": "",
"ended_at": null,
"privilege_type": 1,
"read_count": 0,
"comment_count": 0,
"participant_count": 0,
"type": "election",
"created_at": "2024-04-12 11:17:41"
},
"links": {
"platform": "https://km.lexiangla.com/surveys/39065f02f87b11ee9b32fa108558f26f"
}
},
{
"type": "hyper_link",
"id": "4a266a7af87b11ee847dfa108558f26f",
"attributes": {
"title": "项目链接任务",
"link": "https://lexiangla.com"
}
}
]
}
参数 | 说明 |
---|---|
type | 类型为关卡 |
data.attributes.title | 关卡名称 |
data.attributes.sequence | 项目关卡顺序 |
data.attributes.is_from_assistant | 是否来自带教布置的任务,0:否,项目自身的关卡;1:是 |
data.relationships | 关联项目关卡的实体对象,包含课程,考试,活动,投票(问卷),作业,链接。 |
GET https://lxapi.lexiangla.com/cgi-bin/v1/staffs/{staff_id}/roadmaps
参数 | 是否必须 | 默认值 | 说明 |
---|---|---|---|
staff_id | 是 | 无 | 员工帐号 |
status | 否 | 无 | 学习记录的状态 0:未开始,1:通关中,2:已通关,3:通关失败 |
$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->get('staffs/ThreeZhang/roadmaps');
document
{
"data": [
{
"type": "roadmap",
"id": "9",
"attributes": {
"title": "学习地图-经典列表",
"status": 0,
"started_at": null,
"ended_at": null
},
"links": {
"platform": "https://km.lexiangla.com/learning/9/list"
},
"relationships": {
"category": {
"data": {
"type": "category",
"id": "74787a20823b11eb8461668bec216377"
}
}
}
},
{
"type": "roadmap",
"id": "11",
"attributes": {
"title": "学习地图-游戏地图",
"status": 0,
"started_at": null,
"ended_at": null
},
"links": {
"platform": "https://km.lexiangla.com/learning/11/game"
},
"relationships": {
"category": {
"data": {
"type": "category",
"id": "74787a20823b11eb8461668bec216377"
}
}
}
},
{
"type": "roadmap",
"id": "6014",
"attributes": {
"title": "培训班-list-学习",
"status": 1,
"started_at": "2024-06-03 14:45:20",
"ended_at": null
},
"links": {
"platform": "https://km.lexiangla.com/learning/6014/list"
},
"relationships": {
"category": {
"data": {
"type": "category",
"id": "74787a20823b11eb8461668bec216377"
}
}
}
}
],
"included": [
{
"type": "category",
"id": "74787a20823b11eb8461668bec216377",
"attributes": {
"name": "其他",
"weight": 0
}
}
]
}
参数 | 说明 |
---|---|
data.type | 资源对象类型,必须为roadmap,表示项目 |
data.id | 学习地图的id |
data.attributes.title | 学习地图的主题 |
data.attributes.started_at | 学习的开始时间 |
data.attributes.ended_at | 学习的结束时间 |
data.attributes.status | 学习记录的状态。0:未开始,1:通关中,2:已通关,3:通关失败 |
data.links | 项目链接 |
data.relationships.category | 分类 |
GET https://lxapi.lexiangla.com/cgi-bin/v1/staffs/{staff_id}/roadmaps/{roadmap_id}
参数 | 是否必须 | 默认值 | 说明 |
---|---|---|---|
staff_id | 是 | 无 | 员工帐号 |
roadmap_id | 是 | 无 | 项目id |
document
{
"data": {
"type": "roadmap",
"id": "6380",
"attributes": {
"title": "项目1",
"checkpoint_count": 9,
"content": "<p>项目介绍</p>",
"created_at": "2024-07-22 18:20:32",
"cover": "",
"subject_type": "learning",
"status": 1,
"total_duration": 430,
"left_duration": 430,
"ended_at": "2024-07-28 18:20:00"
},
"links": {
"platform": "https://km.lexiangla.com/learning/6380/list"
},
"relationships": {
"checkpoints": {
"data": [
{
"type": "checkpoint",
"id": 24942
},
{
"type": "checkpoint",
"id": 24943
},
{
"type": "checkpoint",
"id": 24944
},
{
"type": "checkpoint",
"id": 24945
},
{
"type": "checkpoint",
"id": 24946
},
{
"type": "checkpoint",
"id": 24947
},
{
"type": "checkpoint",
"id": 24948
},
{
"type": "checkpoint",
"id": 24949
},
{
"type": "checkpoint",
"id": 24950
}
]
}
}
},
"included": [
{
"type": "checkpoint",
"id": 24942,
"attributes": {
"title": "课堂",
"sequence": 1,
"is_from_assistant": 0,
"status": 0,
"duration": 150
}
},
{
"type": "checkpoint",
"id": 24943,
"attributes": {
"title": "商城课堂",
"sequence": 2,
"is_from_assistant": 0,
"status": 0,
"duration": 130
}
},
{
"type": "checkpoint",
"id": 24944,
"attributes": {
"title": "作业",
"sequence": 3,
"is_from_assistant": 0,
"status": 0
}
},
{
"type": "checkpoint",
"id": 24945,
"attributes": {
"title": "链接",
"sequence": 4,
"is_from_assistant": 0,
"status": 0
}
},
{
"type": "checkpoint",
"id": 24946,
"attributes": {
"title": "课程2",
"sequence": 5,
"is_from_assistant": 0,
"status": 0,
"duration": 150
}
},
{
"type": "checkpoint",
"id": 24947,
"attributes": {
"title": "考试",
"sequence": 6,
"is_from_assistant": 0,
"status": 0
}
},
{
"type": "checkpoint",
"id": 24948,
"attributes": {
"title": "作业1",
"sequence": 7,
"is_from_assistant": 0,
"status": 0
}
},
{
"type": "checkpoint",
"id": 24949,
"attributes": {
"title": "作业2",
"sequence": 8,
"is_from_assistant": 0,
"status": 0
}
},
{
"type": "checkpoint",
"id": 24950,
"attributes": {
"title": "问卷",
"sequence": 9,
"is_from_assistant": 0,
"status": 0
}
}
]
}
参数 | 说明 |
---|---|
data.attributes.title | 项目主题 |
data.attributes.checkpoint_count | 关卡数量 |
data.attributes.content | 项目介绍 |
data.attributes.created_at | 创建时间 |
data.attributes.cover | 封面 |
data.attributes.subject_type | 类型:learning(学习地图),training(培训班 |
data.attributes.status | 项目状态;1:进行中,2:已结项 |
data.attributes.total_duration | 课程关卡完成条件时间总和(单位:s) |
data.attributes.left_duration | 剩余完成课程关卡所需时间总和(单位:s) |
data.attributes.ended_at | 项目结束时间 |
data.links | 项目链接 |
data.relationships.checkpoint | 关联的关卡信息 |
data.included[*].attributes.title | 关卡名称 |
data.included[*].attributes.sequence | 项目关卡顺序 |
data.included[*].attributes.is_from_assistant | 是否来自带教布置的任务,0:否,项目自身的关卡;1:是 |
data.included[*].attributes.status | 关卡状态;0:未开始 3:通关中 4:已通关 5:通关失败 |
data.included[*].attributes.duration | 课程关卡完成所需时间 |