Skip to content

Page builder schema ​

Last updated View as Markdown

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 NameParam TypeDescriptionRequired
typestringlanding (default) or thankyouno
sectionsarray or comma-separated stringSection names. With this parameter, the response has the full definition of each sectionno

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 as boxes, images and listItem) are lists of items.
  • Only row and column take children.
  • 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-js is 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 the src of a store image.