Attach a file to a study guide
POST/study-guides/:study_guide_id/files/:file_id
Links an already-uploaded file to a study guide. The file must
be owned by the viewer (files.user_id == JWT viewer) and in
status = 'complete' with no deletion in progress.
Authorization: only the file owner can attach. A user who does not own the file gets 403 (regardless of whether they own the guide -- the rule is "you can only put your own files on guides", to prevent linking other users' private uploads).
409 on duplicate -- the same (file_id, study_guide_id) pair
is already attached.
Request
Responses
- 201
- 400
- 401
- 403
- 404
- 409
- 500
File attached.
Bad request
Unauthorized
Forbidden
Not found
Conflict with current resource state
Internal server error