Skip to main content

Cms Page API

Use the REST API to interact with EverShop cms pages.

Create a page

Use this endpoint to create a category.

Request Schema (application/json)
Field NameField TypeRequired
statusstring or integer ('0', '1', 0, 1)Yes
layoutstring (oneColumn, twoColumnsLeft, twoColumnsRight, threeColumns)Yes
namestringYes
contentstringYes
url_keystringYes
meta_titlestringYes
meta_descriptionstringYes
meta_keywordsstringYes
POST/api/pages
curl
-H "Accept: application/json"
-H "Cookie: asid=<your admin cookie>"
https://<your domain>/api/pages
Sample Of Response
{
"data": {
"cms_page_id": 14,
"uuid": "e15da567a66c11edb46b60d819134f39",
"layout": "oneColumn",
"status": 1,
"created_at": null,
"updated_at": null,
"cms_page_description_id": 15,
"cms_page_description_cms_page_id": 14,
"url_key": "OSbIajIBDgJMem2VtiF4",
"name": "OSbIajIBDgJMem2VtiF4",
"content": "OSbIajIBDgJMem2VtiF4",
"meta_title": "fixed_discount_to_entire_order",
"meta_keywords": "fixed_discount_to_entire_order",
"meta_description": "fixed_discount_to_entire_order",
"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/OSbIajIBDgJMem2VtiF4",
"action": "GET",
"types": [
"text/xml"
]
}
]
}
}

Update a page

Use this endpoint to update a page.

Request Schema (application/json)
Field NameField TypeRequired
statusstring or integer ('0', '1', 0, 1)No
layoutstring (oneColumn, twoColumnsLeft, twoColumnsRight, threeColumns)No
namestringYes
contentstringNo
url_keystringNo
meta_titlestringNo
meta_descriptionstringNo
meta_keywordsstringNo
PATCH/api/pages/{id}
curl
-H "Accept: application/json"
-H "Cookie: asid=<your admin cookie>"
https://<your domain>/api/pages/{id}
Sample Of Response
{
"data": {
"cms_page_id": 14,
"uuid": "e15da567a66c11edb46b60d819134f39",
"layout": "oneColumn",
"status": 1,
"created_at": null,
"updated_at": null,
"cms_page_description_id": 15,
"cms_page_description_cms_page_id": 14,
"url_key": "contact-us",
"name": "Contact us",
"content": "Page content",
"meta_title": "Contact us",
"meta_keywords": "Contact us",
"meta_description": "Contact us",
"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/OSbIajIBDgJMem2VtiF4",
"action": "GET",
"types": [
"text/xml"
]
}
]
}
}

Delete a page

Use this endpoint to delete a page.

Request Schema (application/json)
No request body required
DELETE/api/pages/{id}
curl
-H "Accept: application/json"
-H "Cookie: asid=<your admin cookie>"
https://<your domain>/api/pages/{id}
Sample Of Response
{
"data": {
"cms_page_id": 14,
"uuid": "e15da567a66c11edb46b60d819134f39",
"layout": "twoColumnsLeft",
"status": 1,
"created_at": null,
"updated_at": "2023-02-07 14:18:05",
"cms_page_description_id": 15,
"cms_page_description_cms_page_id": 14,
"url_key": "OSbIajIBDgJMem2VtiF4",
"url_key": "contact-us",
"name": "Contact us",
"content": "Page content",
"meta_title": "Contact us",
"meta_keywords": "Contact us",
"meta_description": "Contact us"
}
}