Course Questions API

Creating Course Questions

POST /api/v1/courses/:course_id/course_questions/

Parameters

Name Description
id id
course_id id of the course
question A question
answer An answer

Request

Headers

Accept: application/json
X-Api-Token: xFZscziMNYrjd9kXh_RzkjQCSUVtsbUqGw
X-Api-Email: user-359@example.com

Route

POST /api/v1/courses/195/course_questions/

Body

{"id":12,"question":"question","answer":"answer"}

cURL

curl "http://localhost:3000/api/v1/courses/195/course_questions/" -d '{"id":12,"question":"question","answer":"answer"}' -X POST \
	-H "Accept: application/json" \
	-H "X-Api-Token: xFZscziMNYrjd9kXh_RzkjQCSUVtsbUqGw" \
	-H "X-Api-Email: user-359@example.com" \
	-H "Content-Type: application/json" \
	-H "Host: school.worksonmy.computer"

Response

Headers

Content-Type: application/json; charset=utf-8
Content-Length: 255

Status

201 Created

Body

{
  "created_at": "2019-10-31T22:04:02Z",
  "question": "question",
  "answer": "answer",
  "course_id": 195,
  "position": 2,
  "is_published": true,
  "id": 13,
  "meta": {
    "class": "coursequestion",
    "url": "/courses/195/course_questions/13",
    "name": "13",
    "description": "",
    "image_url": null
  }
}