only creates one comment per lecture
POST /api/v1/attachments/
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
|
|
text_constructor_attributes
|
text constructor attributes
|
|
kind
|
the attachment kind
|
|
embeddable
|
the embeddable state of attachment
|
Request
Headers
Route
POST /api/v1/attachments/
Body
{"attachable_id":47,"attachable_type":"Lecture","kind":"native_comments","embeddable":true}
cURL
curl "http://localhost:3000/api/v1/attachments/" -d '{"attachable_id":47,"attachable_type":"Lecture","kind":"native_comments","embeddable":true}' -X POST \
-H "Accept: application/json" \
-H "X-Api-Token: Q9xnWXjyuTS6zzY2ESC3y5_nQyQHrvcrHA" \
-H "X-Api-Email: user-354@example.com" \
-H "Content-Type: application/json" \
-H "Host: school.worksonmy.computer"
Response
Headers
Status
201 Created
Body
{
"created_at": "2019-10-31T22:01:15Z",
"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/144/lectures/47",
"url": null,
"host_id": null,
"source": "user",
"kind": "native_comments",
"name": null,
"host": null,
"position": 1,
"attachable_id": 47,
"is_published": true,
"downloadable": false,
"text": null,
"attachable_type": "Lecture",
"thumbnail_url": null,
"meta": {
"class": "attachment",
"url": null,
"name": null,
"description": "",
"image_url": null
},
"embeddable": true,
"id": 29,
"plain_text_html": ""
}
Request
Headers
Route
POST /api/v1/attachments/
Body
{"attachable_id":47,"attachable_type":"Lecture","kind":"native_comments","embeddable":true}
cURL
curl "http://localhost:3000/api/v1/attachments/" -d '{"attachable_id":47,"attachable_type":"Lecture","kind":"native_comments","embeddable":true}' -X POST \
-H "Accept: application/json" \
-H "X-Api-Token: Q9xnWXjyuTS6zzY2ESC3y5_nQyQHrvcrHA" \
-H "X-Api-Email: user-354@example.com" \
-H "Content-Type: application/json" \
-H "Host: school.worksonmy.computer"
Response
Headers
Status
201 Created
Body
{
"created_at": "2019-10-31T22:01:15Z",
"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/144/lectures/47",
"url": null,
"host_id": null,
"source": "user",
"kind": "native_comments",
"name": null,
"host": null,
"position": 1,
"attachable_id": 47,
"is_published": true,
"downloadable": false,
"text": null,
"attachable_type": "Lecture",
"thumbnail_url": null,
"meta": {
"class": "attachment",
"url": null,
"name": null,
"description": "",
"image_url": null
},
"embeddable": true,
"id": 29,
"plain_text_html": ""
}