PHPackages                             mmoravac/openx - 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. mmoravac/openx

ActiveLibrary[API Development](/categories/api)

mmoravac/openx
==============

Modern PHP client for working with the OpenX v4 oAuth API

01.5kPHP

Since Oct 28Pushed 5y agoCompare

[ Source](https://github.com/mmoravac/openx)[ Packagist](https://packagist.org/packages/mmoravac/openx)[ RSS](/packages/mmoravac-openx/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

OpenX oAuth API Client
======================

[](#openx-oauth-api-client)

Uses [Guzzle v4.x](https://github.com/guzzle/guzzle/tree/4.2.3) and the [oauth-subscriber plugin](https://github.com/guzzle/oauth-subscriber).

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

[](#installation)

```
php composer.phar require mmoravac/openx

```

Usage in your code:
-------------------

[](#usage-in-your-code)

```
// Setup client and login with user
$client = new mmoravac\OpenX($consumerKey, $consumerSecret, $oauthRealm, 'http://ox-ui.example.com/ox/4.0/');
$client->login('user@example.com', 'souper-seekret-password');

// GET /account - for list of accounts
$res = $client->get('account');
var_dump($res->json());
```

You should see the JSON dumped out for the accounts endpoint. Feel free to make any other requests you want.

Be sure to [**read the OpenX API v4 Documentation**](http://docs.openx.com/api/)!

### Making HTTP Requests

[](#making-http-requests)

The OpenX client proxies all normal get/post/put/delete, etc. requests through and automatically adds the required `Cookie` header before sending the request.

```
// Makes normal request with necessary Cookie header
$res = $client->get('account');
```

### Access to the Guzzle Client

[](#access-to-the-guzzle-client)

If you need to get the base Guzzle object to make any further requests or modifications, you can:

```
// Returns the main GuzzleHttp\Client object
$guzzle = $client->getClient();
```

Please note that if you do this, the required `Cookie` header will not be attached to your requests automatically, so you will need to do this yourself with `$client->getAuthCookie()`.

Using the Example
-----------------

[](#using-the-example)

Steps to run the provided example.php:

1. `composer install --dev`
2. `cp .env.example .env`
3. Edit `.env` to add oAuth consumer key and secret, user/pass, etc.
4. Run it: `php example.php`

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/91e638810bdebb850ff45cddc03c75b2ec2c768a6be8e56700bd21fb84a768ee?d=identicon)[mmoravac](/maintainers/mmoravac)

---

Top Contributors

[![mmoravac](https://avatars.githubusercontent.com/u/25376848?v=4)](https://github.com/mmoravac "mmoravac (7 commits)")

### Embed Badge

![Health badge](/badges/mmoravac-openx/health.svg)

```
[![Health](https://phpackages.com/badges/mmoravac-openx/health.svg)](https://phpackages.com/packages/mmoravac-openx)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

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