Skip to content

feat: add Admin API endpoints for CmsPage#165

Open
axel-paillaud wants to merge 8 commits into
PrestaShop:devfrom
axel-paillaud:add_cms_page_command
Open

feat: add Admin API endpoints for CmsPage#165
axel-paillaud wants to merge 8 commits into
PrestaShop:devfrom
axel-paillaud:add_cms_page_command

Conversation

@axel-paillaud
Copy link
Copy Markdown

@axel-paillaud axel-paillaud commented Mar 29, 2026

PR Description — Add Admin API endpoints for CmsPage

Questions Answers
Description? Add Admin API endpoints for CmsPage entity: POST (create), GET (single), PATCH (update), PATCH (toggle-status), DELETE (single), DELETE (bulk), PUT (bulk enable), PUT (bulk disable).
Type? new feature
BC breaks? no
Deprecations? no
Fixed ticket? N/A
Sponsor company N/A
How to test? Call POST /api/cms-pages?shopId=1 with a valid Bearer token and body (see below). Expect 201 with the created entity. Then call GET /api/cms-pages/{cmsPageId} and expect 200 with the full entity.

Dependencies

This PR requires the following core fixes to be merged first:

  • fix: cast bool fields in GetCmsPageForEditingHandler #41128
  • fix, if you want multistore working: guard against null employee in AbstractObjectModelHandler::associateWithShops() #41130

Sample POST body

{
  "cmsPageCategoryId": 1,
  "titles": { "en-US": "My CMS Page", "fr-FR": "Ma page CMS" },
  "metaTitles": { "en-US": "Meta title", "fr-FR": "Meta titre" },
  "metaDescriptions": { "en-US": "Meta description", "fr-FR": "Meta description" },
  "friendlyUrls": { "en-US": "my-cms-page", "fr-FR": "ma-page-cms" },
  "contents": { "en-US": "<p>Content</p>", "fr-FR": "<p>Contenu</p>" },
  "indexedForSearch": true,
  "enabled": true,
  "shopIds": [1]
}

Endpoints added

Method URI Scope
POST /cms-pages cms_page_write
GET /cms-pages/{cmsPageId} cms_page_read
PATCH /cms-pages/{cmsPageId} cms_page_write
PUT /cms-pages/{cmsPageId}/toggle-status cms_page_write
DELETE /cms-pages/{cmsPageId} cms_page_write
DELETE /cms-pages/bulk-delete cms_page_write
PUT /cms-pages/bulk-enable cms_page_write
PUT /cms-pages/bulk-disable cms_page_write

@axel-paillaud axel-paillaud marked this pull request as ready for review April 1, 2026 05:57
@ps-jarvis
Copy link
Copy Markdown

Hello @axel-paillaud!

This is your first pull request on ps_apiresources repository of the PrestaShop project.

Thank you, and welcome to this Open Source community!

@github-project-automation github-project-automation Bot moved this to Ready for review in PR Dashboard Apr 1, 2026
@axel-paillaud
Copy link
Copy Markdown
Author

Everything has been tested end-to-end (Bruno API client) and with PHP Unit unit tests

@axel-paillaud axel-paillaud changed the title feat: add Admin API endpoints for CmsPage (POST, GET) feat: add Admin API endpoints for CmsPage Apr 1, 2026
@ps-jarvis ps-jarvis added the Waiting for QA Status: Action required, Waiting for test feedback label Apr 21, 2026
@ps-jarvis ps-jarvis moved this from Ready for review to To be tested in PR Dashboard Apr 21, 2026
@nicosomb
Copy link
Copy Markdown
Contributor

nicosomb commented May 7, 2026

@axel-paillaud the CI is red, could you have a look please?

@nicosomb nicosomb added Waiting for author and removed Waiting for QA Status: Action required, Waiting for test feedback labels May 7, 2026
@ps-jarvis ps-jarvis moved this from To be tested to Waiting for author in PR Dashboard May 7, 2026
@axel-paillaud
Copy link
Copy Markdown
Author

@nicosomb This PR need 41128 to work, otherwise we have : The type of the \"indexedForSearch\" attribute must be \"bool\", \"string\" given

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Waiting for author

Development

Successfully merging this pull request may close these issues.

4 participants