CMS Page API
Overview
The CMS Page API provides endpoints for managing static content pages in your EverShop store. CMS pages are useful for creating informational content such as About Us, Contact Us, Terms and Conditions, Privacy Policy, and other content that doesn't fit within the product catalog structure.
Endpoints
Create A CMS Page
Creates a new content page in the system. You can specify the page content, layout, and SEO metadata.
Request Schema (application/json)
| Field Name | Field Type | Required | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| status | string or integer ('0', '1', 0, 1) | No | ||||||||||||||||||||||||||||||
| name | string | No | ||||||||||||||||||||||||||||||
| content | array of object | No | ||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
| url_key | string (^\S+$) | No | ||||||||||||||||||||||||||||||
| meta_title | string | No | ||||||||||||||||||||||||||||||
| meta_description | string | No | ||||||||||||||||||||||||||||||
| meta_keywords | string | No | ||||||||||||||||||||||||||||||
POST/api/pages
- cURL
- JavaScript
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
--data-raw '<JSON DATA>'
https://<your domain>/api/pages
fetch('https://<your domain>/api/pages', {
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer <admin JWT token>'
},
body: <JSON DATA>
})
.then(response => response.json())
.then(data => {
if(data.error) {
// Handle the error
} else {
// Handle the data
}
})
.catch(error => {
// Handle the error
});
Sample Of Response
{
"data": {
"cms_page_id": 14,
"uuid": "e15da567a66c11edb46b60d819134f39",
"layout": "oneColumn",
"status": 1,
"created_at": "2023-02-07 10:15:32",
"updated_at": "2023-02-07 10:15:32",
"cms_page_description_id": 15,
"cms_page_description_cms_page_id": 14,
"url_key": "about-us",
"name": "About Our Company",
"content": "<h1>About Us</h1><p>Welcome to our company. We specialize in providing high-quality products and exceptional customer service.</p>",
"meta_title": "About Us | Our Company Story",
"meta_keywords": "about us, company history, our story, mission",
"meta_description": "Learn about our company's history, mission, and values. Discover why customers choose us for their shopping needs.",
"links": [
{
"rel": "cmsPageGrid",
"href": "/admin/pages",
"action": "GET",
"types": [
"text/xml"
]
},
{
"rel": "edit",
"href": "/admin/pages/edit/e15da567a66c11edb46b60d819134f39",
"action": "GET",
"types": [
"text/xml"
]
},
{
"rel": "view",
"href": "/page/about-us",
"action": "GET",
"types": [
"text/xml"
]
}
]
}
}
Update A CMS Page
Modifies an existing content page. You can update any of the page attributes, including content, layout, and SEO metadata.
Request Schema (application/json)
| Field Name | Field Type | Required | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| status | string or integer ('0', '1', 0, 1) | No | ||||||||||||||||||||||||||||||
| name | string | No | ||||||||||||||||||||||||||||||
| content | array of object | No | ||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
| url_key | string (^\S+$) | No | ||||||||||||||||||||||||||||||
| meta_title | string | No | ||||||||||||||||||||||||||||||
| meta_description | string | No | ||||||||||||||||||||||||||||||
| meta_keywords | string | No | ||||||||||||||||||||||||||||||
PATCH/api/pages/433ba97f-8be7-4be9-be3f-a9f341f2b89f
- cURL
- JavaScript
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
--data-raw '<JSON DATA>'
https://<your domain>/api/pages/433ba97f-8be7-4be9-be3f-a9f341f2b89f
fetch('https://<your domain>/api/pages/433ba97f-8be7-4be9-be3f-a9f341f2b89f', {
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer <admin JWT token>'
},
body: <JSON DATA>
})
.then(response => response.json())
.then(data => {
if(data.error) {
// Handle the error
} else {
// Handle the data
}
})
.catch(error => {
// Handle the error
});
Sample Of Response
{
"data": {
"cms_page_id": 14,
"uuid": "433ba97f-8be7-4be9-be3f-a9f341f2b89f",
"layout": "oneColumn",
"status": 1,
"created_at": "2023-02-07 10:15:32",
"updated_at": "2023-02-07 14:18:05",
"cms_page_description_id": 15,
"cms_page_description_cms_page_id": 14,
"url_key": "contact-us",
"name": "Contact Us",
"content": "<h1>Contact Us</h1><p>We'd love to hear from you! Please use the form below to get in touch with our customer service team.</p><form>...</form>",
"meta_title": "Contact Us | Customer Support",
"meta_keywords": "contact, customer service, support, help",
"meta_description": "Contact our customer support team for assistance with orders, returns, or product questions.",
"links": [
{
"rel": "cmsPageGrid",
"href": "/admin/pages",
"action": "GET",
"types": [
"text/xml"
]
},
{
"rel": "edit",
"href": "/admin/pages/edit/433ba97f-8be7-4be9-be3f-a9f341f2b89f",
"action": "GET",
"types": [
"text/xml"
]
},
{
"rel": "view",
"href": "/page/contact-us",
"action": "GET",
"types": [
"text/xml"
]
}
]
}
}
Delete A CMS Page
Permanently removes a content page from the system.
Request Schema (application/json)
No request body requiredDELETE/api/pages/433ba97f-8be7-4be9-be3f-a9f341f2b89f
- cURL
- JavaScript
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
https://<your domain>/api/pages/433ba97f-8be7-4be9-be3f-a9f341f2b89f
fetch('https://<your domain>/api/pages/433ba97f-8be7-4be9-be3f-a9f341f2b89f', {
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer <admin JWT token>'
}
})
.then(response => response.json())
.then(data => {
if(data.error) {
// Handle the error
} else {
// Handle the data
}
})
.catch(error => {
// Handle the error
});
Sample Of Response
{
"data": {
"cms_page_id": 14,
"uuid": "433ba97f-8be7-4be9-be3f-a9f341f2b89f",
"layout": "twoColumnsLeft",
"status": 1,
"created_at": "2023-02-07 10:15:32",
"updated_at": "2023-02-07 14:18:05",
"cms_page_description_id": 15,
"cms_page_description_cms_page_id": 14,
"url_key": "contact-us",
"name": "Contact Us",
"content": "<h1>Contact Us</h1><p>We'd love to hear from you! Please use the form below to get in touch with our customer service team.</p><form>...</form>",
"meta_title": "Contact Us | Customer Support",
"meta_keywords": "contact, customer service, support, help",
"meta_description": "Contact our customer support team for assistance with orders, returns, or product questions."
}
}
Get CMS Page Data with GraphQL
EverShop uses GraphQL for querying CMS page data. For detailed information on how to query CMS pages, refer to the GraphQL API documentation.