Attachments API

can update a graded quiz when supported by school

PATCH /api/v1/courses/:course_id/lectures/:lecture_id/attachments/:attachment_id

Parameters

Name Description
attachable_id the id of the object this should be attached to (Lecture/Course)
attachable_type type of the object (Lecture/Course)
file a filepicker file blob {url:, filename:, mimetype:, size:, key:,container:}
text the contents of a text/html attachment

Request

Headers

Accept: application/json
X-Api-Token: pkuKpaxir-QrZ34shCfEvjXSt2VNbHsMyA
X-Api-Email: user-334@example.com

Route

PATCH /api/v1/courses/132/lectures/35/attachments/20

Body

{"attachable_id":35,"attachable_type":"Lecture","data":{"graded":true,"answerKey":{"answer-1":["Correct"],"answer-2":["Correct"]}},"schema":{"type":"object","required":["answer-1","answer-2"],"properties":{"answer-1":{"enum":["Correct","Wrong1","Wrong2"],"type":"string","title":"First Question","description":"single"},"answer-2":{"enum":["Correct","Wrong1","Wrong2"],"type":"string","title":"Question 2","description":"single"}}}}

cURL

curl "http://localhost:3000/api/v1/courses/132/lectures/35/attachments/20" -d '{"attachable_id":35,"attachable_type":"Lecture","data":{"graded":true,"answerKey":{"answer-1":["Correct"],"answer-2":["Correct"]}},"schema":{"type":"object","required":["answer-1","answer-2"],"properties":{"answer-1":{"enum":["Correct","Wrong1","Wrong2"],"type":"string","title":"First Question","description":"single"},"answer-2":{"enum":["Correct","Wrong1","Wrong2"],"type":"string","title":"Question 2","description":"single"}}}}' -X PATCH \
	-H "Accept: application/json" \
	-H "X-Api-Token: pkuKpaxir-QrZ34shCfEvjXSt2VNbHsMyA" \
	-H "X-Api-Email: user-334@example.com" \
	-H "Content-Type: application/json" \
	-H "Host: school.worksonmy.computer"

Response

Status

204 No Content