# 学习地图

# 已发布学习地图列表

# 接口调用说明:

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

# 参数说明:

参数 是否必须 默认值 说明
sort created_at 排序参数,支持按学习地图的created_at排序

# SDK封装方法使用示例:

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

# 响应document

# 200 OK 状态码
{
    "data": [
        {
            "type": "roadmap",
            "id": 5,
            "attributes": {
                "id": 5,
                "title": "学习地图1",
                "to_staff_count": 1,
                "passed_staff_count": 0,
                "created_at": "2019-07-19 11:05:07"
            }
        },
        {
            "type": "roadmap",
            "id": 7,
            "attributes": {
                "id": 7,
                "title": "闯关类学习地图",
                "to_staff_count": 12,
                "passed_staff_count": 1,
                "created_at": "2019-07-19 12:02:35"
            }
        },
        {
            "type": "roadmap",
            "id": 8,
            "attributes": {
                "id": 8,
                "title": "包含考试的学习地图",
                "to_staff_count": 12,
                "passed_staff_count": 1,
                "created_at": "2019-07-25 14:27:30"
            }
        }
    ],
    "links": {
        "first": "https://lxapi.lexiangla.com/cgi-bin/v1/roadmaps?state=181aab15-570b-47cb-a810-cca20c3d51cd&downloadable=1&sort=-created_at&per_page=3&page=1",
        "last": "https://lxapi.lexiangla.com/cgi-bin/v1/roadmaps?state=181aab15-570b-47cb-a810-cca20c3d51cd&downloadable=1&sort=-created_at&per_page=3&page=7",
        "prev": null,
        "next": "https://lxapi.lexiangla.com/cgi-bin/v1/roadmaps?state=181aab15-570b-47cb-a810-cca20c3d51cd&downloadable=1&sort=-created_at&per_page=3&page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 7,
        "path": "https://lxapi.lexiangla.com/cgi-bin/v1/roadmaps",
        "per_page": 3,
        "to": 3,
        "total": 21
    }
}

# 参数说明:

参数 说明
title 开课主题
to_staff_count 应完成人数
passed_staff_count 已完成人数
created_at 创建时间

# 学习地图学习记录

# 接口调用说明:

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

# 参数说明:

参数 是否必须 默认值 说明
id 要获取已学员工列表的学习地图ID
sort id 排序参数,支持按staff的id排序
status 筛选参数,学习地图通关状态

# SDK封装方法使用示例:

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

# 响应document

# 200 OK 状态码
{
    "data": [
        {
            "type": "staff",
            "id": "viky",
            "attributes": {
                "name": "张三",
                "english_name": null,
                "organization": "方华科技(深圳)有限公司",
                "started_at": "2019-09-24 18:29:29",
                "ended_at": "2019-09-24 18:29:30",
                "status": 2
            }
        },
        {
            "type": "staff",
            "id": "viky181",
            "attributes": {
                "name": "Viky181",
                "english_name": null,
                "organization": "研发部 ",
                "started_at": null,
                "ended_at": null,
                "status": 0
            }
        },
        {
            "type": "staff",
            "id": "wynne",
            "attributes": {
                "name": "李四",
                "english_name": null,
                "organization": "方华科技(深圳)有限公司",
                "started_at": null,
                "ended_at": null,
                "status": 0
            }
        }
    ],
    "links": {
        "first": "https://lxapi.lexiangla.com/cgi-bin/v1/roadmaps/25/staffs?state=181aab15-570b-47cb-a810-cca20c3d51cd&downloadable=1&per_page=3&page=1",
        "last": "https://lxapi.lexiangla.com/cgi-bin/v1/roadmaps/25/staffs?state=181aab15-570b-47cb-a810-cca20c3d51cd&downloadable=1&per_page=3&page=4",
        "prev": "https://lxapi.lexiangla.com/cgi-bin/v1/roadmaps/25/staffs?state=181aab15-570b-47cb-a810-cca20c3d51cd&downloadable=1&per_page=3&page=2",
        "next": "https://lxapi.lexiangla.com/cgi-bin/v1/roadmaps/25/staffs?state=181aab15-570b-47cb-a810-cca20c3d51cd&downloadable=1&per_page=3&page=4"
    },
    "meta": {
        "current_page": 3,
        "from": 7,
        "last_page": 4,
        "path": "https://lxapi.lexiangla.com/cgi-bin/v1/roadmaps/25/staffs",
        "per_page": 3,
        "to": 9,
        "total": 12
    }
}

# 参数说明:

参数 说明
started_at 开始学习时间
ended_at 结束学习时间
status 通关状态
# 学习地图通关状态
参数 说明
0 未开始
1 通关中
2 已通关
3 通关失败

# 成员学习记录

# 接口调用说明:

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

# 参数说明:

参数 是否必须 默认值 说明
id 员工的企业微信ID
status 筛选参数,学习地图通关状态

# SDK封装方法使用示例:

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

# 响应document

# 200 OK 状态码
{
    "data": [
        {
            "type": "roadmap",
            "id": 5,
            "attributes": {
                "id": 5,
                "title": "学习地图1",
                "started_at": "2019-07-19 11:16:56",
                "ended_at": "2019-07-19 14:43:10",
                "status": 2
            }
        },
        {
            "type": "roadmap",
            "id": 7,
            "attributes": {
                "id": 7,
                "title": "闯关类学习地图",
                "started_at": "2019-07-19 12:03:01",
                "ended_at": "2019-07-19 14:43:10",
                "status": 2
            }
        },
        {
            "type": "roadmap",
            "id": 8,
            "attributes": {
                "id": 8,
                "title": "包含考试的学习地图",
                "started_at": "2019-07-25 14:27:52",
                "ended_at": "2019-07-31 16:29:21",
                "status": 2
            }
        }
    ],
    "links": {
        "first": "https://lxapi.lexiangla.com/cgi-bin/v1/staffs/viky/roadmaps?state=181aab15-570b-47cb-a810-cca20c3d51cd&downloadable=1&per_page=3&page=1",
        "last": "https://lxapi.lexiangla.com/cgi-bin/v1/staffs/viky/roadmaps?state=181aab15-570b-47cb-a810-cca20c3d51cd&downloadable=1&per_page=3&page=8",
        "prev": null,
        "next": "https://lxapi.lexiangla.com/cgi-bin/v1/staffs/viky/roadmaps?state=181aab15-570b-47cb-a810-cca20c3d51cd&downloadable=1&per_page=3&page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 8,
        "path": "https://lxapi.lexiangla.com/cgi-bin/v1/staffs/viky/roadmaps",
        "per_page": 3,
        "to": 3,
        "total": 22
    }
}

# 参数说明:

同上。