Page
The Page API returns the store's custom pages and the HTML content of a single page. Both endpoints are open to anonymous visitors.
All Ajax API requests should use locale-aware URLs to give visitors a consistent experience.
List the custom pages of the store
GET /{locale}/api/front/pages
List the custom pages of the store, with the content and the SEO fields of each page.
Example request
fetch(window.SHOPLAZZA.routes.root + '/api/front/pages?page=1&per_page=10')
.then((response) => response.json())
.then((data) => {
// do something...
});
Request parameters
The page of results to return.
The number of pages per page of results. Defaults to 10.
Response
- Schema
- Example
- Array [
- ]
data object
The response payload.
Current page number.
Number of records returned per page.
pages object[]
List of custom pages.
ID of the custom page.
ID of the store the object belongs to.
Where the page comes from.
Title of the custom page.
HTML content of the page.
Status of the custom page; 1 means active.
Creation time, in ISO-8601 format.
Last update time, in ISO-8601 format.
Whether SEO settings are managed independently.
Relative URL of the custom page.
SEO title used in the page metadata.
SEO keywords used in the page metadata.
SEO description used in the page metadata.
Number of custom pages returned.
Whether more records are available.
Result message returned with the response.
Request result flag; success or 0 means the request succeeded.
{
"data": {
"page": 1,
"per_page": 10,
"pages": [
{
"id": 13594997,
"store_id": 2446407,
"origin": "openapi",
"title": "Ajax API Probe Page",
"content": "<p>Sample custom page used for Ajax API documentation examples.</p>",
"status": 1,
"created_at": "1788356532",
"updated_at": "1788356532",
"independent_seo": false,
"url": "/pages/ajax-api-probe-page",
"meta_title": "Ajax API Probe Page",
"meta_keyword": "",
"meta_description": "Sample custom page used for Ajax API documentation examples."
}
],
"count": 1,
"has_more": 0
},
"msg": "请求成功",
"state": 0
}
Get a custom page
GET /{locale}/api/front/pages/{page_id}
Get one custom page by id.
Example request
fetch(window.SHOPLAZZA.routes.root + '/api/front/pages/13594997')
.then((response) => response.json())
.then((data) => {
// do something...
});
Request parameters
The id of the custom page.
Response
- Schema
- Example
data object
The response payload.
ID of the custom page.
ID of the store the object belongs to.
Where the page comes from.
Title of the custom page.
HTML content of the page.
Status of the custom page; 1 means active.
Creation time, in ISO-8601 format.
Last update time, in ISO-8601 format.
Whether SEO settings are managed independently.
Relative URL of the custom page.
SEO title used in the page metadata.
SEO keywords used in the page metadata.
SEO description used in the page metadata.
Result message returned with the response.
Request result flag; success or 0 means the request succeeded.
{
"data": {
"id": 13594997,
"store_id": 2446407,
"origin": "openapi",
"title": "Ajax API Probe Page",
"content": "<p>Sample custom page used for Ajax API documentation examples.</p>",
"status": 1,
"created_at": "1788356532",
"updated_at": "1788356532",
"independent_seo": false,
"url": "/pages/ajax-api-probe-page",
"meta_title": "Ajax API Probe Page",
"meta_keyword": "",
"meta_description": "Sample custom page used for Ajax API documentation examples."
},
"msg": "请求成功",
"state": 0
}