Creating Pages
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
|
Request
Headers
Route
POST api/v1/pages
Body
{"id":1097,"friendly_url":"page_slug","show_footer":null,"show_header":null,"title":"a page title","content":"\u003cdiv\u003epagecontent\u003c/div\u003e","template":"course_certificate","course_id":158}
cURL
curl "http://localhost:3000api/v1/pages" -d '{"id":1097,"friendly_url":"page_slug","show_footer":null,"show_header":null,"title":"a page title","content":"\u003cdiv\u003epagecontent\u003c/div\u003e","template":"course_certificate","course_id":158}' -X POST \
-H "Accept: application/json" \
-H "X-Api-Token: ysfcAfKX6Urwvw4STeS81aMoGQopan9tJw" \
-H "X-Api-Email: user-71@example.com" \
-H "Content-Type: application/json" \
-H "Host: school.worksonmy.computer"
Response
Headers
Status
201 Created
Body
{
"created_at": "2019-10-31T22:02:02Z",
"draft": null,
"friendly_url": "page_slug",
"title": "a page title",
"meta_description": null,
"feature": "certificate",
"content": "<div>pagecontent</div>",
"show_header": null,
"show_footer": null,
"show_nav_background_color": false,
"is_published": false,
"blank_page_template": true,
"published_at": null,
"template": "course_certificate",
"course_id": 158,
"id": 1101,
"skip_block_loop_wrapper": null,
"custom_head_code": null,
"css_properties": {
},
"draft_of_id": null,
"updated_at": "2019-10-31T22:02:02Z",
"compatibles": {
"editor": "page_editor"
},
"meta": {
"class": "page",
"url": null,
"name": "1101",
"description": "a page title",
"image_url": null
},
"blocks": [
{
"created_at": "2019-10-31T22:02:02Z",
"are_dependencies_met": true,
"partial": "liquid_html",
"position": 1,
"data": {
"body": ""
},
"page_id": 1101,
"course_id": 158,
"is_hidden": false,
"id": 3187,
"custom_relations_data": {
},
"css_properties": {
},
"toggles": {
},
"meta": {
"class": "block",
"url": null,
"name": "3187",
"description": "",
"image_url": null
}
}
]
}