Page builder schema
Endpoint: https://api.youcan.shop/pages/builder/schema
Method: GET
Returns the page settings and the section types of the page builder. Use it to build the content of Create a builder page and Update a builder page.
Required Scopes
read-pages
Parameters
| Param Name | Param Type | Description | Required |
|---|---|---|---|
type | string | landing (default) or thankyou | no |
sections | array or comma-separated string | Section names. With this parameter, the response has the full definition of each section | no |
Response
[200]
Without sections, the response lists the section types:
json
{
"type": "landing",
"settings": [
{
"type": "select",
"label": "Page Direction",
"name": "page-direction",
"options": [
{ "label": "Left To Right", "value": "ltr" },
{ "label": "Right To Left", "value": "rtl" }
],
"default": "ltr"
}
],
"sections": [
{ "name": "html-editor", "title": "Html Editor", "group": "Content" },
{ "name": "express-checkout-form", "title": "Express checkout", "group": "Blocks" }
]
}With sections=html-editor, each section has its blocks and settings, with their types, options and defaults. Names that do not exist are in unknown:
json
{
"type": "landing",
"settings": [
{
"type": "select",
"label": "Page Direction",
"name": "page-direction",
"options": [
{ "label": "Left To Right", "value": "ltr" },
{ "label": "Right To Left", "value": "rtl" }
],
"default": "ltr"
}
],
"sections": [
{
"name": "html-editor",
"title": "Html Editor",
"group": "Content",
"blocks": [
{
"name": "parameters",
"title": "Parameters",
"type": "single",
"settings": [
{ "type": "html-editor", "label": "Html Editor", "name": "htmlText", "default": null }
]
}
]
}
],
"unknown": []
}Page content
A page is {settings, sections[]}. A section is:
json
{
"id": "hero",
"name": "html-editor",
"label": "Hero",
"blocks": {
"parameters": { "htmlText": "<div class=\"kb-hero\">...</div>" },
"style": { "css-content": ".kb-hero { padding: 48px; }" }
},
"children": []
}- Blocks of type
multiple(such asboxes,imagesandlistItem) are lists of items. - Only
rowandcolumntakechildren. - A setting that you do not send takes its schema default.
- A setting key that the section does not have is refused. The error lists the valid keys of the section.
custom-css-jsis not available through the API.- An HTML or CSS value cannot contain scripts, event handlers or
javascript:URLs. - An image setting and an
<img>src take an absolute https URL, such as thesrcof a store image.