nateritter/atrium-php

A PHP wrapper for the MX Atrium API.

Installs: 1 318

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:project

v0.1.2 2018-12-01 22:43 UTC

This package is auto-updated.

Last update: 2024-04-29 03:21:33 UTC


README

A PHP wrapper for the MX Atrium API. In order to make requests, you will need to sign up for the MX Atrium API and get a MX-API-KEY and a MX-CLIENT-ID.

Installation

Use Composer or Yarn to add the library to your application:

composer install nateritter/atrium-php

or

yarn add nateritter/atrium-php

Usage

Use the atrium module in your source code with the following

use NateRitter\AtriumPHP\AtriumClient;

Then configure your instance with the following. (The ENVIRONMENT will be either vestibule.mx.com for the development environment or atrium.mx.com for the production environment.)

$atriumClient = new AtriumClient('ENVIRONMENT', 'YOUR_MX_API_KEY', 'YOUR_MX_CLIENT_ID');

Then start using class methods to make calls to the Atrium API for data. See the full Atrium documentation for more details.

# use AtriumClient wrapper class
use NateRitter\AtriumPHP\AtriumClient;

# Configure AtriumClient
$atriumClient = new AtriumClient('ENVIRONMENT', 'YOUR_MX_API_KEY', 'YOUR_MX_CLIENT_ID');

# Now begin making Atrium calls
$atriumClient->createUser(['identifier' => 'UniqueID']); # Create a user, etc...

Examples

The /examples directory contains various workflows and code snippets. You will first need to modify the line shown below in each example with the environment, YOUR-MX-API-KEY, and YOUR-MX-CLIENT-ID before running.

$atriumClient = new AtriumClient('ENVIRONMENT', 'YOUR_MX_API_KEY', 'YOUR_MX_CLIENT_ID');