POST https://lxapi.lexiangla.com/cgi-bin/v1/classes
document
{
"data": {
"type": "clazz",
"attributes": {
"type": 1,
"title": "创建课程",
"description": "课程描述",
"cover_img": "https://image-pub.lexiang-asset.com/common/assets/course/wexcouxx.png",
"allow_comment": 1,
"is_reminded": 1,
"start_reminded_at": "2020-02-22",
"end_reminded_at": "2020-02-29",
"interval": 3,
"optional_privilege_type": 1,
"required_privilege_type": 1,
"is_chapter_hidden": 0
},
"relationships": {
"category": {
"data": {
"type": "category",
"id": "0121d1cc63e211edb9ffb2cce8fb1aca"
}
},
"team": {
"data": {
"type": "team",
"id": "5db134a6223f11efb0665a4ac553875b"
}
},
"privilege": {
"data": [{
"type": "staff",
"id": "mistcheng"
},
{
"type": "department",
"id": "1"
}
]
},
"optional_privilege": {
"data": [{
"type": "staff",
"id": "mistcheng"
},
{
"type": "department",
"id": "1"
}
]
},
"required_privilege": {
"data": [{
"type": "staff",
"id": "sandxu"
},
{
"type": "department",
"id": "2"
},
{
"type": "contact_tag",
"id": "25d992dc203811ec8262f23f2082154b"
}
]
},
"chapters": {
"data": [{
"name": "第一章",
"course_ids": [
"69f046e2165711efa100eea3801533d8"
]
},
{
"name": "第二章",
"course_ids": [
"fc96e85e425111ef9585be15917fa40c"
]
}
]
}
}
}
}
参数 | 是否必须 | 默认值 | 说明 |
---|---|---|---|
data.attributes.type | 是 | 无 | 课程类型 1: 章节课程。 |
data.attributes.title | 是 | 无 | 开课主题。 |
data.attributes.description | 否 | "" | 课程介绍。章节课程可指定。 |
data.attributes.cover_img | 否 | "" | 课程封面。 |
data.attributes.allow_comment | 否 | 1 | 是否允许评论:0表示不允许评论,1表示允许评论 |
data.attributes.is_reminded | 否 | 0 | 催办方式:是否催办。 |
data.attributes.start_reminded_at | 否 | 无 | 催办开始时间。 |
data.attributes.end_reminded_at | 否 | 无 | 催办结束时间。 |
data.attributes.interval | 否 | 无 | 催办重复频率。 |
data.attributes.is_chapter_hidden | 否 | 无 | 是否为无章节课程。0:有章节课程 1:无章节课程 |
data.attributes.required_privilege_type | 否 | 2 | 必修学员范围。0:所有人; 1:部分人(在required_privilege 关系中指定)2.无; 注意:请与optional_privilege_type同时传参。 |
data.attributes.optional_privilege_type | 否 | 0 | 选修学员范围。0:所有人; 1:部分人(在optional_privilege 关系中指定)2.无; 注意:请与required_privilege_type同时传参。 |
data.relationships.team | 否 | 无 | 课程关联的k吧信息 |
data.relationships.category | 否 | 无 | 课程分类。 |
data.relationships.required_privilege | 否,当required_privilege_type=1时,必填 | 无 | 必修学员范围关联的组织架构 |
data.relationships.optional_privilege | 否,,当optionalprivilege_type=1时,必填 | 无 | 选修学员范围关联的组织架构 |
data.relationships.chapters.data.name | 否 | 无 | 章节名称 |
data.relationships.chapters.data.course_ids | 否 | 无 | 素材id,章节关联的素材资源,一个章节可以关联多个素材 |
$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$attributes = [
'type' => 1,
'title' => '开课主题',
];
$options = [
'description' => '课程描述',
'cover_img' => 'https://image-pub.lexiang-asset.com/common/assets/course/wecourse.png',
'is_required' => true,
'is_reminded' => true,
'start_reminded_at' => '2020-02-22',
'end_reminded_at' => '2020-02-29',
'interval' => 3,
'optional_privilege_type'=>1,
'required_privilege_type'=> 1,
'course_id' => '079a9bc64b4c11eab91e0a58ac130b26',
// 'chapters' => [
// [
// 'name' => '前言',
// 'course_ids' => [
// '07e293184b4c11ea86e00a58ac130b26',
// ],
// ],
// ],
'category_id' => '3c945edcdda311e9baa352540013ef60',
'optional_privilege' => [
[
'type' => 'staff',
'id' => 'zhangsan',
],
[
'type' => 'department',
'id' => '1',
]
],
'required_privilege' => [
[
'type' => 'staff',
'id' => 'zhangsan',
],
[
'type' => 'department',
'id' => '1',
]
],
];
// 创建课程
$response = $Lxapi->postClazz(StaffID, $attributes, $options);
document
{
"data": {
"type": "clazz",
"id": "fa8798626ea011efa029965ae34adc7e",
"attributes": {
"title": "创建课程",
"description": "<p>课程描述</p>",
"cover_img": "https://image-pub.lexiang-asset.com/common/assets/course/wecouxx.png",
"optional_privilege_type": 1,
"required_privilege_type": 1,
"is_chapter_hidden": 0,
"type": 1,
"is_shelved": 1,
"privilege_type": 1,
"created_at": "2024-09-09 19:45:14",
"updated_at": "2024-09-09 19:45:14",
"course_count": 2,
"app_source_type": "clazz"
},
"links": {
"platform": "https://km.lexiangla.com/classes/fa8798626ea011efa029965ae34adc7e?type=1",
"manager": "https://km.lexiangla.com/classes/fa8798626ea011efa029965ae34adc7e/settings?type=1"
},
"relationships": {
"chapters": {
"data": [{
"type": "clazz_chapter",
"id": 22604
},
{
"type": "clazz_chapter",
"id": 22605
}
]
}
}
},
"included": [{
"type": "clazz_chapter",
"id": 22604,
"attributes": {
"name": "第一章",
"sequence": 1
},
"relationships": {
"courses": {
"data": [{
"type": "course",
"id": "69f046e2165711efa100eea3801533d8"
}]
}
}
},
{
"type": "clazz_chapter",
"id": 22605,
"attributes": {
"name": "第二章",
"sequence": 2
},
"relationships": {
"courses": {
"data": [{
"type": "course",
"id": "fc96e85e425111ef9585be15917fa40c"
}]
}
}
}
]
}
参数 | 说明 |
---|---|
attributes.title | 开课主题。 |
attributes.description | 课程介绍。章节课程可指定。 |
attributes.cover_img | 课程封面。 |
attributes.is_required | 课程类型:是否必修课。 |
attributes.privilege_type | 学员范围。0:所有人; 1:部分人 |
attributes.is_chapter_hidden | 是否为有章节课程。0:有章节课程 1:无章节课程 |
attributes.edited_at | 课程更新时间 |
attributes.created_at | 课程创建时间 |
attributes.course_count | 子课程数 |
attributes.app_source_type | 应用来源:clazz ,课堂;roadmap ,项目 |
included[*].name | 章节名称 |
included[*].relationships.courses | 章节关联的素材信息 |
PUT https://lxapi.lexiangla.com/cgi-bin/v1/classes/{clazz_id}
document
参考(创建课程)[创建课程]。
参考(创建课程)[创建课程];只传需要修改的字段。
$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$attributes = [
];
$options = [
'type' => 1,
'title' => '开课主题',
'description' => '课程描述',
'cover_img' => 'https://image-pub.lexiang-asset.com/common/assets/course/wecourse.png',
'is_required' => true,
'is_reminded' => true,
'start_reminded_at' => '2020-02-22',
'end_reminded_at' => '2020-02-29',
'interval' => 3,
'optional_privilege_type'=>1,
'required_privilege_type'=> 1,
'course_id' => '079a9bc64b4c11eab91e0a58ac130b26',
// 'chapters' => [
// [
// 'name' => '前言',
// 'course_ids' => [
// '07e293184b4c11ea86e00a58ac130b26',
// ],
// ],
// ],
'category_id' => '3c945edcdda311e9baa352540013ef60',
'optional_privilege' => [
[
'type' => 'staff',
'id' => 'zhangsan',
],
[
'type' => 'department',
'id' => '1',
]
],
'required_privilege' => [
[
'type' => 'staff',
'id' => 'zhangsan',
],
[
'type' => 'department',
'id' => '1',
]
],
];
// 编辑课程
$clazz_id = '9fdebb1a5a0611ea8b3b5254009b5a66';
$response = $Lxapi->putClazz(StaffID, $clazz_id, $attributes, $options);
document
参考(创建课程)[创建课程]。
DELETE https://lxapi.lexiangla.com/cgi-bin/v1/classes/{clazz_id}
document
空
无
$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
// 编辑课程
$clazz_id = '9fdebb1a5a0611ea8b3b5254009b5a66';
$response = $Lxapi->deleteClazz(StaffID, $clazz_id);
document
POST https://lxapi.lexiangla.com/cgi-bin/v1/courses
视频类型素材
{
"data": {
"type": "course",
"attributes": {
"title": "素材标题",
"content": "API创建素材--这是简介",
"media_type": 0,
"target_users": "正式员工",
"complete_percent":100,
"ai_generate": {
"options": [
"text",
"knowledge_points"
],
"engine_model": "16k_zh"
}
},
"relationships": {
"category": {
"data": {
"type": "category",
"id": "1ee2acb65d2011eaadd80a58ac130b85"
}
},
"videos": {
"data": [
{
"type": "video",
"id": "7bffeaee8ae211ebb91fc60948cd64e5"
}
]
}
}
}
}
文档类型素材
{
"data": {
"type": "course",
"attributes": {
"title": "文档类素材",
"content": "API创建素材--这是简介",
"media_type": 1,
"target_users": "正式员工",
"duration":100
},
"relationships": {
"category": {
"data": {
"type": "category",
"id": "dfa007209d0911e7bf2865f56d035977"
}
},
"attachment": {
"data":
{
"type": "attachment",
"id": "feeb03900ac647159b9517487bc9f2c8"
}
}
}
}
}
参数 | 是否必须 | 默认值 | 说明 |
---|---|---|---|
attributes.title | 是 | 无 | 素材标题。 |
attributes.content | 否 | "" | 素材介绍 |
attributes.target_users | 否 | "" | 适用人群 |
attributes.is_shared | 否 | 0 | 0表示私密;1表示公开 |
attributes.complete_percent | 否 | 100 | 仅适用于视频类型素材,成员累计观看时长到达一定百分比即表示完成此课程的学习,设置值为100时表示需要整个视频观看完毕才完成学习 |
attributes.duration | 否 | 30 | 仅适用于文档类型素材,成员累计观看时长到达N秒即表示完成此课程的学习 |
attributes.media_type | 否 | 0 | 素材类型,为0表示视频素材;为1表示文档类型素材;为8表示音频素材 |
relationships.videos | 否 | 无 | 当前课程关联的视频id,当media_type为0时,必填 |
relationships.attachment | 否 | 无 | 当前课程关联的附件id,当media_type为1时,必填 |
relationships.category | 是 | 无 | 素材分类id |
attributes.ai_generate.options.text | 否 | 无 | 生成AI文稿 |
attributes.ai_generate.options.knowledge_points | 否 | 无 | 生成AI知识点 |
attributes.ai_generate.engine_model | 否 | 16k_zh | 指定的语言模型 // 16k_zh 简体中文, 16k_en 英语, 16k_yue 粤语, 16k_zh-PY 中英粤混合, 16k_ja 日语, 16k_ko 韩语, 16k_fil 菲律宾语, 16k_fr 法语, 16k_es 西班牙语, 16k_de 德语, 16k_tr 土耳其语, 16k_pt 葡萄牙语, 16k_vi 越南语, 16k_id 印尼语, 16k_th 泰语, 16k_ms 马来西亚语, 16k_ar 阿拉伯语, 16k_hi 印地语 |
关于视频上传的说明 乐享开放接口提供了视频上传的接口,详细使用说明请参考视频上传部分
$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->PostCourse('ThreeZhang', [
'title' => '视频类素材标题',
'content' => 'API创建素材--这是简介'
], [
'media_type' => 0,
'target_users' => '正式员工',
'category_id' => 'dfa007209d0911e7bf2865f56d035977',
'videos' => [
'a7a90cd8f2bc47649f515ef46d25c312'
]
]);
// 创建文档类型素材
$response = $Lxapi->PostCourse('ThreeZhang', [
'title' => '文档类素材标题',
'content' => 'API创建素材--这是简介'
], [
'media_type' => 1,
'target_users' => '正式员工',
'duration' => 100,
'category_id' => 'dfa007209d0911e7bf2865f56d035977',
'attachment_id' => 'feeb03900ac647159b9517487bc9f2c8',
]);
document
{
"data": {
"type": "course",
"id": "e3f159b3c807432082551c0fae08a8bb",
"attributes": {
"title": "API创建素材",
"media_type": 0,
"cover": null,
"duration": 0,
"complete_percent": 100,
"target_users": "正式员工",
"created_at": "2020-03-31 15:08:57"
},
"links": {
"platform": "https://lexiangla.com/courses/e3f159b3c807432082551c0fae08a8bb"
},
"relationships": {
"owner": {
"data": {
"type": "staff",
"id": "ThreeZhang"
}
},
"videos": {
"data": [
{
"type": "video",
"id": "a7a90cd8f2bc47649f515ef46d25c312"
}
]
},
"category": {
"data": {
"type": "category",
"id": "dfa007209d0911e7bf2865f56d035977"
}
}
}
},
"included": [
{
"type": "staff",
"id": "ThreeZhang",
"attributes": {
"name": "张三",
"english_name": "ThreeZhang"
}
},
{
"type": "video",
"id": "a7a90cd8f2bc47649f515ef46d25c312",
"attributes": {
"name": "345",
"type": "mp3",
"vod_file_id": "5285890800689954209"
}
},
{
"type": "category",
"id": "dfa007209d0911e7bf2865f56d035977",
"attributes": {
"name": "职业发展"
}
}
],
"links": {
"self": "https://lxapi.lexiangla.com/cgi-bin/v1/courses/e3f159b3c807432082551c0fae08a8bb"
}
}
PATCH https://lxapi.lexiangla.com/cgi-bin/v1/courses/{course_id}
document
{
"data": {
"type": "course",
"attributes": {
"title": "API修改素材标题素材",
"content": "API创建素材;这是简介",
"media_type": 0,
"target_users": "中国境内正式员工"
},
"relationships": {
"category": {
"data": {
"type": "category",
"id": "dfa007209d0911e7bf2865f56d035977"
}
},
"videos": {
"data": [
{
"type": "video",
"id": "a7a90cd8f2bc47649f515ef46d25c312"
}
]
}
}
}
}
更新文档类型素材
{
"data": {
"type": "course",
"attributes": {
"title": "API创建素材",
"content": "API创建素材;这是简介",
"media_type": 1,
"target_users": "正式员工",
"duration":100
},
"relationships": {
"category": {
"data": {
"type": "category",
"id": "dfa007209d0911e7bf2865f56d035977"
}
},
"attachment": {
"data":
{
"type": "attachment",
"id": "4a5be1248a424d6fbd6a36c705270a2b"
}
}
}
}
}
参数说明同创建素材
关于视频上传的说明 乐享开放接口提供了视频上传的接口,详细使用说明请参考视频上传部分
$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->patchCourse('ThreeZhang', 'e3f159b3c807432082551c0fae08a8bb',[
'title' => 'API修改素材标题素材',
'content' => 'API创建素材;这是简介',
'media_type' => 0,
'target_users' => '正式员工',
'category_id' => 'dfa007209d0911e7bf2865f56d035977',
'videos' => [
'a7a90cd8f2bc47649f515ef46d25c312'
]
]);
document
{
"data": {
"type": "course",
"id": "e3f159b3c807432082551c0fae08a8bb",
"attributes": {
"is_shared": 0,
"media_type": 0,
"title": "API修改素材标题素材",
"cover": null,
"duration": 0,
"complete_percent": 100,
"target_users": "中国境内正式员工",
"created_at": "2020-03-31 15:08:57"
},
"links": {
"platform": "https://lexiangla.com/courses/e3f159b3c807432082551c0fae08a8bb"
},
"relationships": {
"owner": {
"data": {
"type": "staff",
"id": "ThreeZhang"
}
},
"videos": {
"data": [
{
"type": "video",
"id": "a7a90cd8f2bc47649f515ef46d25c312"
}
]
},
"category": {
"data": {
"type": "category",
"id": "dfa007209d0911e7bf2865f56d035977"
}
}
}
},
"included": [
{
"type": "staff",
"id": "ThreeZhang",
"attributes": {
"name": "张三",
"english_name": "ThreeZhang"
}
},
{
"type": "video",
"id": "a7a90cd8f2bc47649f515ef46d25c312",
"attributes": {
"name": "345",
"type": "mp3",
"vod_file_id": "5285890800689954209"
}
},
{
"type": "category",
"id": "dfa007209d0911e7bf2865f56d035977",
"attributes": {
"name": "职业发展"
}
}
],
"links": {
"self": "https://lxapi.lexiangla.com/cgi-bin/v1/courses/e3f159b3c807432082551c0fae08a8bb"
}
}
GET https://lxapi.lexiangla.com/cgi-bin/v1/courses
document
{
"data": [
{
"type": "course",
"id": "76812e641eee11ee89e1a26ccf95184b",
"attributes": {
"is_shared": 0,
"media_type": 6,
"title": "文档素材",
"content": "<p>文档素材</p>",
"cover": "",
"duration": 30,
"complete_percent": 100,
"target_users": "适用人群",
"created_at": "2023-07-10 14:53:23",
"video_link": null,
"source_from": 5
},
"links": {
"platform": "https://abc.lexiangla.com/courses/76812e641eee11ee89e1a26ccf95184b"
},
"relationships": {
"owner": {
"data": {
"type": "staff",
"id": "zhangsan"
}
},
"category": {
"data": {
"type": "category",
"id": "9c336b789de311e7aed15254002b6735"
}
},
"classes": {
"data": [
{
"type": "clazz",
"id": "7e049fb81eee11eeae7aa26ccf95184b"
}
]
}
}
},
{
"type": "course",
"id": "72136b0a1eec11eeab91a26ccf95184b",
"attributes": {
"is_shared": 1,
"media_type": 3,
"title": "sad",
"content": "",
"cover": "",
"duration": 30,
"complete_percent": 100,
"target_users": null,
"created_at": "2023-07-10 14:38:57",
"video_link": "https://v.qq.com/x/cover/mzc00200t7i1qwp/d00462cxx.html",
"source_from": 1
},
"links": {
"platform": "https://abc.lexiangla.com/courses/72136b0a1eec11eeab91a26ccf95184b"
},
"relationships": {
"owner": {
"data": {
"type": "staff",
"id": "zhangsan"
}
},
"category": {
"data": {
"type": "category",
"id": "9c336b789de311e7aed15254002b6735"
}
},
"classes": {
"data": [
{
"type": "clazz",
"id": "78cc310c1eec11eeac31a26ccf95184b"
}
]
}
}
}
],
"links": {
"first": "https://lxapi.lexiangla.com/cgi-bin/v1/courses?per_page=2&page=1",
"last": "https://lxapi.lexiangla.com/cgi-bin/v1/courses?per_page=2&page=3684",
"prev": "https://lxapi.lexiangla.com/cgi-bin/v1/courses?per_page=2&page=2",
"next": "https://lxapi.lexiangla.com/cgi-bin/v1/courses?per_page=2&page=4"
},
"meta": {
"current_page": 3,
"from": 5,
"last_page": 3684,
"path": "https://lxapi.lexiangla.com/cgi-bin/v1/courses",
"per_page": 2,
"to": 6,
"total": 7367
},
"included": [
{
"type": "staff",
"id": "zhangsan",
"attributes": {
"name": "zhangsan",
"english_name": null,
"organization": "43 产品经理"
}
},
{
"type": "category",
"id": "9c336b789de311e7aed15254002b6735",
"attributes": {
"name": "其他",
"weight": 0
}
},
{
"type": "clazz",
"id": "7e049fb81eee11eeae7aa26ccf95184b",
"attributes": {
"type": 1,
"course_count": 1,
"title": "文档课程",
"description": "<p>文档课程</p>",
"cover_img": "",
"is_required": 0,
"comment_count": 0,
"created_at": "2023-07-10 14:53:36",
"updated_at": "2023-07-10 14:53:36",
"recommended_at": null,
"participants_count": 0,
"app_source_type": "clazz"
},
"links": {
"platform": "https://abc.lexiangla.com/classes/7e049fb81eee11eeae7aa26ccf95184b?type=1",
"manager": "https://abc.lexiangla.com/classes/7e049fb81eee11eeae7aa26ccf95184b/settings?type=1"
}
},
{
"type": "clazz",
"id": "78cc310c1eec11eeac31a26ccf95184b",
"attributes": {
"type": 0,
"course_count": 1,
"title": "链接课程",
"description": "",
"cover_img": "",
"is_required": 0,
"comment_count": 0,
"created_at": "2023-07-10 14:39:08",
"updated_at": "2023-07-10 14:39:08",
"recommended_at": null,
"participants_count": 1,
"app_source_type": "clazz"
},
"links": {
"platform": "https://abc.lexiangla.com/classes/78cc310c1eec11eeac31a26ccf95184b?type=0",
"manager": "https://abc.lexiangla.com/classes/78cc310c1eec11eeac31a26ccf95184b/settings?type=0"
}
}
]
}
参数 | 说明 |
---|---|
title | 素材主题 |
media_type | 素材类型(0视频、1文档、3视频链接、4第三方视频、6富文本、8音频) |
content | 素材介绍 |
cover | 素材封面 |
duration | 完成条件:累计观看时长达到(单位:s) |
complete_percent | 完成条件:累计播放时长达到视频总时长的百分比 |
target_user | 适用人群 |
created_at | 创建时间 |
video_link | 视频链接 |
source_from | 素材来源(1自建素材库、5 知识库文档、6问卷和考试) |
relationships.catagory | 素材分类 |
relationships.owner | 素材创建者 |
relationships.classes | 当前素材关联的课堂id |
relationships.videos | 当前素材关联的视频id |
relationships.attachment | 当前素材关联的文档id |
included.staff.organization | 所属部门 |
GET https://lxapi.lexiangla.com/cgi-bin/v1/courses/{course_id}
参数 | 是否必须 | 默认值 | 说明 |
---|---|---|---|
course_id | 是 | 无 | 素材id |
$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->get('courses/{id}');
document
{
"data": {
"type": "course",
"id": "b47dc96ce66f11eaa4f35254008ea09d",
"attributes": {
"is_shared": 0,
"media_type": 0,
"title": "素材标题",
"cover": "",
"duration": 257,
"complete_percent": 100,
"target_users": null,
"created_at": "2020-08-25 09:10:03"
},
"links": {
"platform": "https://lexiangla.com/courses/b47dc96ce66f11eaa4f35254008ea09d"
},
"relationships": {
"owner": {
"data": {
"type": "staff",
"id": "ThreeZhang"
}
},
"videos": {
"data": [{
"type": "video",
"id": "b4514a54e66f11eabfc25254008ea09d"
}]
},
"category": {
"data": {
"type": "category",
"id": "9c336b789de311e7aed15254002b6735"
}
}
"ai_text": {
"data": {
"type": "ai_text",
"id": 3644
}
},
"ai_knowledge_points": {
"data": [{
"type": "ai_knowledge_point",
"id": 2597
}]
}
}
},
"included": [{
"type": "staff",
"id": "ThreeZhang",
"attributes": {
"name": "ThreeZhang",
"english_name": null,
"organization": "xxx"
}
},
{
"type": "video",
"id": "b4514a54e66f11eabfc25254008ea09d",
"attributes": {
"name": "5285890806561391242",
"type": "hls",
"vod_file_id": "5285890806561391242"
}
},
{
"type": "category",
"id": "9c336b789de311e7aed15254002b6735",
"attributes": {
"name": "XX"
}
},
{
"type": "clazz",
"id": "98ec91fef01c11efa9bc22839edf8be4",
"attributes": {
"type": 1,
"is_chapter_hidden": 1,
"course_count": 3,
"title": "XX",
"is_shelved": 1,
"description": "",
"cover_img": "",
"is_required": 0,
"privilege_type": 1,
"required_privilege_type": 1,
"optional_privilege_type": 1,
"read_count": 20,
"comment_count": 0,
"edited_at": "2025-02-24 15:29:48",
"created_at": "2025-02-21 14:25:08",
"updated_at": "2025-02-24 16:27:50",
"recommended_at": null,
"participants_count": 0,
"app_source_type": "clazz"
},
"links": {
"platform": "https://km.lexiangla.net/classes/98ec91fef01c11efa9bc22839edf8be4?type=1",
"manager": "https://km.lexiangla.net/classes/98ec91fef01c11efa9bc22839edf8be4/settings?type=1"
}
}, {
"type": "ai_text",
"id": 3644,
"attributes": {
"code": 1,
"status": "finished",
"result_content": "XXXXXXXXXXXXXXXXxxxxxxxxxxxxxxxXXXXXXX",
"text": "XXXXXXXXXXXXXXXXxxxxxxxxxxxxxxxXXXXXXX",
"created_at": "2025-02-21 14:26:17",
"updated_at": "2025-02-21 14:30:16"
}
}, {
"type": "ai_knowledge_point",
"id": 2597,
"attributes": {
"title": "XXXXX",
"illustrate": "XXXXXXXXXXXXXXXXxxxxxxxxxxxxxxxXXXXXXX",
"time_point": "1"
}
}
],
"links": {
"self": "https://lxapi.lexiangla.com/cgi-bin/v1/courses/b47dc96ce66f11eaa4f35254008ea09d"
}
}
参数 | 说明 |
---|---|
data.attributes.title | 素材主题 |
data.attributes.is_shared | 素材使用权限,0表示私密,1表示公开 |
data.attributes.media_type | 素材类型(0视频、1文档、3视频链接、4第三方视频、6富文本、8音频) |
data.attributes.cover | 素材封面 |
data.attributes.duration | 完成条件:累计观看时长达到(单位:s) |
data.attributes.content | 素材介绍 |
data.attributes.target_user | 适用人群 |
relationships.catagory | 素材分类 |
relationships.videos | 当前素材关联的视频id |
relationships.attachment | 当前素材关联的文档id |
included.staff.organization | 所属部门 |
relationships.ai_text | 当前素材关联的AI文稿id |
relationships.ai_knowledge_point | 当前素材关联的AI知识点的id |
Included.type="ai_text"参数说明:
参数 | 说明 |
---|---|
attributes.code | 0 // 任务待执行,或执行中 1 // 任务执行完成 2 // 任务执行失败 3 // 任务执行完成,但内容为空 4 // 任务失效,如素材视频替换了 |
attributes.status | waiting //文稿任务等待执行状态 doing // 文稿任务正在执行状态 failed //文稿任务执行失败状态 finished // 文稿任务执行成功状态 |
attributes.result_content | 文稿段落模式,json串中字段含义,l: 段落 s:段落开始时间 e:段落结束时间 w:段落内容 |
attributes.text | 文稿文本格式,带时间戳范围 |
Included.type="ai_knowledge_point"参数说明:
参数 | 说明 |
---|---|
attributes.title | 知识点总结标题 |
attributes.illustrate | 知识点总结 |
attributes.time_point | 知识点时间戳 |
DELETE https://lxapi.lexiangla.com/cgi-bin/v1/courses/{course_id}
document
空
无
$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->deleteCourse('ThreeZhang', 'e3f159b3c807432082551c0fae08a8bb');
GET https://lxapi.lexiangla.com/cgi-bin/v1/classes?is_shelved=1
支持分页参数和排序:(通用说明?)
支持时间范围过滤
参数 | 是否必须 | 默认值 | 说明 |
---|---|---|---|
category_id | 否 | 无 | 开课分类id。设置了此值,只返回该开课分类及其子分类下的课程。 |
sort | 否 | id | 排序参数,created_at升序,-created_at表示降序,edited_at升序,-edited_at表示降序,混合传参:created_at,edited_at |
app_source_type | 否 | 无 | 课堂应用来源,为空或不传获取的是全部,clazz:来自课堂应用,roadmap:来自项目 |
team_id | 否 | 无 | K吧id |
is_recommended | 否 | 无 | 是否推荐 1:推荐 不传或传空值:全部课程 |
tag | 否 | 无 | 关联标签名称 |
is_shelved | 否 | 无 | 1表示上架课程,0 表示下架课程 |
$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->get('classes');
document
{
"data": [
{
"type": "clazz",
"id": "615b0b38906811ec8082da45fe8899ab",
"attributes": {
"title": "K吧的课堂",
"required_privilege_type": 1,
"optional_privilege_type": 1,
"is_shelved": 1,
"comment_count": 0,
"edited_at": "2024-09-29 19:51:15",
"type": 1,
"is_chapter_hidden": 1,
"course_count": 1,
"description": "",
"cover_img": "",
"created_at": "2022-02-18 11:10:52",
"updated_at": "2022-02-18 11:10:52",
"recommended_at": " null",
"participants_count": 0,
"app_source_type": "clazz"
},
"links": {
"platform": "https://lexiangla.com/teams/k100001/classes/615b0b38906811ec8082da45fe8899ab?type=1&company_from=35a8fa86146711ecaced62e194xxxxxx",
"manager": "https://lexiangla.com/teams/k100001/classes/615b0b38906811ec8082da45fe8899ab/settings?type=1&company_from=35a8fa86146711ecaced62e194xxxxxx"
},
"relationships": {
"team": {
"data": {
"type": "team",
"id": "9053347e146711ecb03862e1943b6703"
}
},
"category": {
"data": {
"type": "category",
"id": "91bc8e28146711eca37e62e1943b6703"
}
},
"owner": {
"data": {
"type": "staff",
"id": "zhangsan"
}
}
}
},
{
"type": "clazz",
"id": "45e79f60906811ec84efda45fe8899ab",
"attributes": {
"title": "课堂",
"required_privilege_type": 2,
"optional_privilege_type": 1,
"is_shelved": 1,
"comment_count": 0,
"type": 1,
"is_chapter_hidden": 1,
"course_count": 2,
"description": "",
"cover_img": "",
"created_at": "2022-02-18 11:10:06",
"updated_at": "2022-02-18 11:10:06",
"edited_at": "2024-09-29 19:51:15",
"recommended_at": " 2022-08-01 10:13:22",
"participants_count": 0,
"app_source_type": "roadmap"
},
"links": {
"platform": "https://lexiangla.com/classes/45e79f60906811ec84efda45fe8899ab?type=1&company_from=35a8fa86146711ecaced62e194xxxxxx",
"manager": "https://lexiangla.com/classes/45e79f60906811ec84efda45fe8899ab/settings?type=1&company_from=35a8fa86146711ecaced62e194xxxxxx"
},
"relationships": {
"tags": {
"data": [
{
"type": "tag",
"id": "604af8b6f9e511e787355254002b6735"
},
{
"type": "tag",
"id": "a5499780edc011eeb17386fc95059466"
},
{
"type": "tag",
"id": "a7a71950219411efa1670e47581a3981"
}
]
},
"category": {
"data": {
"type": "category",
"id": "91bd812a146711ec930a62e1943b6703"
}
},
"owner": {
"data": {
"type": "staff",
"id": "zhangsan"
}
},
"roadmap": {
"data": {
"type": "roadmap",
"id": 2
}
}
}
},
{
"type": "clazz",
"id": "696ea5c68d5e11ecb849ca7efb627684",
"attributes": {
"title": "123",
"required_privilege_type": 2,
"optional_privilege_type": 1,
"is_shelved": 1,
"comment_count": 0,
"type": 1,
"is_chapter_hidden": 1,
"course_count": 1,
"description": "",
"cover_img": "",
"created_at": "2022-02-14 14:21:57",
"updated_at": "2022-02-14 14:21:57",
"edited_at": "2024-09-29 19:51:15",
"recommended_at": " null",
"participants_count": 0,
"app_source_type": "clazz"
},
"links": {
"platform": "https://lexiangla.com/teams/k100006/classes/696ea5c68d5e11ecb849ca7efb627684?type=1&company_from=35a8fa86146711ecaced62e194xxxxxx",
"manager": "https://lexiangla.com/teams/k100006/classes/696ea5c68d5e11ecb849ca7efb627684/settings?type=1&company_from=35a8fa86146711ecaced62e194xxxxxx"
},
"relationships": {
"team": {
"data": {
"type": "team",
"id": "aa48319451a811ec8f0c4e338aebc107"
}
},
"category": {
"data": {
"type": "category",
"id": "91bd812a146711ec930a62e1943b6703"
}
},
"owner": {
"data": {
"type": "staff",
"id": "zhangsan"
}
}
}
}
],
"links": {
"first": "https://lxapi.lexiangla.com/cgi-bin/v1/classes?sort=-created_at&page=1",
"last": "https://lxapi.lexiangla.com/cgi-bin/v1/classes?sort=-created_at&page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"path": "https://lxapi.lexiangla.com/cgi-bin/v1/classes",
"per_page": 20,
"to": 3,
"total": 3
},
"included": [
{
"type": "tag",
"id": "604af8b6f9e511e787355254002b6735",
"attributes": {
"name": "标签1",
"recommended_at": null
}
},
{
"type": "tag",
"id": "a5499780edc011eeb17386fc95059466",
"attributes": {
"name": "标签2",
"recommended_at": null
}
},
{
"type": "tag",
"id": "a7a71950219411efa1670e47581a3981",
"attributes": {
"name": "标签2",
"recommended_at": null
}
},
{
"type": "team",
"id": "9053347e146711ecb03862e1943b6703",
"attributes": {
"code": "k100001",
"name": "全员吧",
"type": 1,
"logo": null,
"signature": null,
"is_secret": 0
}
},
{
"type": "team",
"id": "aa48319451a811ec8f0c4e338aebc107",
"attributes": {
"code": "k100006",
"name": "跳蚤市场",
"type": 2,
"logo": null,
"signature": "",
"is_secret": 1
}
},
{
"type": "category",
"id": "91bc8e28146711eca37e62e1943b6703",
"attributes": {
"name": "入职须知",
"weight": 0
}
},
{
"type": "category",
"id": "91bd812a146711ec930a62e1943b6703",
"attributes": {
"name": "其他",
"weight": 0
}
},
{
"type": "staff",
"id": "zhangsan",
"attributes": {
"name": "张三",
"english_name": "",
"organization": "测试组"
}
},
{
"type": "roadmap",
"id": "2",
"attributes": {
"title": "项目课堂",
"to_staff_count": 8,
"passed_staff_count": 0,
"created_at": "2022-02-18 11:09:47"
}
}
]
}
参数 | 说明 |
---|---|
data.attributes.title | 开课主题 |
data.attributes.is_chapter_hidden | 是否为无章节课程,1:无章节课程 0:有章节课程 |
data.attributes.is_shelved | 是否为上架状态,1:已上架 0:未上架 |
data.attributes.required_privilege_type | 必修学员范围。0:所有人; 1:部分人; 2.无; |
data.attributes.optional_privilege_type | 选修学员范围。0:所有人; 1:部分人; 2.无; |
data.attributes.type | 课程类型 (0独立课程,1章节课程) |
data.attributes.course_count | 子课程数 |
data.attributes.data.attributes.description | 课程介绍 |
data.attributes.cover_img | 课程封面 |
data.attributes.comment_count | 评论数量 |
data.attributes.recommended_at | 若课程被管理员设置为推荐课程,则此处值为设置时间,否则为null |
data.attributes.participants_count | 已学人数 |
data.attributes.created_at | 创建时间 |
data.attributes.edited_at | 更新时间 |
links.platform | 课程详情页链接 |
links.manager | 课程管理页链接 |
data.attributes.app_source_type | 应用来源:clazz ,课堂;roadmap ,项目 |
data.attributes.tags | 关联标签 |
data.relationships.roadmap | 课程所属项目 |
data.relationships.team | 课程所属K吧 |
data.relationships.category | 课程分类 |
data.relationships.owner | 课程创建者 |
data.included.staff.organization | 课程所属部门 |
GET https://lxapi.lexiangla.com/cgi-bin/v1/classes/{clazz_id}
参数 | 是否必须 | 默认值 | 说明 |
---|---|---|---|
clazz_id | 是 | 无 | 课堂id |
$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->get('classes/{id}');
document
{
"data": {
"type": "clazz",
"id": "510465627e1911ef9e48ce2e0a52a765",
"attributes": {
"type": 1,
"is_chapter_hidden": 0,
"course_count": 2,
"title": "课堂测试-有章节",
"is_shelved": 1,
"description": "",
"cover_img": "",
"is_required": 0,
"privilege_type": 1,
"required_privilege_type": 1,
"optional_privilege_type": 1,
"comment_count": 0,
"edited_at": "2024-09-29 20:30:36",
"created_at": "2024-09-29 12:14:27",
"updated_at": "2024-09-29 20:30:36",
"recommended_at": null,
"study_persons_count": 1,
"participants_count": 1,
"app_source_type": "clazz"
},
"links": {
"platform": "https://km.lexiangla.com/classes/510465627e1911ef9e48ce2e0a52a765?type=1",
"manager": "https://km.lexiangla.com/classes/510465627e1911ef9e48ce2e0a52a765/settings?type=1"
},
"relationships": {
"category": {
"data": {
"type": "category",
"id": "d474d3cace4f11e9911a52540013ef60"
}
},
"owner": {
"data": {
"type": "staff",
"id": "zhangsan"
}
},
"courses": {
"data": [
{
"type": "course",
"id": "7fe3fc387c9f11ef87ba2e9fa8feabe4"
},
{
"type": "course",
"id": "7fea53e47c9f11ef8dc92e9fa8feabe4"
}
]
},
"chapters": {
"data": [
{
"type": "clazz_chapter",
"id": 24153
},
{
"type": "clazz_chapter",
"id": 24154
}
]
},
"privilege": {
"data": [
{
"type": "contact_tag",
"id": "25d992dc203811ec8262f23f2082154b"
},
{
"type": "contact_tag",
"id": "b96a1e8eeb5b11eb86cefa390de91f52"
},
{
"type": "department",
"id": "140000002"
},
{
"type": "department",
"id": "154"
},
{
"type": "staff",
"id": "new_new_new2"
},
{
"type": "staff",
"id": "xinxinxinxin"
}
]
},
"required_privilege": {
"data": [
{
"type": "contact_tag",
"id": "b96a1e8eeb5b11eb86cefa390de91f52"
},
{
"type": "department",
"id": "154"
},
{
"type": "staff",
"id": "new_new_new2"
},
{
"type": "staff",
"id": "xinxinxinxin"
}
]
},
"optional_privilege": {
"data": [
{
"type": "contact_tag",
"id": "25d992dc203811ec8262f23f2082154b"
},
{
"type": "department",
"id": "140000002"
},
{
"type": "staff",
"id": "xinxinxinxin"
}
]
}
}
},
"included": [
{
"type": "category",
"id": "d474d3cace4f11e9911a52540013ef60",
"attributes": {
"name": "其他",
"weight": 0
}
},
{
"type": "staff",
"id": "zhangsan",
"attributes": {
"name": "zhangsan",
"english_name": null,
"organization": "140 开发"
}
},
{
"type": "course",
"id": "7fe3fc387c9f11ef87ba2e9fa8feabe4",
"attributes": {
"is_shared": 0,
"media_type": 1,
"title": "素材1",
"content": "",
"cover": "",
"duration": 30,
"complete_percent": 100,
"target_users": null,
"created_at": "2024-09-27 15:09:55",
"video_link": null,
"source_from": 1
},
"links": {
"platform": "https://km.lexiangla.net/classes/510465627e1911ef9e48ce2e0a52a765/courses/7fe3fc387c9f11ef87ba2e9fa8feabe4?type=1"
},
"relationships": {
"lecturers": {
"data": [
{
"type": "lecturer",
"id": "db41bece7ae411efa5508ada8526ebb0"
}
]
}
}
},
{
"type": "course",
"id": "7fea53e47c9f11ef8dc92e9fa8feabe4",
"attributes": {
"is_shared": 0,
"media_type": 0,
"title": "素材2",
"content": "",
"cover": "",
"duration": 189,
"complete_percent": 80,
"target_users": null,
"created_at": "2024-09-27 15:09:55",
"video_link": null,
"source_from": 1
},
"links": {
"platform": "https://km.lexiangla.net/classes/510465627e1911ef9e48ce2e0a52a765/courses/7fea53e47c9f11ef8dc92e9fa8feabe4?type=1"
},
"relationships": {
"lecturers": {
"data": [
{
"type": "lecturer",
"id": "c23465c2653011ef99de8aab7d96ce8e"
}
]
}
}
},
{
"type": "clazz_chapter",
"id": 24153,
"attributes": {
"name": "第一章",
"sequence": 1
}
},
{
"type": "clazz_chapter",
"id": 24154,
"attributes": {
"name": "章节2",
"sequence": 2
}
},
{
"type": "lecturer",
"id": "db41bece7ae411efa5508ada8526ebb0",
"attributes": {
"status": 1
},
"relationships": {
"staff": {
"data": {
"type": "staff",
"id": "kalpaxu"
}
}
}
},
{
"type": "lecturer",
"id": "c23465c2653011ef99de8aab7d96ce8e",
"attributes": {
"status": 1
},
"relationships": {
"staff": {
"data": {
"type": "staff",
"id": "testtongbu"
}
}
}
}
]
}
参数 | 说明 |
---|---|
data.attributes.title | 开课主题 |
data.attributes.is_chapter_hidden | 是否为无章节课程,1:无章节课程 0:有章节课程 |
data.attributes.is_shelved | 是否为上架状态,1:已上架 0:未上架 |
data.attributes.cover_img | 课程封面 |
data.attributes.required_privilege_type | 必修学员范围。0:所有人; 1:部分人; 2.无; |
data.attributes.optional_privilege_type | 选修学员范围。0:所有人; 1:部分人; 2.无; |
data.attributes.description | 课程介绍 |
data.attributes.recommended_at | 若课程被管理员设置为推荐课程,则此处值为设置时间,否则为null |
data.attributes.category_id | 开课分类id |
data.attributes.is_required | 属性:是否为必修,1为必修 |
data.attributes.course_count | 子课程数 |
data.attributes.comment_count | 评论数 |
data.attributes.participants_count | 已学人数 |
data.attributes.created_at | 创建时间 |
data.attributes.edited_at | 更新时间 |
data.attributes.app_source_type | 应用来源:clazz ,课堂;roadmap ,项目 |
data.attributes.relationships.owner | 课程创建者 |
data.relationships.tags | 关联标签 |
data.relationships.courses | 素材信息 |
data.relationships.chapters | 章节信息 |
data.relationships.privilege | 部分人可见关联的组织架构对象,包含required_privilege和选修optional_privilege中 staff,department,team,contact_tag 所有对象 |
data.relationships.required_privilege | 关联的必修组织架构信息,仅当 required_privilege_type 为1时 返回多个 staff,department,team,contact_tag 对象 |
data.relationships.optional_privilege | 关联的选修组织架构信息,仅当 optional_privilege_type 为1时 返回多个 staff,department,team,contact_tag 对象 |
data.relationships.team | 关联的k吧 |
data.included.relationships.lecturer | 素材关联的讲师信息 |
data.included.relationships.staff | 讲师关联的成员信息 |
data.included.staff.organization | 课程所属部门 |
此接口和 页面个人主页-我的课堂-我的课程列表,课程类型:必修;课程状态:未学习+学习中 的数据保持一致
不支持page
和per_page
入参,默认显示1页,默认每页数量为100条,最大值为100
GET https://lxapi.lexiangla.com/cgi-bin/v1/staffs/{staff_id}/todolist/classes
参数 | 是否必须 | 默认值 | 说明 |
---|---|---|---|
staff_id | 是 | 无 | 成员帐号 |
$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->get('staffs/'.$staff_id.'/todolist/classes', []);
document
{
"data": [
{
"type": "clazz",
"id": "9aab401a274e11ed90ed9ee620403c9c",
"attributes": {
"type": 1,
"title": "必修1",
"created_at": "2022-08-29 11:56:47"
"is_shelved": 1,
},
"links": {
"platform": "https://lexiangla.com/classes/9aab401a274e11ed90ed9ee620403c9c?type=1&company_from=260a5784a5ce11ecbb8fe29189bfe68d",
"manager": "https://lexiangla.com/classes/9aab401a274e11ed90ed9ee620403c9c/settings?type=1&company_from=260a5784a5ce11ecbb8fe29189bfe68d"
},
"relationships": {
"owner": {
"data": {
"type": "staff",
"id": "zhangsan"
}
}
}
},
{
"type": "clazz",
"id": "7ed4af16274e11ed8053da669feb587c",
"attributes": {
"type": 1,
"title": "必修2",
"created_at": "2022-08-29 11:56:00"
"is_shelved": 1,
},
"links": {
"platform": "https://lexiangla.com/classes/7ed4af16274e11ed8053da669feb587c?type=1&company_from=260a5784a5ce11ecbb8fe29189bfe68d",
"manager": "https://lexiangla.com/classes/7ed4af16274e11ed8053da669feb587c/settings?type=1&company_from=260a5784a5ce11ecbb8fe29189bfe68d"
},
"relationships": {
"owner": {
"data": {
"type": "staff",
"id": "zhangsan"
}
}
}
}
],
"included": [
{
"type": "staff",
"id": "zhangsan",
"attributes": {
"name": "张三",
"english_name": null,
"organization": ""
}
}
],
"meta": {
"total": 2
}
}
参数 | 说明 |
---|---|
attributes.title | 开课主题 |
attributes.type | 课程类型 (0独立课程,1章节课程) |
attributes.created_at | 创建时间 |
links.platform | 课程详情页链接 |
links.manager | 课程管理页链接 |
relationships.owner | 课程创建者 |
meta.total | 本次请求返回课程数量 |
通过此接口可以获取到章节课程中各个章节和素材的对应关系,独立课程不支持调用此接口
GET https://lxapi.lexiangla.com/cgi-bin/v1/classes/{clazz_id}/chapters
参数 | 是否必须 | 默认值 | 说明 |
---|---|---|---|
clazz_id | 是 | 无 | 课程id |
$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->get("classes/" . $clazz_id . "/chapters");
document
{
"data": [
{
"type": "clazz_chapter",
"id": 15033,
"attributes": {
"name": "第一章",
"sequence": 1
},
"relationships": {
"courses": {
"data": [
{
"type": "course",
"id": "5a28b4a4004311ee94276ac5c7a8xxxx"
}
]
}
}
},
{
"type": "clazz_chapter",
"id": 15035,
"attributes": {
"name": "第二章",
"sequence": 2
},
"relationships": {
"courses": {
"data": [
{
"type": "course",
"id": "f38a9020002711eeae735a343134xxxx"
}
]
}
}
}
],
"included": [
{
"type": "course",
"id": "5a28b4a4004311ee94276ac5c7a8a54a",
"attributes": {
"is_shared": 1,
"media_type": 0,
"title": "素材(1)",
"content": "<p>123</p>",
"cover": "",
"duration": 3,
"complete_percent": 80,
"target_users": "3213",
"created_at": "2023-06-01 14:12:57",
"video_link": null
},
"links": {
"platform": "https://abc.lexiangla.com/courses/5a28b4a4004311ee94276ac5c7a8xxx"
}
},
{
"type": "course",
"id": "f38a9020002711eeae735a343134294a",
"attributes": {
"is_shared": 0,
"media_type": 0,
"title": "素材(2)",
"content": "",
"cover": "",
"duration": 136,
"complete_percent": 80,
"target_users": null,
"created_at": "2023-06-01 10:56:48",
"video_link": null
},
"links": {
"platform": "https://abc.lexiangla.com/courses/f38a9020002711eeae735a3431342xxx"
}
}
]
}
参数 | 说明 |
---|---|
type | 资源对象类型为clazz_chapter,表示课程章节 |
id | 章节课程章节id |
attributes.name | 章节名称 |
attributes.relationships.courses | 关联的素材资源 |
GET https://lxapi.lexiangla.com/cgi-bin/v1/staffs/{staff_id}/classes
参数 | 是否必须 | 默认值 | 说明 |
---|---|---|---|
staff_id | 是 | 无 | 员工帐号 |
min_start_learn_at | 否 | 无 | 开始学习时间的起始点(包含当天) |
max_start_learn_at | 否 | 无 | 开始学习时间的截止点(不包含当天) |
min_succeeded_at | 否 | 无 | 完成学习时间的起始点(包含当天) |
max_succeeded_at | 否 | 无 | 完成学习时间的截止点(不包含当天) |
learn_status | 否 | 无 | 学习状态:1——学习中,2——已完成,不传入参——学习中,已完成 |
sort | 否 | 无 | 最近学习时间倒序:-last_learn_at |
$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->get('staffs/ThreeZhang/classes' ,[
'min_start_learn_at' => '2020-02-02',
'max_start_learn_at' => '2020-02-20',
'min_succeeded_at' => '2020-02-02',
'max_succeeded_at' => '2020-02-20',
'learn_status' => '2',
'sort' => '-last_learn_at'
]);
document
{
"data": [
{
"type": "clazz",
"id": "15daacfe334b11e981af10e7c61c70fc",
"attributes": {
"title": "乐享课堂",
"is_shelved": 1,
"duration": 60,
"is_required": 1,
"comment_count": 0,
"created_at": "2019-02-18 15:01:59",
"updated_at": "2019-05-29 15:17:47",
"learn_time": 100,
"start_learn_at": "2019-09-18 15:13:34",
"succeeded_at": "2019-09-19 15:13:34",
"is_succeeded": true,
"learn_status": 2
}
},
{
"type": "clazz",
"id": "366faef0992411e7ba59080027854b0f",
"attributes": {
"title": "乐享课堂1",
"is_shelved": 1,
"duration": 60,
"is_required": 0,
"comment_count": 0,
"created_at": "2019-06-18 18:14:50",
"updated_at": "2019-06-19 18:14:50",
"learn_time": 0,
"valid_learn_time": 0,
"start_learn_at": "2017-09-20 17:57:09",
"succeeded_at": "2019-09-19 15:13:34",
"is_succeeded": true,
"learn_status": 2
},
"relationships": {
"team": {
"data": {
"type": "team",
"id": "a450d7bc01ed11eab1855254009b5a66"
}
}
}
},
{
"type": "clazz",
"id": "7f1bbe66beed11e7aade080027854b0f",
"attributes": {
"title": "乐享课堂2",
"is_shelved": 1,
"duration": 60,
"is_required": 0,
"comment_count": 0,
"created_at": "2019-06-18 18:14:50",
"updated_at": "2019-06-19 18:14:50",
"learn_time": 0,
"valid_learn_time": 0,
"start_learn_at": "2017-09-20 17:57:09",
"succeeded_at": "2019-09-19 15:13:34",
"is_succeeded": true,
"learn_status": 2
}
}
],
"links": {
"first": "https://lxapi.lexiangla.com/cgi-bin/v1/staffs/ThreeZhang/classes?page=1",
"last": "https://lxapi.lexiangla.com/cgi-bin/v1/staffs/ThreeZhang/classes?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"path": "https://lxapi.lexiangla.com/cgi-bin/v1/staffs/ThreeZhang/classes",
"per_page": 20,
"to": 3,
"total": 3
}
}
参数 | 说明 |
---|---|
clazz.type | 资源对象类型,必须为 clazz,表示课堂 |
clazz.id | 课堂的id |
clazz.title | 开课主题 |
clazz.start_learn_at | 开始学习时间 |
clazz.succeeded_at | 完成学习时间 |
clazz.learn_time | 学习时长(单位:s) |
clazz.duration | 课程总时长 |
clazz.valid_learn_time | 有效学习时长(单位:s) |
clazz.is_succeeded | 是否学完 |
clazz.learn_status | 学习状态:1——学习中,2——已完成 |
clazz.is_required | 属性:是否为必修,1为必修,0为选修 |
clazz.comment_count | 评论数量 |
clazz.created_at | 创建时间 |
clazz.updated_at | 更新时间 |
relationships.team.id | K吧的id |
GET https://lxapi.lexiangla.com/cgi-bin/v1/staffs/{staff_id}/classes/{clazz_id}
参数 | 是否必须 | 默认值 | 说明 |
---|---|---|---|
staff_id | 是 | 无 | 员工帐号 |
clazz_id | 否 | 无 | 课程id |
document
{
"data": {
"type": "clazz",
"id": "510465627e1911ef9e48ce2e0a52a765",
"attributes": {
"type": 1,
"is_chapter_hidden": 0,
"course_count": 4,
"title": "课堂测试-有章节",
"is_shelved": 1,
"description": "",
"cover_img": "",
"is_required": 0,
"privilege_type": 1,
"required_privilege_type": 1,
"optional_privilege_type": 1,
"comment_count": 0,
"edited_at": "2024-09-29 20:11:01",
"created_at": "2024-09-29 12:14:27",
"updated_at": "2024-09-29 20:11:01",
"recommended_at": null,
"study_persons_count": 1,
"participants_count": 1,
"app_source_type": "clazz"
},
"links": {
"platform": "https://km.lexiangla.com/classes/510465627e1911ef9e48ce2e0a52a765?type=1",
"manager": "https://km.lexiangla.com/classes/510465627e1911ef9e48ce2e0a52a765/settings?type=1"
},
"relationships": {
"category": {
"data": {
"type": "category",
"id": "d474d3cace4f11e9911a52540013ef60"
}
},
"owner": {
"data": {
"type": "staff",
"id": "zhangsan"
}
},
"courses": {
"data": [
{
"type": "course",
"id": "7fe3fc387c9f11ef87ba2e9fa8feabe4"
},
{
"type": "course",
"id": "470912927e1911ef93c8ce2e0a52a765"
},
{
"type": "course",
"id": "7fea53e47c9f11ef8dc92e9fa8feabe4"
},
{
"type": "course",
"id": "095b0bf47be811ef9c94067e64d07a64"
}
]
},
"chapters": {
"data": [
{
"type": "clazz_chapter",
"id": 24153
},
{
"type": "clazz_chapter",
"id": 24154
}
]
},
"privilege": {
"data": [
{
"type": "contact_tag",
"id": "25d992dc203811ec8262f23f2082154b"
},
{
"type": "contact_tag",
"id": "b96a1e8eeb5b11eb86cefa390de91f52"
},
{
"type": "department",
"id": "140000002"
},
{
"type": "department",
"id": "154"
},
{
"type": "staff",
"id": "new_new_new2"
},
{
"type": "staff",
"id": "xinxinxinxin"
}
]
},
"required_privilege": {
"data": [
{
"type": "contact_tag",
"id": "b96a1e8eeb5b11eb86cefa390de91f52"
},
{
"type": "department",
"id": "154"
},
{
"type": "staff",
"id": "new_new_new2"
},
{
"type": "staff",
"id": "xinxinxinxin"
}
]
},
"optional_privilege": {
"data": [
{
"type": "contact_tag",
"id": "25d992dc203811ec8262f23f2082154b"
},
{
"type": "department",
"id": "140000002"
},
{
"type": "staff",
"id": "xinxinxinxin"
}
]
}
}
},
"included": [
{
"type": "category",
"id": "d474d3cace4f11e9911a52540013ef60",
"attributes": {
"name": "其他",
"weight": 0
}
},
{
"type": "staff",
"id": "zhangsan",
"attributes": {
"name": "zhangsan",
"english_name": null,
"organization": "140 开发"
}
},
{
"type": "course",
"id": "7fe3fc387c9f11ef87ba2e9fa8feabe4",
"attributes": {
"is_shared": 0,
"media_type": 1,
"title": "素材1",
"content": "",
"cover": "",
"duration": 30,
"complete_percent": 100,
"target_users": null,
"created_at": "2024-09-27 15:09:55",
"video_link": null,
"source_from": 1
},
"links": {
"platform": "https://km.lexiangla.com/classes/510465627e1911ef9e48ce2e0a52a765/courses/7fe3fc387c9f11ef87ba2e9fa8feabe4?type=1"
},
"relationships": {
"lecturers": {
"data": [
{
"type": "lecturer",
"id": "db41bece7ae411efa5508ada8526ebb0"
}
]
},
"passes": {
"data": [
{
"type": "class_course_staff",
"id": 27614
}
]
}
}
},
{
"type": "course",
"id": "470912927e1911ef93c8ce2e0a52a765",
"attributes": {
"is_shared": 0,
"media_type": 6,
"title": "素材2",
"content": "",
"cover": "",
"duration": 30,
"complete_percent": 100,
"target_users": null,
"created_at": "2024-09-29 12:14:10",
"video_link": null,
"source_from": 5
},
"links": {
"platform": "https://km.lexiangla.com/classes/510465627e1911ef9e48ce2e0a52a765/courses/470912927e1911ef93c8ce2e0a52a765?type=1"
},
"relationships": {
"passes": {
"data": [
{
"type": "class_course_staff",
"id": 27609
}
]
}
}
},
{
"type": "course",
"id": "7fea53e47c9f11ef8dc92e9fa8feabe4",
"attributes": {
"is_shared": 0,
"media_type": 0,
"title": "素材3",
"content": "",
"cover": "",
"duration": 189,
"complete_percent": 80,
"target_users": null,
"created_at": "2024-09-27 15:09:55",
"video_link": null,
"source_from": 1
},
"links": {
"platform": "https://km.lexiangla.net/classes/510465627e1911ef9e48ce2e0a52a765/courses/7fea53e47c9f11ef8dc92e9fa8feabe4?type=1"
}
},
{
"type": "course",
"id": "095b0bf47be811ef9c94067e64d07a64",
"attributes": {
"is_shared": 0,
"media_type": 1,
"title": "素材4",
"content": "",
"cover": "",
"duration": 30,
"complete_percent": 100,
"target_users": null,
"created_at": "2024-09-26 17:16:39",
"video_link": null,
"source_from": 1
},
"links": {
"platform": "https://km.lexiangla.net/classes/510465627e1911ef9e48ce2e0a52a765/courses/095b0bf47be811ef9c94067e64d07a64?type=1"
}
},
{
"type": "clazz_chapter",
"id": 24153,
"attributes": {
"name": "第一章",
"sequence": 1
},
"relationships": {
"courses": {
"data": [
{
"type": "course",
"id": "7fe3fc387c9f11ef87ba2e9fa8feabe4"
},
{
"type": "course",
"id": "470912927e1911ef93c8ce2e0a52a765"
}
]
}
}
},
{
"type": "clazz_chapter",
"id": 24154,
"attributes": {
"name": "章节2",
"sequence": 2
},
"relationships": {
"courses": {
"data": [
{
"type": "course",
"id": "7fea53e47c9f11ef8dc92e9fa8feabe4"
},
{
"type": "course",
"id": "095b0bf47be811ef9c94067e64d07a64"
}
]
}
}
},
{
"type": "lecturer",
"id": "db41bece7ae411efa5508ada8526ebb0",
"attributes": {
"status": 1
},
"relationships": {
"staff": {
"data": {
"type": "staff",
"id": "kalpaxu"
}
}
}
},
{
"type": "class_course_staff",
"id": 27614,
"attributes": {
"learn_time": 3469,
"procedure": 100,
"status": 2,
"succeeded_at": "2024-09-29 15:51:01"
}
},
{
"type": "class_course_staff",
"id": 27609,
"attributes": {
"learn_time": 374,
"procedure": 100,
"status": 2,
"succeeded_at": "2024-09-29 12:17:22"
}
}
]
}
参数 | 说明 |
---|---|
data.attributes.title | 开课主题 |
data.attributes.is_chapter_hidden | 是否为无章节课程,1:无章节课程 0:有章节课程 |
data.attributes.is_shelved | 是否为上架状态,1:已上架 0:未上架 |
data.attributes.cover_img | 课程封面 |
data.attributes.required_privilege_type | 必修学员范围。0:所有人; 1:部分人; 2.无; |
data.attributes.optional_privilege_type | 选修学员范围。0:所有人; 1:部分人; 2.无; |
data.attributes.description | 课程介绍 |
data.attributes.recommended_at | 若课程被管理员设置为推荐课程,则此处值为设置时间,否则为null |
data.attributes.category_id | 开课分类id |
data.attributes.is_required | 属性:是否为必修,1为必修 |
data.attributes.course_count | 子课程数 |
data.attributes.comment_count | 评论数 |
data.attributes.participants_count | 已学人数 |
data.attributes.created_at | 创建时间 |
data.attributes.edited_at | 更新时间 |
data.attributes.app_source_type | 应用来源:clazz ,课堂;roadmap ,项目 |
links.platform | 课程详情页链接 |
links.manager | 课程管理页链接 |
data.attributes.relationships.owner | 课程创建者 |
data.relationships.tags | 关联标签 |
data.relationships.courses | 素材信息 |
data.relationships.chapters | 章节信息 |
data.relationships.privilege | 部分人可见关联的组织架构对象,包含required_privilege和选修optional_privilege中 staff,department,team,contact_tag 所有对象 |
data.relationships.required_privilege | 关联的必修组织架构信息,仅当 required_privilege_type 为1时 返回多个 staff,department,team,contact_tag 对象 |
data.relationships.optional_privilege | 关联的选修组织架构信息,仅当 optional_privilege_type 为1时 返回多个 staff,department,team,contact_tag 对象 |
data.relationships.team | 关联的k吧 |
data.included.relationships.lecturer | 素材关联的讲师信息 |
data.included.relationships.staff | 讲师关联的成员信息 |
data.included.staff.organization | 课程所属部门 |
data.included.class_course_staff.learn_time | 子课程学习时间(单位s:秒) |
data.included.class_course_staff.learn_time | 子课程学习进度百分比 |
data.included.class_course_staff.learn_time.status | 子课程学习状态,0:初始化,1:学习中;2:已完成 |
data.included.class_course_staff.succeeded_at | 子课程学习完成时间 |