# snowdog/module-cms-api

> Custom CMS API endpoints which retrieves CMS pages and blocks filtered

`composer require snowdog/module-cms-api`

Canonical URL: https://packagento.com/snowdog/module-cms-api

## At a glance

- **Vendor**: snowdog (https://packagento.com/snowdog.md)
- **Latest version**: 1.11.0 — released 2023-11-06
- **Pricing**: Free
- **Package type**: Magento 2 module
- **Status**: active, accepting new buyers

## Installation

Packagento is licence-gated, so even free packages need a licence on a project before Composer can resolve them.

1. **Sign in or create an account** at https://packagento.com/customer/account/.

2. **Add the package to your account.** Open https://packagento.com/snowdog/module-cms-api and complete the free checkout. A licence is minted automatically.

3. **Create or pick a project, then activate the licence on it.**
   - Projects represent the Magento installs you deploy to. Manage them at https://packagento.com/projects/.
   - Activate the new licence on the project you'll deploy this package to. Activation is what generates the Composer credentials scoped to that project.

4. **Add the project credentials to your Magento codebase.**

   Grab the project's public + private key from https://packagento.com/projects/ (open the project, then its Credentials tab), and add them to `auth.json`:

   ```json
   {
     "http-basic": {
       "packagento.com": {
         "username": "ppk_live_...",
         "password": "psk_live_..."
       }
     }
   }
   ```

   Add the Packagento Composer repository to `composer.json`:

   ```json
   {
     "repositories": [
       { "type": "composer", "url": "https://packagento.com" }
     ]
   }
   ```

5. **Install and apply.**

   ```bash
   composer require snowdog/module-cms-api:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

Custom CMS API endpoints which retrieves CMS pages and blocks filtered

## README

The module provides endpoints to get CMS blocks and pages filtered.

#### 1. Installation:

* `composer require snowdog/module-cms-api`
* `bin/magento module:enable Snowdog_CmsApi`
* `bin/magento setup:upgrade`

#### 2. Available endpoints: 

* `/rest/V1/snowdog/cmsPage/:pageId`: retrieves page info by its id (integer value)
* `/rest/V1/snowdog/cmsPage/search`: retrieves the list of pages (accepts search criteria filters)
* `/rest/V1/snowdog/cmsPageIdentifier/:identifier/storeId/:storeId`: retrieves page info by its identifier (string value) and store id (integer value)
* `/rest/V1/snowdog/cmsBlock/:blockId`: retrieves block info by its id (integer value)
* `/rest/V1/snowdog/cmsBlockIdentifier/:identifier/storeId/:storeId`: retrieves block info by its identifier (string value) and store id (integer value)
* `/rest/V1/snowdog/cmsBlock/search`: retrieves the list of blocks (accepts search criteria filters)

### License

[MIT](LICENSE.md)

## Changelog

All notable changes to this project will be documented in this file.

### [Unreleased]

### [1.11.0] 2023-11-06
* Enabled PHP `8.1` and `8.2` support in `composer.json`

### [1.10.0] 2020-09-24
* Enabled PHP `7.4` support in `composer.json`

### [1.9.0] 2020-09-07
* Enabled Magento `2.4` support in `composer.json`

### [1.8.0] 2020-08-28
* Added license file.

### [1.7.0] 2020-05-11
* Fixed: blocking store emulation if no `store_id` parameter is passed through search criteria filters.

### [1.6.0] 2019-10-25
* Added compatibility with PHP 7.3.x in composer file (thanks to @WJdeBaas)

### [1.5.0] 2019-01-21
* Added compatibility with PHP 7.2.x in composer file

### [1.4.0] 2018-12-31
* Added compatibility with Magento 2.3.0 in composer file

### [1.3.1] 2018-11-20
* Fixed missing page and block id in search endpoint responses

### [1.3.0] 2018-10-15
* If searchCriteria contains only one store_id as filter, the content for blocks/pages will be loaded for the given store id. 

### [1.2.0] 2018-10-03
* Widgets and content variables are parsed correctly
* CMS Block/Pages List with store_id provided

### [1.1.0] 2018-07-23
* Added new API endpoints to get pages/blocks by their identifier

### [1.0.0] 2018-06-25
* Init files

## Recent Versions

| Version | Released |
|---|---|
| 1.11.0 | 2023-11-06 |
| 1.10.0 | 2020-09-24 |
| 1.9.0 | 2020-09-07 |
| 1.8.0 | 2020-08-28 |
| 1.7.0 | 2020-05-11 |
| 1.6.0 | 2019-10-25 |
| 1.5.0 | 2019-01-21 |
| 1.4.0 | 2018-12-31 |
| 1.3.1 | 2018-11-20 |
| 1.3.0 | 2018-10-15 |

Showing 10 of 13 versions. Full release history on https://packagento.com/snowdog/module-cms-api.

## Dependencies

### Require

| Package | Constraint |
|---|---|
| magento/framework | 101.0.*\|102.0.*\|103.0.* |
| magento/module-cms | 102.0.*\|103.0.*\|104.0.* |
| php | 7.0.2\|7.0.4\|~7.0.6\|~7.1.0\|~7.2.0\|~7.3.0\|~7.4.0\|~8.1.0\|~8.2.0 |

## Quality

Latest release (1.11.0) fails the Packagento QA pipeline. Verdicts below are per-cell (Magento line × PHP version) for the matrixed tools, and run-once for the static / security tiers.


### Compatibility

Each Magento line is installed on its supported PHP versions, then the module is built (DI compile + static-content deploy). Cells show passed / failed / untested; staircase gaps render as `–`.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Pass | not tested | – | – |
| 2.4.8 | – | not tested | not tested | – |
| 2.4.9 | – | – | not tested | not tested |


### Code Quality

Advisory checks against the module's source. Never affect the Compatibility verdict — a phpcs finding can't make a module incompatible.

#### Static Analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Warning | 3 | 3 warnings (ruleset: Magento2) |
| PHPMD | Pass | 0 |  |
| Cpd | Pass | 0 |  |
| Composer validate | Pass | 0 |  |

#### PHPStan

Type-checks the module against a real Magento install. Re-runs per Magento + PHP version because resolvable symbols differ between releases.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | 6 | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |


### Tests

Unit and integration suites run per Magento + PHP cell. Test failures speak to the module's behaviour, not its compatibility with a line, so they're reported here separately.

#### Unit Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |

#### Integration Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |


### Security

Dependency-advisory audit (composer audit) plus a source malware scan. A malware detection fails the version outright.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| Composer audit | Pass | 0 |  |
| Malware scan | Pass | 0 |  |

## Licence and pricing

Free. A licence is still minted on checkout and bound to your project for Composer access — no payment step.

Refundable within 14 days of first purchase via https://packagento.com/account/refunds/.

## Install via Claude Code or any MCP client

The Packagento MCP server can run the licence + project + Composer steps above in one tool call:

```
purchase_and_install_packages(
  composer_names=["snowdog/module-cms-api"],
  project_id="proj_xxx"
)
```

This handles cart, checkout, licence minting, project activation, and writes auth.json credentials. Connect a client with `claude mcp add packagento https://mcp.packagento.com`. Full setup at https://packagento.com/docs/mcp-setup.

## Vendor

snowdog is a Magento 2 vendor on Packagento. See https://packagento.com/snowdog.md for their full catalogue.

