课堂

已开课程列表

接口调用说明:

GET https://lxapi.lexiangla.com/cgi-bin/v1/classes

参数说明:

参数 是否必须 默认值 说明
sort id 排序参数,支持按课堂的created_at排序

SDK封装方法使用示例:

$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->get('classes');

响应document

200 OK 状态码
{
    "data": [
        {
            "type": "clazz",
            "id": "7f1bbe66beed11e7aade080027854b0f",
            "attributes": {
                "title": "乐享课堂1",
                "is_required": 0,
                "comment_count": 0,
                "participants_count": 2,
                "created_at": "2019-06-18 18:14:50",
                "updated_at": "2019-06-19 18:14:50"
            },
            "relationships": {
                "category": {
                    "data": {
                        "type": "category",
                        "id": "c165a4f49d1311e7bc4f080027854b0f"
                    }
                },
                "owner": {
                    "data": {
                        "type": "staff",
                        "id": "ThreeZhang"
                    }
                }
            }
        },
        {
            "type": "clazz",
            "id": "366faef0992411e7ba59080027854b0f",
            "attributes": {
                "title": "乐享课堂2",
                "is_required": 0,
                "comment_count": 0,
                "participants_count": 1,
                "created_at": "2019-06-14 16:10:46",
                "updated_at": "2019-06-19 12:35:39"
            },
            "relationships": {
                 "category": {
                     "data": {
                         "type": "category",
                         "id": "c165a4f49d1311e7bc4f080027854b0f"
                     }
                 },
                 "owner": {
                     "data": {
                         "type": "staff",
                         "id": "FourLee"
                     }
                 }
            }
        }
    ],
    "links": {
        "first": "https://lxapi.lexiangla.com/cgi-bin/v1/classes?page=1",
        "last": "https://lxapi.lexiangla.com/cgi-bin/v1/classes?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": 2,
        "total": 2
    },
    "included": [
        {
            "type": "category",
            "id": "c165a4f49d1311e7bc4f080027854b0f",
            "attributes": {
                "name": "其他"
            }
        },
        {
            "type": "staff",
            "id": "ThreeZhang",
            "attributes": {
                "name": "张三",
                "english_name": "ThreeZhang"
            }
        },
        {
            "type": "staff",
            "id": "FourLee",
            "attributes": {
                "name": "李四",
                "english_name": "FourLee"
            }
        }        
    ]
}

参数说明:

参数 说明
title 开课主题
is_required 属性:是否为必修,1为必修
comment_count 评论数量
participants_count 已学人数
created_at 创建时间

课程学习记录

接口调用说明:

GET https://lxapi.lexiangla.com/cgi-bin/v1/classes/{id}/staffs

参数说明:

参数 是否必须 默认值 说明
sort id 排序参数,支持按staff的id排序
id 要获取已学员工列表的课堂ID

SDK封装方法使用示例:

$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->get('classes/7f1bbe66beed11e7aade080027854b0f/staffs');

响应document

200 OK 状态码
{
    "data": [
        {
            "type": "staff",
            "id": "ThreeZhang",
            "attributes": {
                "name": "张三",
                "english_name": "ThreeZhang",
                "organization": "开发组",
                "learn_time": 100,
                "start_learn_at": "2019-06-19 10:54:31"
            }
        },
        {
            "type": "staff",
            "id": "FourLee",
            "attributes": {
                "name": "李四",
                "english_name": "FourLee",
                "organization": "产品组",
                "learn_time": 0,
                "start_learn_at": "2019-06-19 17:57:34"
            }
        }
    ],
    "links": {
        "first": "https://lxapi.lexiangla.com/cgi-bin/v1/classes/7f1bbe66beed11e7aade080027854b0f/staffs?page=1",
        "last": "https://lxapi.lexiangla.com/cgi-bin/v1/classes/7f1bbe66beed11e7aade080027854b0f/staffs?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "https://lxapi.lexiangla.com/cgi-bin/v1/classes/7f1bbe66beed11e7aade080027854b0f/staffs",
        "per_page": 20,
        "to": 2,
        "total": 2
    }
}

参数说明:

参数 说明
title 开课主题
is_required 属性:是否为必修,1为必修
start_learn_at 开始学习时间
learn_time 学习时长(单位:s)

成员学习记录

接口调用说明:

GET https://lxapi.lexiangla.com/cgi-bin/v1/staffs/{id}/classes

参数说明:

参数 是否必须 默认值 说明
id 员工的企业微信ID

SDK封装方法使用示例:

$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->get('staffs/ThreeZhang/classes');

响应document

200 OK 状态码
{
    "data": [
        {
            "type": "clazz",
            "id": "15daacfe334b11e981af10e7c61c70fc",
            "attributes": {
                "title": "测试乐享课堂",
                "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"
            }
        },
        {
            "type": "clazz",
            "id": "366faef0992411e7ba59080027854b0f",
            "attributes": {
                "title": "乐享课堂1",
                "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,
                "start_learn_at": "2017-09-20 17:57:09"
            }
        },
        {
            "type": "clazz",
            "id": "7f1bbe66beed11e7aade080027854b0f",
            "attributes": {
                "title": "乐享课堂2",
                "is_required": 0,
                "comment_count": 0,
                "created_at": "2019-06-14 16:10:46",
                "updated_at": "2019-06-19 12:35:39",
                "learn_time": 100,
                "start_learn_at": "2019-06-19 10:54:31"
            }
        }
    ],
    "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
    }
}

参数说明:

参数 说明
title 开课主题
is_required 属性:是否为必修,1为必修
comment_count 评论数量
start_learn_at 开始学习时间
learn_time 学习时长(单位:s)