PHPackages                             cct-marketing/rest - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. cct-marketing/rest

ActiveLibrary[API Development](/categories/api)

cct-marketing/rest
==================

Base library to create an API sdk for CCT Microservices

v2.0.0(2y ago)06.8kMITPHPPHP ~7.1 | ~8.0

Since Mar 14Pushed 2y ago2 watchersCompare

[ Source](https://github.com/cct-marketing/Rest)[ Packagist](https://packagist.org/packages/cct-marketing/rest)[ RSS](/packages/cct-marketing-rest/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (8)Versions (9)Used By (0)

REST API Component
==================

[](#rest-api-component)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/45bdd83ab048a17987db2a0e9d500a465155651e0cca8a15fdc387d1b5baa652/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6363742d6d61726b6574696e672f526573742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/cct-marketing/Rest/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/43553dad577ac3aad7890318a4210e9af31a928ab629d4ddd6dfa5a8ded63320/68747470733a2f2f706f7365722e707567782e6f72672f6363742d6d61726b6574696e672f726573742f762f737461626c65)](https://packagist.org/packages/cct-marketing/rest)[![Total Downloads](https://camo.githubusercontent.com/49d6bb4f4137d4749a266cafd13814045e775533cc7ea36c67d691ccc701e91a/68747470733a2f2f706f7365722e707567782e6f72672f6363742d6d61726b6574696e672f726573742f646f776e6c6f616473)](https://packagist.org/packages/cct-marketing/rest)[![Latest Unstable Version](https://camo.githubusercontent.com/3563533e17096fa4e72ac8bc957f46ed1aeea6887ff5ff3f38ff0d169e89c575/68747470733a2f2f706f7365722e707567782e6f72672f6363742d6d61726b6574696e672f726573742f762f756e737461626c65)](https://packagist.org/packages/cct-marketing/rest)[![License](https://camo.githubusercontent.com/08133a452ff96d873fe504878786ea896b8a76d99b846f0ad096ade5c1c31484/68747470733a2f2f706f7365722e707567782e6f72672f6363742d6d61726b6574696e672f726573742f6c6963656e7365)](https://packagist.org/packages/cct-marketing/rest)

A REST(Representational State Transfer) library to help rapidly develop RESTful web service SDKs. Supports serialization of response and request to objects.

Installation
------------

[](#installation)

```
composer require cct-marketing/rest
```

### Serilizer Libraries (Optional)

[](#serilizer-libraries-optional)

If no serializer is install all responses will be returned as an array

**Recommended** [JMS Serialiser](https://github.com/schmittjoh/serializer)

```
composer require jms/serializer
```

**Alternative** [Symfony Serialiser](https://symfony.com/doc/current/components/serializer.html)

```
composer require symfony/serializer
composer require symfony/property-access
```

Usage
-----

[](#usage)

To use the library you just need to extend the AbstractClient and AbstractSerializerRequest or AbstractRequest classes

```
use CCT\Component\Rest\Config;
use CCT\Component\Rest\Http\Definition\RequestHeaders;
use CCT\Component\Rest\Http\Request;
use CCT\Component\Rest\Serializer\Context\Context;

class MyRequest extends Request
{
    protected function setUp()
    {
        $this->config->set(Config::URI_PREFIX, '/test/');
    }

    public function apiCall(QueryParams $queryParams = null)
    {
        $this->config->set('serialization_context', Context::create()->setGroups(['read']));

        $headers = RequestHeaders::create(
            [
                'Accept' => 'application/json',
                'X-Requested-With' => 'XMLHttpRequest',
            ]
        );

        $this->setHeaders($headers);

        return parent::requestGet($this->getUri(), $queryParams);
    }
}
```

```
use CCT\Component\Rest\AbstractClient;
use CCT\Component\Rest\Config;

class RESTClient extends AbstractClient
{
    /**
     * @return ScrapeRequest
     */
    public function myAPI(): MyRequest
    {
        $config = clone $this->config;
        $modelClass = TestModel::class;

        $serializer = $this->getBuiltSerializer($config);
        if ($this->shouldUseDefaultResponseTransformers() && null !== $serializer) {
            $this->applyDefaultResponseTransformers($config, $serializer, $modelClass);
        }

        return $this->createRequestInstance(TestRequest::class, $config, null);
    }
}
```

To run:

```
$config = new \CCT\Component\Rest\Config([
    \CCT\Component\Rest\Config::ENDPOINT => 'https://api.endpoint.com/',
    \CCT\Component\Rest\Config::DEBUG => true,
]);

/**
 * Send Request
 */
$client = new Client($config);
$query = new QueryParams();
$query->set('message', 'hello');
$response = $client->myAPI()->apiCall($query);

var_dump($response->getData());
```

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~290 days

Recently: every ~502 days

Total

8

Last Release

1002d ago

Major Versions

v1.0.5 → v2.0.02023-10-05

PHP version history (2 changes)v1.0.0-alpha.1PHP ~7.1

v2.0.0PHP ~7.1 | ~8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20734021?v=4)[Convergence CT](/maintainers/cct)[@cct](https://github.com/cct)

---

Top Contributors

[![jvahldick](https://avatars.githubusercontent.com/u/1113015?v=4)](https://github.com/jvahldick "jvahldick (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cct-marketing-rest/health.svg)

```
[![Health](https://phpackages.com/badges/cct-marketing-rest/health.svg)](https://phpackages.com/packages/cct-marketing-rest)
```

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.6M985](/packages/statamic-cms)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M737](/packages/sylius-sylius)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

21866.0M1.7k](/packages/drupal-core)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6942.5M421](/packages/drupal-core-recommended)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M507](/packages/pimcore-pimcore)[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
