Creating Individual attachments on a lecture
POST /api/v1/courses/:course_id/lectures/:lecture_id/attachments/
Parameters
| Name |
Description |
|
id
|
id
|
|
course_id
|
id of the course
|
|
lecture_id
|
id of the lecture
|
|
downloadable
|
is it downloadable (doesn't apply to disqus or html attachments)
|
|
embeddable
|
is it embeddable (doesn't apply to disqus or html attachments)
|
|
kind
|
a parameter
|
|
text
|
a parameter
|
|
source
|
a parameter
|
Request
Headers
Route
POST /api/v1/courses/237/lectures/55/attachments/
Body
{"id":53,"downloadable":false,"kind":"html","text":"hooha","source":"user"}
cURL
curl "http://localhost:3000/api/v1/courses/237/lectures/55/attachments/" -d '{"id":53,"downloadable":false,"kind":"html","text":"hooha","source":"user"}' -X POST \
-H "Accept: application/json" \
-H "X-Api-Token: sAAQf3_v2_UhhmMkiTKUdnGXiJs-skqgrg" \
-H "X-Api-Email: user-503@example.com" \
-H "Content-Type: application/json" \
-H "Host: school.worksonmy.computer"
Response
Headers
Status
201 Created
Body
{
"created_at": "2019-10-31T22:05:13Z",
"code_syntax": null,
"content_type": null,
"audio_type": null,
"should_be_uploaded_to_wistia?": false,
"data": null,
"schema": null,
"text_constructor": null,
"full_url": "http://school.worksonmy.computer/courses/237/lectures/55",
"url": null,
"host_id": null,
"source": "user",
"kind": "html",
"name": null,
"host": null,
"position": 1,
"attachable_id": 55,
"is_published": true,
"downloadable": false,
"text": "hooha",
"attachable_type": "Lecture",
"thumbnail_url": null,
"meta": {
"class": "attachment",
"url": null,
"name": null,
"description": "",
"image_url": null
},
"embeddable": false,
"id": 54,
"plain_text_html": "hooha"
}