Public API
Content integrations
Downloading courses
Downloading courses
To query courses use following url with valid access token in Authorization header:
GET https://masterplan.com/public_api/courses?page=1&size=10
Required query parameters:
| Parameter | Description |
|---|---|
| page | Page number for pagination. Has to be greater then 1. |
| size | Number of courses to retrieve per page. Has to be greater then 1 and less then 501. |
Example curl command for obtaining access token:
curl -L -X GET https://masterplan.com/public_api/courses?page=1&size=10 \
-H 'Authorization: Bearer ACCESS_TOKEN'
Example response
{
"meta": {
"next_page_url": "https://masterplan.com/public_api/courses?page=1&size=10",
"page": 2,
"prev_page_url": "https://masterplan.com/public_api/courses?page=3&size=10",
"size": 10,
"total": 100
},
"courses": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"course_type": "topic",
"versions": [
{
"lang": "en",
"title": "Course 1",
"description": "This is the first course.",
"thumbnail_url": "https://masterplan.com/images/1.jpg",
"duration": 120,
"launch_link": {
"url": "https://masterplan.com/launch/course_id=550e8400-e29b-41d4-a716-446655440000&...",
"http_method": "GET"
}
},
{
"lang": "es",
"title": "Curso 1",
"description": "Este es el primer curso.",
"thumbnail_url": "https://masterplan.com/images/1.jpg",
"duration": 140,
"launch_link": {
"url": "https://masterplan.com/launch/course_id=550e8400-e29b-41d4-a716-446655440000&...",
"http_method": "GET"
}
}
]
},
{
"id": "660e8400-e29b-41d4-a716-446655443321",
"course_type": "learnpath",
"versions": [
{
"lang": "en",
"title": "Course 2",
"description": "This is the second course.",
"thumbnail_url": "https://masterplan.com/images/2.jpg",
"duration": 100,
"launch_link": {
"url": "https://masterplan.com/launch/course_id=660e8400-e29b-41d4-a716-446655443321&...",
"http_method": "GET"
}
}
]
}
]
}
Response structure contains metadata information along with list of a course objects.
Course structure:
| Name | Type | Description |
|---|---|---|
| id | string[uuid] | Unique identifier of the course in Masterplan |
| course_type | string[topic, learnpath] | Type of the course |
| versions | list | List of localized versions of the course. |
Version schema:
| Name | Type | Description |
|---|---|---|
| lang | string[uuid] | Language code |
| title | string[max 1000 chars.] | Title of version |
| description | string[max 1000 chars.] | Description of version |
| thumbnail_url | string[url] | url to the thumbnail image of the version |
| duration | integer | Duration of the version in seconds |
| launch_link | object | Object that includes details about how to launch the version for learner |
LaunchLink schema:
| Name | Type | Description |
|---|---|---|
| url | string[url] | Url that should be used to launch the version |
| title | string[GET,POST] | HTTP method to use when launching the version |
Metadata schema:
| Name | Type | Description |
|---|---|---|
| page | integer | Currently queried page |
| size | integer | Currently queried page size |
| total | integer | Total number of all available results |
| next_page_url | string[url] or null | URL linking to the next page if available |
| prev_page_url | string[url] or null | URL linking to the previous page if available |