PHPackages                             openlrw/api-client - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. openlrw/api-client

ActiveLibrary[HTTP &amp; Networking](/categories/http)

openlrw/api-client
==================

PHP client for Apereo OpenLRW API

0.2.9(6y ago)2200ECL-2.0PHP

Since Apr 3Pushed 6y ago5 watchersCompare

[ Source](https://github.com/Apereo-Learning-Analytics-Initiative/OpenLRW-php-api-client)[ Packagist](https://packagist.org/packages/openlrw/api-client)[ Docs](https://github.com/Apereo-Learning-Analytics-Initiative/OpenLRW-php-api-client)[ RSS](/packages/openlrw-api-client/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)Dependencies (2)Versions (14)Used By (0)

OpenLRW - PHP Api Client
========================

[](#openlrw---php-api-client)

> The easiest way to implement OpenLRW into your PHP applications (the documentation is not finished)

Client aimed to request the OpenLRW API in an easy way but also to manipulate objects from these requests.

[![](https://camo.githubusercontent.com/894aebd9803b5a5603b5a647280eff538788ea144234669848e5f90ce66e5f0b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f41706572656f2d4c6561726e696e672d416e616c79746963732d496e69746961746976652f4f70656e4c52572d7068702d6170692d636c69656e742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572 "Scrutinizer Code Quality")](https://camo.githubusercontent.com/894aebd9803b5a5603b5a647280eff538788ea144234669848e5f90ce66e5f0b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f41706572656f2d4c6561726e696e672d416e616c79746963732d496e69746961746976652f4f70656e4c52572d7068702d6170692d636c69656e742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)[![stable version](https://camo.githubusercontent.com/817f295fddff9396fcba9b8a300999037af5c848e650cd4c832a73f32ab4e01b/68747470733a2f2f706f7365722e707567782e6f72672f6f70656e6c72772f6170692d636c69656e742f762f737461626c65)](https://camo.githubusercontent.com/817f295fddff9396fcba9b8a300999037af5c848e650cd4c832a73f32ab4e01b/68747470733a2f2f706f7365722e707567782e6f72672f6f70656e6c72772f6170692d636c69656e742f762f737461626c65)[![downloads counter](https://camo.githubusercontent.com/160bae23290907ee03557ad5fabab9907f784b099bed2a6db5cf47b4692e14ef/68747470733a2f2f706f7365722e707567782e6f72672f6f70656e6c72772f6170692d636c69656e742f646f776e6c6f616473)](https://camo.githubusercontent.com/160bae23290907ee03557ad5fabab9907f784b099bed2a6db5cf47b4692e14ef/68747470733a2f2f706f7365722e707567782e6f72672f6f70656e6c72772f6170692d636c69656e742f646f776e6c6f616473)

Requirements
------------

[](#requirements)

- PHP &gt;= 5.6

Install
-------

[](#install)

`$ composer require openlrw/api-client`

Usage
-----

[](#usage)

### Initialize the client

[](#initialize-the-client)

```
use OpenLRW\OpenLRW;

$client = new OpenLRW(URL, KEY, PASSWORD);
```

#### Check if the server is up

[](#check-if-the-server-is-up)

```
$isServerUp = OpenLRW::isUp();
```

### Generate a JSON Web Token

[](#generate-a-json-web-token)

```
OpenLRW::generateJwt();
```

### OneRoster objects

[](#oneroster-objects)

> All the OneRoster models are not yet implemented, send an issue to let us know if you need a new collection

#### Example of the basic functions with the User Collection

[](#example-of-the-basic-functions-with-the-user-collection)

> All the OneRoster models have those functions

```
// Get and edit a user
$user = User::find('foobar');
$user->status = 'active';
$user->save();

// Create a new user
$user = new User();
$user->sourcedId = 'foo';
$user->name = 'bar';
$user->status 'inactive';
$user->save();

// Delete a user
$user->delete(); /** or */ User::destroy('foo-bar');

// Get all the users
$users = Users::all();
```

### Some examples of the specific functions per class

[](#some-examples-of-the-specific-functions-per-class)

> Check the classes to know all those specific functions

```
/** Klass model */
$enrollments = Klass::enrollments($classId); // array
$events = Klass::events($classId); // array
// ...

/** Risk */
$latestRisk = Risk::latestByClassAndUser($classId, $userId); // Risk::class
// ...
```

### Generic usage

[](#generic-usage)

```
$user = OneRoster::httpGet('users/test2u'); // return an array

$jsonInArray = ['...'];
$response = OneRoster::httpPost('users', $jsonInArray);
```

### Helpers

[](#helpers)

Execute tests
-------------

[](#execute-tests)

> Since it is an API Client, you will have to edit the credentials in order to log onto the API

```
\vendor\bin\phpunit.bat --bootstrap vendor\autoload.php  tests\ApiClientTest.php
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

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

Recently: every ~27 days

Total

13

Last Release

2352d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7e5619979d5f913ebcef7316cd49a681b0cb939f8204b9255f315cab78fbdfbf?d=identicon)[xchopin](/maintainers/xchopin)

---

Top Contributors

[![xchopin](https://avatars.githubusercontent.com/u/15248061?v=4)](https://github.com/xchopin "xchopin (57 commits)")

---

Tags

analyticsapereoapiclientlearninglibrarylrsopenlrwphpapirestlrsOpenLRWLearning-Analytics

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/openlrw-api-client/health.svg)

```
[![Health](https://phpackages.com/badges/openlrw-api-client/health.svg)](https://phpackages.com/packages/openlrw-api-client)
```

###  Alternatives

[xeroapi/xero-php-oauth2

Xero official PHP SDK for oAuth2 generated with OpenAPI spec 3

1054.3M14](/packages/xeroapi-xero-php-oauth2)[cybercog/youtrack-rest-php

YouTrack REST API PHP Client.

37149.2k3](/packages/cybercog-youtrack-rest-php)[onesignal/onesignal-php-api

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com

34170.2k2](/packages/onesignal-onesignal-php-api)[ory/hydra-client

Documentation for all of Ory Hydra's APIs.

17435.9k](/packages/ory-hydra-client)[zenditplatform/zendit-php-sdk

PHP client for Zendit API

1204.3k](/packages/zenditplatform-zendit-php-sdk)[whatarmy/fedex-rest

New FedEx Rest API wrapper

2440.5k1](/packages/whatarmy-fedex-rest)

PHPackages © 2026

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