Pages API

is returned with a draft

POST /api/v1/pages

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
create_with_draft create with a draft

Request

Headers

Accept: application/json
X-Api-Token: SNfaShPeizQL8nrzoHNH_629F9jNwoGsmQ
X-Api-Email: user-61@example.com

Route

POST /api/v1/pages

Body

{"id":1069,"friendly_url":"page_slug","show_footer":false,"show_header":true,"title":"a page title","content":"\u003cdiv\u003epagecontent\u003c/div\u003e","template":"rich_text","create_with_draft":true}

cURL

curl "http://localhost:3000/api/v1/pages" -d '{"id":1069,"friendly_url":"page_slug","show_footer":false,"show_header":true,"title":"a page title","content":"\u003cdiv\u003epagecontent\u003c/div\u003e","template":"rich_text","create_with_draft":true}' -X POST \
	-H "Accept: application/json" \
	-H "X-Api-Token: SNfaShPeizQL8nrzoHNH_629F9jNwoGsmQ" \
	-H "X-Api-Email: user-61@example.com" \
	-H "Content-Type: application/json" \
	-H "Host: school.worksonmy.computer"

Response

Headers

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

Status

201 Created

Body

{
  "created_at": "2019-10-31T22:01:58Z",
  "draft": {
    "created_at": "2019-10-31T22:01:58Z",
    "draft": null,
    "friendly_url": "page_slug",
    "title": "a page title",
    "meta_description": null,
    "feature": "school_pages",
    "content": "<div>pagecontent</div>",
    "show_header": true,
    "show_footer": false,
    "show_nav_background_color": true,
    "is_published": false,
    "blank_page_template": null,
    "published_at": null,
    "template": "rich_text",
    "course_id": null,
    "id": 1071,
    "skip_block_loop_wrapper": null,
    "custom_head_code": null,
    "css_properties": {
    },
    "draft_of_id": 1070,
    "updated_at": "2019-10-31T22:01:58Z",
    "compatibles": {
      "editor": "page_editor"
    },
    "meta": {
      "class": "page",
      "url": null,
      "name": "1071",
      "description": "a page title",
      "image_url": null
    },
    "blocks": [
      {
        "created_at": "2019-10-31T22:01:58Z",
        "are_dependencies_met": true,
        "partial": "rich_text",
        "position": 1,
        "data": {
          "body": "<div>pagecontent</div>"
        },
        "page_id": 1071,
        "course_id": null,
        "is_hidden": false,
        "id": 3133,
        "custom_relations_data": {
        },
        "css_properties": {
        },
        "toggles": {
        },
        "meta": {
          "class": "block",
          "url": null,
          "name": "3133",
          "description": "",
          "image_url": null
        }
      }
    ]
  },
  "friendly_url": "page_slug",
  "title": "a page title",
  "meta_description": null,
  "feature": "school_pages",
  "content": "<div>pagecontent</div>",
  "show_header": true,
  "show_footer": false,
  "show_nav_background_color": true,
  "is_published": false,
  "blank_page_template": null,
  "published_at": null,
  "template": "rich_text",
  "course_id": null,
  "id": 1070,
  "skip_block_loop_wrapper": null,
  "custom_head_code": null,
  "css_properties": {
  },
  "draft_of_id": null,
  "updated_at": "2019-10-31T22:01:58Z",
  "compatibles": {
    "editor": "page_editor"
  },
  "meta": {
    "class": "page",
    "url": null,
    "name": "1070",
    "description": "a page title",
    "image_url": null
  },
  "blocks": [
    {
      "created_at": "2019-10-31T22:01:58Z",
      "are_dependencies_met": true,
      "partial": "rich_text",
      "position": 1,
      "data": {
        "body": "<div>pagecontent</div>"
      },
      "page_id": 1070,
      "course_id": null,
      "is_hidden": false,
      "id": 3132,
      "custom_relations_data": {
      },
      "css_properties": {
      },
      "toggles": {
      },
      "meta": {
        "class": "block",
        "url": null,
        "name": "3132",
        "description": "",
        "image_url": null
      }
    }
  ]
}