PHPackages                             openpublicmedia/engaging-networks-php - 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. openpublicmedia/engaging-networks-php

ActiveLibrary[API Development](/categories/api)

openpublicmedia/engaging-networks-php
=====================================

PHP client for Engaging Networks Services (ENS) APIs

0.10.0(2y ago)1339Apache-2.0PHPPHP ^8.1

Since Aug 8Pushed 2y ago6 watchersCompare

[ Source](https://github.com/OpenPublicMedia/engaging-networks-php)[ Packagist](https://packagist.org/packages/openpublicmedia/engaging-networks-php)[ RSS](/packages/openpublicmedia-engaging-networks-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (6)Versions (6)Used By (0)

Engaging Networks PHP Library
=============================

[](#engaging-networks-php-library)

This library abstracts interactions with the [Engaging Networks Services (ENS) APIs](https://www.engagingnetworks.support/knowledge-base/engaging-networks-services-ens/).

Implemented APIs:
-----------------

[](#implemented-apis)

- [REST API](https://www.engagingnetworks.support/api/rest/#/)

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

[](#installation)

Install via composer:

```
composer require openpublicmedia/engaging-networks-php
```

Use
---

[](#use)

### REST API

[](#rest-api)

The `OpenPublicMedia\EngagingNetworksServices\Rest\Client` queries the REST API. The client requires an API User with a whitelisted IP address and an API token in the target Engaging Networks account.

See [REST API Instructions](https://www.engagingnetworks.support/knowledge-base/engaging-networks-services-rest-services/)

### Examples

[](#examples)

#### Creating a client

[](#creating-a-client)

```
use OpenPublicMedia\EngagingNetworksServices\Rest\Client;

$base_uri = 'https://ca.engagingnetworks.app/ens/service/';
$api_key = '11111111-2222-3333-4444-555555555555';

$client = new Client($base_uri, $api_key);
```

Providing a cache service is also supported (and recommended) when creating the client. If the client has a cache service it will be used to cache the authentication token provided by the ENS REST API across multiple requests for the lifetime of the token.

A PSR-16 compliant interface is preferred but any class providing `set($key, $value)` and `get($key, $default)` methods will suffice.

```
use OpenPublicMedia\EngagingNetworksServices\Rest\Client;
use Tochka\Cache\ArrayFileCache;

$base_uri = 'https://ca.engagingnetworks.app/ens/service/';
$api_key = '11111111-2222-3333-4444-555555555555';

$cache = new ArrayFileCache('.', 'my_awesome_cache');
$client = new Client($base_uri, $api_key, cache: $cache);
```

Note: ENS REST API tokens are associated with the IP address used to generate the token. The client provides default cache key names for the token and expiration data. In configurations where multiple backends with different IP addresses handle requests the `cache_key_token` and `cache_key_token_expire`parameters can be used to set the cache keys.

**Server 1**

```
use OpenPublicMedia\EngagingNetworksServices\Rest\Client;
use Tochka\Cache\ArrayFileCache;

$base_uri = 'https://ca.engagingnetworks.app/ens/service/';
$api_key = '11111111-2222-3333-4444-555555555555';

$cache = new ArrayFileCache('.', 'my_awesome_cache');
$client = new Client(
  $base_uri,
  $api_key,
  cache: $cache,
  cache_key_token: 'open_public_media.ens.rest.session_token_server_1',
  cache_key_token_expire: 'open_public_media.ens.rest.session_expire_server_1'
);
```

**Server 2**

```
use OpenPublicMedia\EngagingNetworksServices\Rest\Client;
use Tochka\Cache\ArrayFileCache;

$base_uri = 'https://ca.engagingnetworks.app/ens/service/';
$api_key = '11111111-2222-3333-4444-555555555555';

$cache = new ArrayFileCache('.', 'my_awesome_cache');
$client = new Client(
  $base_uri,
  $api_key,
  cache: $cache,
  cache_key_token: 'open_public_media.ens.rest.session_token_server_2',
  cache_key_token_expire: 'open_public_media.ens.rest.session_expire_server_2'
);
```

#### Handling exceptions

[](#handling-exceptions)

Custom exceptions are provided for 404 response and general errors. Additional information from the ENS REST API is captured in these exceptions.

```
use OpenPublicMedia\EngagingNetworksServices\Rest\Client;

$base_uri = 'https://ca.engagingnetworks.app/ens/service/';
$api_key = '11111111-2222-3333-4444-555555555555';

$client = new Client($base_uri, $api_key);
try {
    $results = $client->getPages(PageType::dc);
} catch (Exception $e) {
    var_dump(get_class($e));
    var_dump($e->getMessage());
    var_dump($e->getCode());
    var_dump($e->getErrorMessage());
    var_dump($e->getErrorMessageId());
}
```

Development goals
-----------------

[](#development-goals)

See [CONTRIBUTING](CONTRIBUTING.md) for information about contributing to this project.

### v1

[](#v1)

- ENS REST API client (`\OpenPublicMedia\EngagingNetworksServices\Rest\Client`)
- API direct querying (`$client->request()`)
- Result/error handling
- Page Services
    - [List Pages by type](https://www.engagingnetworks.support/api/rest/#/operations/listPages)
    - [View page details](https://www.engagingnetworks.support/api/rest/#/operations/getPageDetails)
    - [Process a page request](https://www.engagingnetworks.support/api/rest/#/operations/processPage)
- Supporter Services
    - [List available supporter fields](https://www.engagingnetworks.support/api/rest/#/operations/listSupporterFields)
    - [List available supporter questions](https://www.engagingnetworks.support/api/rest/#/operations/listSupporterQuestions)
    - [Retrieve details about the content of a question](https://www.engagingnetworks.support/api/rest/#/operations/viewQuestion)
    - [View Supporter by Email Address](https://www.engagingnetworks.support/api/rest/#/operations/getSupporterByEmail)
    - [Add / Update Supporter](https://www.engagingnetworks.support/api/rest/#/operations/supporterUpdate)
    - [View Supporter by ID](https://www.engagingnetworks.support/api/rest/#/operations/supporterDetail)
    - [Supporter query](https://www.engagingnetworks.support/api/rest/#/operations/supporterQuery)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 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 ~4 days

Total

5

Last Release

994d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bff91dfe597545a4f54945ec9aee22330bf39fd981466accfa486ede2b573abc?d=identicon)[cdubz](/maintainers/cdubz)

---

Top Contributors

[![cdubz](https://avatars.githubusercontent.com/u/10456740?v=4)](https://github.com/cdubz "cdubz (8 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/openpublicmedia-engaging-networks-php/health.svg)

```
[![Health](https://phpackages.com/badges/openpublicmedia-engaging-networks-php/health.svg)](https://phpackages.com/packages/openpublicmedia-engaging-networks-php)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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