PUT course/…/…/…

Updates the drill content of an existing course.

It adds a new drill to a course, or moves a drill to a specific position within the course. When adding a new drill to a course, a position for the new drill can also be specified. If omitted, the drill will be added as the last drill in the course.

Resource URL

https://www.drillster.com/api/2.1.1/course/{course_id}/{drill_id}

or

https://www.drillster.com/api/2.1.1/course/{course_id}/{drill_id}/{position}

Parameters

Field Type Description
course_id
required
String The unique ID for the course.
drill_id
required
String The unique ID for the drill being added or moved.
position
optional
Integer The zero-based position where the drill needs to be inserted or moved to. If this value is omitted new drills are appended at the end.

If a PUT request has no body (i.e. the body is empty), it is still mandatory to include a Content-Length header (i.e. Content-Length: 0). Not all HTTP clients do this automatically. For more information, please see RFC 2616.

Response

A 2.1.1 Course object reflecting the changes.

Error responses

The following error situations are possible:

ID Response code Description
course_missing 400 (Bad request) No course was specified
course_unknown 404 (Not found) Unknown course
drill_already_in_course 400 (Bad request) The drill is already in the course
drill_not_released 400 (Bad request) The drill is not released
drill_unknown 404 (Not found) Unknown drill
group_not_accessible 403 (Forbidden) The course is part of a group and the calling account does not have permission to modify the group
no_access 403 (Forbidden) You are not authorized to modify this course
position_invalid 400 (Bad request) An invalid position for the drill was specified
subject_mismatch 400 (Bad request) The subject of the course and drill don't match