POST drills/upload

Uploads a new drill from a file.

A file may be uploaded as a multipart POST request. Currently supported formats are:

  • Drilldown format
  • Comma separated values (CSV) in specific Drillster layout
  • WRTS 1.0 XML
  • WRTS 2.0 XML
  • Hot Potatoes JQuiz (.jqz)
  • Moodle Quiz XML

It is also possible to upload the file contents as a string using a regular POST request. In that case, supply the file contents in a parameter named content and do not supply a multipart file upload. If a content field is used, the optional extension parameter may also be used to give the parser some hints as to what file type is being uploaded.

Resource URL

https://www.drillster.com/api/2.1.1/drills/upload

Parameters

Field Type Description
file Multipart file The file to be uploaded.

Either a file or content field is required.
content String The upload contents as a string.

Either a file or content field is required.
extension
optional
String An optional file extension, such as txt or xml to help the parser decide what file type is being uploaded.

This parameter should only be used if a content parameter is being submitted, not for actual file uploads. If no extension is provided the endpoint will try to guess the file format based upon the content.
validateOnly
optional
Boolean Whether to not create a new drill, but only perform the validation checks. The default value is false.

If validateOnly is set to true, the returned UploadedDrill will not contain a drill ID.

Response

A 2.1.1 UploadedDrill object, containing the drill details plus an optional list of warnings encountered during the import process.

Error responses

The following error situations are possible:

ID Response code Description
file_contents_problem 400 (Bad request) There was an issue with the contents of the uploaded file. See explanation for details.
file_issue 400 (Bad request) There was an issue with the uploaded file. See explanation for details.
invalid_file 400 (Bad request) The uploaded file was invalid. See explanation for details.
limit_reached 400 (Bad request) The storage limit for this account has been reached.
missing_file 400 (Bad request) No file was provided.