Pages API

returns 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: csiXQQ1EToy86ygTsxXRvJaoeMN2-DGVVg
X-Api-Email: user-113@example.com

Route

GET /api/v1/pages/1199?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/1199?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: csiXQQ1EToy86ygTsxXRvJaoeMN2-DGVVg" \
	-H "X-Api-Email: user-113@example.com" \
	-H "Content-Type: application/json" \
	-H "Host: school.worksonmy.computer"

Response

Headers

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

Status

200 OK

Body

{
  "created_at": "2019-10-31T22:02:20Z",
  "draft": {
    "created_at": "2019-10-31T22:02:20Z",
    "draft": null,
    "friendly_url": "63313226397c45849e1493d6bbcb7b13",
    "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": 1200,
    "skip_block_loop_wrapper": null,
    "custom_head_code": null,
    "css_properties": {
    },
    "draft_of_id": 1199,
    "updated_at": "2019-10-31T22:02:20Z",
    "compatibles": {
    },
    "meta": {
      "class": "page",
      "url": null,
      "name": "1200",
      "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": 1200,
        "course_id": null,
        "is_hidden": false,
        "id": 3353,
        "custom_relations_data": {
        },
        "css_properties": {
        },
        "toggles": {
        },
        "meta": {
          "class": "block",
          "url": null,
          "name": "3353",
          "description": "",
          "image_url": null
        }
      }
    ]
  },
  "friendly_url": "63313226397c45849e1493d6bbcb7b13",
  "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": 1199,
  "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": "1199",
    "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": 1199,
      "course_id": null,
      "is_hidden": false,
      "id": 3352,
      "custom_relations_data": {
      },
      "css_properties": {
      },
      "toggles": {
      },
      "meta": {
        "class": "block",
        "url": null,
        "name": "3352",
        "description": "",
        "image_url": null
      }
    }
  ]
}