Pages API

allows only whitelisted properties

PUT /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
css_properties page-level css data

Request

Headers

Accept: application/json
X-Api-Token: piTZe3ww6VuTxe5nDtUHAcTaRCzarTaJ4w
X-Api-Email: user-77@example.com

Route

PUT /api/v1/pages/1116

Body

{"friendly_url":"page_slug","show_footer":false,"show_header":true,"title":"a page title","content":"\u003cdiv\u003epagecontent\u003c/div\u003e","template":"rich_text","css_properties":{"main":{"background_color":{"value":"003366","value_type":"hex_color"},"element_width":{"value":100,"value_type":"pixel"}},"unspecified_class":{"background_color":{"value":"003366","value_type":"hex_color"}}}}

cURL

curl "http://localhost:3000/api/v1/pages/1116" -d '{"friendly_url":"page_slug","show_footer":false,"show_header":true,"title":"a page title","content":"\u003cdiv\u003epagecontent\u003c/div\u003e","template":"rich_text","css_properties":{"main":{"background_color":{"value":"003366","value_type":"hex_color"},"element_width":{"value":100,"value_type":"pixel"}},"unspecified_class":{"background_color":{"value":"003366","value_type":"hex_color"}}}}' -X PUT \
	-H "Accept: application/json" \
	-H "X-Api-Token: piTZe3ww6VuTxe5nDtUHAcTaRCzarTaJ4w" \
	-H "X-Api-Email: user-77@example.com" \
	-H "Content-Type: application/json" \
	-H "Host: school.worksonmy.computer"

Response

Headers

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

Status

202 Accepted

Body

{
  "created_at": "2019-10-31T22:02:04Z",
  "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": null,
  "is_published": true,
  "blank_page_template": false,
  "published_at": null,
  "template": "rich_text",
  "course_id": null,
  "id": 1116,
  "skip_block_loop_wrapper": null,
  "custom_head_code": null,
  "css_properties": {
    "main": {
      "background_color": {
        "value": "003366",
        "value_type": "hex_color"
      }
    }
  },
  "draft_of_id": null,
  "updated_at": "2019-10-31T22:02:04Z",
  "compatibles": {
  },
  "meta": {
    "class": "page",
    "url": null,
    "name": "1116",
    "description": "a page title",
    "image_url": null
  },
  "blocks": [

  ]
}