Pages API

does not return the draft with the page

GET /api/v1/pages/:id

Parameters

Name Description
id id
friendly_url text, url for page
show_footer show page footer, boolean
show_header show header, boolean
is_published show to public?
title page title
content page content(HTML)
template template
course_id course_id

Request

Headers

Accept: application/json
X-Api-Token: B-G9TiA8vvkr1HcFWjzTZ9Zft6nrn3YdDw
X-Api-Email: user-111@example.com

Route

GET /api/v1/pages/1194?friendly_url=page_slug&show_footer=false&show_header=true&title=a+page+title&content=%3Cdiv%3Epagecontent%3C%2Fdiv%3E

Query Parameters

friendly_url: page_slug
show_footer: false
show_header: true
title: a page title
content: <div>pagecontent</div>

cURL

curl "http://localhost:3000/api/v1/pages/1194?friendly_url=page_slug&show_footer=false&show_header=true&title=a+page+title&content=%3Cdiv%3Epagecontent%3C%2Fdiv%3E" -X GET \
	-H "Accept: application/json" \
	-H "X-Api-Token: B-G9TiA8vvkr1HcFWjzTZ9Zft6nrn3YdDw" \
	-H "X-Api-Email: user-111@example.com" \
	-H "Content-Type: application/json" \
	-H "Host: school.worksonmy.computer"

Response

Headers

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

Status

200 OK

Body

{
  "created_at": "2019-10-31T22:02:20Z",
  "draft": null,
  "friendly_url": "18e2329c02399af5f86abc63c0ae6c8a",
  "title": "Page Title",
  "meta_description": null,
  "feature": "school_pages",
  "content": null,
  "show_header": true,
  "show_footer": true,
  "show_nav_background_color": null,
  "is_published": true,
  "blank_page_template": false,
  "published_at": null,
  "template": "rich_text",
  "course_id": null,
  "id": 1194,
  "skip_block_loop_wrapper": null,
  "custom_head_code": null,
  "css_properties": {
  },
  "draft_of_id": null,
  "updated_at": "2019-10-31T22:02:20Z",
  "compatibles": {
  },
  "meta": {
    "class": "page",
    "url": null,
    "name": "1194",
    "description": "Page Title",
    "image_url": null
  },
  "blocks": [
    {
      "created_at": "2019-10-31T22:02:20Z",
      "are_dependencies_met": true,
      "partial": "rich_text",
      "position": 1,
      "data": {
        "body": "Rich Text Page body"
      },
      "page_id": 1194,
      "course_id": null,
      "is_hidden": false,
      "id": 3346,
      "custom_relations_data": {
      },
      "css_properties": {
      },
      "toggles": {
      },
      "meta": {
        "class": "block",
        "url": null,
        "name": "3346",
        "description": "",
        "image_url": null
      }
    }
  ]
}