Awesome
Public REST API and GraphQL for Goomento Page Builder Extension
1. Install
Run the following command in Magento 2 root folder to install this repository
composer require goomento/module-page-builder-api
php bin/magento module:enable Goomento_PageBuilderApi
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
2. REST API request
Get JSON data of particular Goomento page builder base on identifier
via REST API
Request:
GET <domain>/rest/V1/<store_code>/pagebuilder/identifier/<identifier>
Example response:
{
"settings": {},
"elements": [],
"title": "Goomento page builder response",
"type": "page",
"status": "publish",
"update_time": "2022-09-02 08:50:59",
"creation_time": "2022-09-02 08:50:59",
"html": "<div>Page Builder HTML.</div>",
"styles": [
{
"href": "https://example.com/pub/style.css",
"content": "body {background: red};"
}
]
}
3. GraphQL request
Get JSON data of particular Goomento page builder base on identifier
via GraphQL
Request:
query {
pagebuilder(identifier: "<identifier>") {
title
status
type
html
elements_content
settings_content
creation_time
update_time
styles {
content
href
}
}
}
Example response:
{
"data": {
"pagebuilder": {
"title": "Goomento page builder response",
"status": "publish",
"type": "page",
"html": "<div>Page Builder HTML.</div>",
"elements_content": "[]",
"settings_content": "{}",
"creation_time": "2022-09-02 08:50:59",
"update_time": "2022-09-02 08:50:59",
"styles": [
{
"href": "https://example.com/pub/style.css",
"content": "body {background: red};"
}
]
}
}
}
Note:
Publish
status must beYes
Enable
config must beYes
elements_content
andsettings_content
were encoded JSON data of page builder