Atrium-PHP
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
., (*1)
Installation
Use Composer or Yarn to add the library to your application:, (*2)
composer install nateritter/atrium-php
or, (*3)
yarn add nateritter/atrium-php
Usage
Use the atrium
module in your source code with the following, (*4)
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.), (*5)
$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., (*6)
# 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., (*7)
$atriumClient = new AtriumClient('ENVIRONMENT', 'YOUR_MX_API_KEY', 'YOUR_MX_CLIENT_ID');