Get Course Info
This endpoint retrieves a specific course information; you can also emulate a specific community user using the user
parameter.
info
The view
param with values edit
and dashboard
needs creator or manager role.
The user making the request must be the creator or a manager although the user
parameter will be passed to emulate a
specific user.
info
If course privacy
is:
- empty string (draft mode): only creator and managers can see the course;
open
: anyone can see and join the course;private
: only invited members can see the course; non-members will see the lock screen (only basic data: Course Minimal);secret
: only invited members can see the course.
info
This operation requires authentication if content_availability
community option is false.
HTTP Request
GET /api/v2/course/{id}/
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | A unique integer value identifying this course |
view | query | string | false | Recover the course data for a specific view |
user | body | integer | false | A unique integer value identifying the user; required creator or manager role |
Enumerated Values
Parameter | Value | Description |
---|---|---|
» view | user | Default value; recover the data of a course for a generic user (sections empty and lessons in draft mode will be hidden) |
» view | edit | Like user but include any section and lesson; user must be a creator or manager of the course |
» view | dashboard | Recover useful data for the dashboard; user must be a creator or manager of the course |
Example Request
- JavaScript
- Bash
const headers = {
'Accept':'application/json',
'Authorization': 'Bearer {access_token}'
};
fetch('/api/v2/course/{id}/',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X GET /api/v2/course/{id}/ \
-H 'Accept: application/json'
-H 'Authorization: Bearer {access_token}'
Responses
view = user
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Response status code | Course User Detail |
view = edit
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Response status code | Course Detail |
view = dashboard
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Response status code | Course Dashboard |