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 1mo ago

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 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

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

956d 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://www.gravatar.com/avatar/9293071c46a4133290d6cfacd546540fa788d04f3b36d6d80da64848609e9ed2?d=identicon)[cct](/maintainers/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

[sylius/sylius

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

8.4k5.6M651](/packages/sylius-sylius)[statamic/cms

The Statamic CMS Core Package

4.8k3.2M720](/packages/statamic-cms)[drupal/core

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

19462.3M1.3k](/packages/drupal-core)[currency-cloud/client

A PHP library which implements the complete functionality of v2 of the The Currency Cloud API.

17327.2k](/packages/currency-cloud-client)[tamara-solution/php-sdk

Tamara PHP Client Library

10259.4k1](/packages/tamara-solution-php-sdk)[concrete5/core

Concrete core subtree split

19159.3k48](/packages/concrete5-core)

PHPackages © 2026

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