Course Questions API

for owner and author

GET /api/v1/courses/:course_id/course_questions

Parameters

Name Description
id id
course_id id of the course

Request

Headers

Accept: application/json
X-Api-Token: wSaUJ9GUxVv39x2WgBwaRwkb76WdKRBJJg
X-Api-Email: user-367@example.com

Route

GET /api/v1/courses/198/course_questions?id=16

Query Parameters

id: 16

cURL

curl "http://localhost:3000/api/v1/courses/198/course_questions?id=16" -X GET \
	-H "Accept: application/json" \
	-H "X-Api-Token: wSaUJ9GUxVv39x2WgBwaRwkb76WdKRBJJg" \
	-H "X-Api-Email: user-367@example.com" \
	-H "Content-Type: application/json" \
	-H "Host: school.worksonmy.computer"

Response

Headers

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

Status

200 OK

Body

{
  "course_questions": [
    {
      "created_at": "2019-10-31T22:04:06Z",
      "question": "Course Question?",
      "answer": "Course Answer",
      "course_id": 198,
      "position": 1,
      "is_published": true,
      "id": 16,
      "meta": {
        "class": "coursequestion",
        "url": "/courses/198/course_questions/16",
        "name": "16",
        "description": "",
        "image_url": null
      }
    }
  ],
  "meta": {
    "total": 1,
    "page": 1,
    "from": 1,
    "to": 1,
    "per": 25,
    "number_of_pages": 1,
    "query": {
      "course_id": "198"
    }
  }
}

Request

Headers

Accept: application/json
X-Api-Token: wSaUJ9GUxVv39x2WgBwaRwkb76WdKRBJJg
X-Api-Email: user-367@example.com

Route

GET /api/v1/courses/198/course_questions?id=16

Query Parameters

id: 16

cURL

curl "http://localhost:3000/api/v1/courses/198/course_questions?id=16" -X GET \
	-H "Accept: application/json" \
	-H "X-Api-Token: wSaUJ9GUxVv39x2WgBwaRwkb76WdKRBJJg" \
	-H "X-Api-Email: user-367@example.com" \
	-H "Content-Type: application/json" \
	-H "Host: school.worksonmy.computer"

Response

Headers

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

Status

200 OK

Body

{
  "course_questions": [
    {
      "created_at": "2019-10-31T22:04:06Z",
      "question": "Course Question?",
      "answer": "Course Answer",
      "course_id": 198,
      "position": 1,
      "is_published": true,
      "id": 16,
      "meta": {
        "class": "coursequestion",
        "url": "/courses/198/course_questions/16",
        "name": "16",
        "description": "",
        "image_url": null
      }
    }
  ],
  "meta": {
    "total": 1,
    "page": 1,
    "from": 1,
    "to": 1,
    "per": 25,
    "number_of_pages": 1,
    "query": {
      "course_id": "198"
    }
  }
}