ethos-php

A PHP library to interact with the Ellucian Ethos API.

License GitHub issues GitHub top language Packagist PHP Version Support Codacy grade


Installation

composer require melonsmasher/ethos-php

API Docs

Complete API docs can be found here.

Features

As of now ethos-php has support for 316 models/routes. It supports nearly all Banner & Colleague models with the following feature set.

Features To Come

Usage/Examples

The example below demonstrates the fluent API, convenience methods, and control over pagination.

<?php

include_once 'vendor/autoload.php';

use MelonSmasher\EthosPHP\EthosClient;
use MelonSmasher\EthosPHP\Foundation\PersonsClient;

// Your API Key / Refresh Token
$secret = 'YourApiKey/RefreshToken';
// Create an authenticated Ethos session
$ethos = EthosClient::createSession($secret);
// Create a new Persons client using your Ethos session
$personsClient = new PersonsClient($ethos);
// Read the first page of persons
$page1 = $personsClient->read()->data();
// Move to the next page
$personsClient->nextPage();
// Read the second page
$page2 = $personsClient->read()->data();
// Set the page to the fourth page
$personsClient->setPage(4);
// Read the 4th page to an array
$page4 = $personsClient->read()->toArray();
// Move 1 page back to the 3rd
$personsClient->backPage();
// Read the 3rd page to a JSON string
$page3 = $personsClient->read()->toJson();
// Skip to the 6th page
$personsClient->nextPage(4);
// Read the 7th page
$page7 = $personsClient->read()->data();
// Skip back to the 5th page
$personsClient->backPage(2);
// Read the 5th page
$page5 = $personsClient->read()->data();

The example below demonstrates the ability to provide custom request parameters.

<?php

include_once 'vendor/autoload.php';

use MelonSmasher\EthosPHP\EthosClient;
use MelonSmasher\EthosPHP\Foundation\PersonsClient;

// Your API Key / Refresh Token
$secret = 'YourApiKey/RefreshToken';
// Create an authenticated Ethos session
$ethos = EthosClient::createSession($secret);
// Create a new Persons client using your Ethos session
$personsClient = new PersonsClient($ethos);
// Send a request with the `criteria` parameter filtering for a person with a colleaguePersonId of 9000001.
$data = $personsClient->read([
    'criteria' => '{"credentials":[{"type":"colleaguePersonId","value":"9000001"}]}'
])->data();      

Dev Setup

Install PHIVE

Install build tools

phive install

Install composer requirements

./composer install