Courses
Create, get, modify, and delete courses.
GET /courses/{wikiid}
Fetch an existing course's information. The assignees, assignee count, and completion information is only included if the user has access to that information.
Route Parameters
- wikiid — Required — integer
-
Identifier for course being edited.
Response
Status: 200 Ok
{ "wikiid": 174, "langid": "en", "namespace": "COURSE", "title": "Machinist - Level 1", "revisionid": 460, "contents_raw": "The introduction course for machinist.", "contents_json": { "type": "doc", "content": [ { "type": "paragraph", "content": [ { "type": "text", "text": "The introduction course for machinist." } ] } ] }, "contents_rendered": "<p>The introduction course for machinist.<\/p>", "can_edit": true, "flags": [], "image": null, "documents": [], "publish_date": 1539241200, "created_date": 1539302493, "modified_date": null, "enabled": 1, "stages": [ { "course_stageid": 72, "docid": 2, "doctype": "guide", "doc_url": "\/Guide\/How+to+Calibrate+WIPS\/2", "orderby": 0, "strictness": "major", "title": "How to Calibrate WIPS", "frequency_quantity": 6, "frequency_unit": "month", "completion": null }, { "course_stageid": 73, "docid": 35, "doctype": "guide", "doc_url": "\/Guide\/CNC+Machine+Operation\/35", "orderby": 1, "strictness": "minor", "title": "CNC Machine Operation", "frequency_quantity": null, "frequency_unit": null, "completion": null }, { "course_stageid": 74, "docid": 37, "doctype": "guide", "doc_url": "\/Guide\/How+to+Set+Up+and+Use+the+Roll+Form+Machine\/37", "orderby": 2, "strictness": null, "title": "How to Set Up and Use the Roll Form Machine", "frequency_quantity": null, "frequency_unit": null, "completion": null } ], "assigneeCount": 18, "assignees": null, "completionPercent": 0, "viewUrl": "\/Courses\/View\/174" }
POST /courses
Create a new course.
Request Body
- title — Required — string
-
Title of course.
- contents — Required — string
-
Description of course.
- publish_date — Optional — integer
-
Unix timestamp for publish date of course.
- enabled — Optional — boolean
-
Toggle for enabling/disabling a course. A disabled course cannot be assigned or completed.
- stages — Optional — array of objects
-
List of stages in a course.
- docid— Required integer. The docid for the stage guide/wiki.
- doctype— Requires enum. Type of document for stage. Either "guide" or "wiki". Currently "guide" is the only supported doctype.
- strictness— Optional enum. Determines what kind of releases invalidate stage completion. "major", "minor" or null.
- frequency_unit— Optional enum. The unit portion of the stage recurrence interval. "day", "week", "month", "year".
- frequency_quantity— Optional integer. Used along with frequency_unit to determine duration of stage recurrence interval.
Response
Status: 201 Created
{ "wikiid": 174, "langid": "en", "namespace": "COURSE", "title": "Machinist - Level 1", "revisionid": 460, "contents_raw": "The introduction course for machinist.", "contents_json": { "type": "doc", "content": [ { "type": "paragraph", "content": [ { "type": "text", "text": "The introduction course for machinist." } ] } ] }, "contents_rendered": "<p>The introduction course for machinist.<\/p>", "can_edit": true, "flags": [], "image": null, "documents": [], "publish_date": 1539241200, "created_date": 1539302493, "modified_date": null, "enabled": 1, "stages": [ { "course_stageid": 72, "docid": 2, "doctype": "guide", "doc_url": "\/Guide\/How+to+Calibrate+WIPS\/2", "orderby": 0, "strictness": "major", "title": "How to Calibrate WIPS", "frequency_quantity": 6, "frequency_unit": "month", "completion": null }, { "course_stageid": 73, "docid": 35, "doctype": "guide", "doc_url": "\/Guide\/CNC+Machine+Operation\/35", "orderby": 1, "strictness": "minor", "title": "CNC Machine Operation", "frequency_quantity": null, "frequency_unit": null, "completion": null }, { "course_stageid": 74, "docid": 37, "doctype": "guide", "doc_url": "\/Guide\/How+to+Set+Up+and+Use+the+Roll+Form+Machine\/37", "orderby": 2, "strictness": null, "title": "How to Set Up and Use the Roll Form Machine", "frequency_quantity": null, "frequency_unit": null, "completion": null } ], "assigneeCount": 18, "assignees": null, "completionPercent": 0, "viewUrl": "\/Courses\/View\/174" }
PATCH /courses/{wikiid}
Edit an existing course.
Route Parameters
- wikiid — Required — integer
-
Identifier for course being edited.
Request Body
- title — Optional — string
-
Title of course.
- contents — Optional — string
-
Description of course.
- publish_date — Optional — integer
-
Unix timestamp for publish date of course.
- enabled — Optional — boolean
-
Toggle for enabling/disabling a course.
- stages — Optional — array of objects
-
List of stages in a course.
- docid— Required integer. The identifier for the stage guide/wiki.
- doctype— Required enum. Type of document for stage. Either "guide" or "wiki". Currently "guide" is the only supported doctype.
- strictness— Optional enum. Determines what kind of releases invalidate stage completion. "major", "minor" or null.
- frequency_unit— Optional enum. The unit portion of the stage recurrence interval. "day", "week", "month", "year".
- frequency_quantity— Optional integer. Used along with frequency_unit to determine duration of stage recurrence interval.
Response
Status: 200 Ok
{ "wikiid": 174, "langid": "en", "namespace": "COURSE", "title": "Machinist - Level 1", "revisionid": 460, "contents_raw": "The introduction course for machinist.", "contents_json": { "type": "doc", "content": [ { "type": "paragraph", "content": [ { "type": "text", "text": "The introduction course for machinist." } ] } ] }, "contents_rendered": "<p>The introduction course for machinist.<\/p>", "can_edit": true, "flags": [], "image": null, "documents": [], "publish_date": 1539241200, "created_date": 1539302493, "modified_date": null, "enabled": 1, "stages": [ { "course_stageid": 72, "docid": 2, "doctype": "guide", "doc_url": "\/Guide\/How+to+Calibrate+WIPS\/2", "orderby": 0, "strictness": "major", "title": "How to Calibrate WIPS", "frequency_quantity": 6, "frequency_unit": "month", "completion": null }, { "course_stageid": 73, "docid": 35, "doctype": "guide", "doc_url": "\/Guide\/CNC+Machine+Operation\/35", "orderby": 1, "strictness": "minor", "title": "CNC Machine Operation", "frequency_quantity": null, "frequency_unit": null, "completion": null }, { "course_stageid": 74, "docid": 37, "doctype": "guide", "doc_url": "\/Guide\/How+to+Set+Up+and+Use+the+Roll+Form+Machine\/37", "orderby": 2, "strictness": null, "title": "How to Set Up and Use the Roll Form Machine", "frequency_quantity": null, "frequency_unit": null, "completion": null } ], "assigneeCount": 18, "assignees": null, "completionPercent": 0, "viewUrl": "\/Courses\/View\/174" }
PATCH /courses/{wikiid}/revert
Revert a course to the last non-deleted revision, or to a specified revision.
Route Parameters
- wikiid — Required — integer
-
Identifier for course being reverted.
Query Parameters
- to_revisionid — Optional — integer
-
Identifier for the target revision to revert to.
Response
Status: 200 Ok
{ "wikiid": 174, "langid": "en", "namespace": "COURSE", "title": "Machinist - Level 1", "revisionid": 460, "contents_raw": "The introduction course for machinist.", "contents_json": { "type": "doc", "content": [ { "type": "paragraph", "content": [ { "type": "text", "text": "The introduction course for machinist." } ] } ] }, "contents_rendered": "<p>The introduction course for machinist.<\/p>", "can_edit": true, "flags": [], "image": null, "documents": [], "publish_date": 1539241200, "created_date": 1539302493, "modified_date": null, "enabled": 1, "stages": [ { "course_stageid": 72, "docid": 2, "doctype": "guide", "doc_url": "\/Guide\/How+to+Calibrate+WIPS\/2", "orderby": 0, "strictness": "major", "title": "How to Calibrate WIPS", "frequency_quantity": 6, "frequency_unit": "month", "completion": null }, { "course_stageid": 73, "docid": 35, "doctype": "guide", "doc_url": "\/Guide\/CNC+Machine+Operation\/35", "orderby": 1, "strictness": "minor", "title": "CNC Machine Operation", "frequency_quantity": null, "frequency_unit": null, "completion": null }, { "course_stageid": 74, "docid": 37, "doctype": "guide", "doc_url": "\/Guide\/How+to+Set+Up+and+Use+the+Roll+Form+Machine\/37", "orderby": 2, "strictness": null, "title": "How to Set Up and Use the Roll Form Machine", "frequency_quantity": null, "frequency_unit": null, "completion": null } ], "assigneeCount": 18, "assignees": null, "completionPercent": 0, "viewUrl": "\/Courses\/View\/174" }
DELETE /courses/{wikiid}
Soft delete a course.
Route Parameters
- wikiid — Required — integer
-
Identifier for course being deleted.
Response
Status: 204 No Content