silinternational/idp-id-broker-php-client

PHP client to interact with our IdP ID Broker's API: https://github.com/silinternational/idp-id-broker

4.3.2 2024-02-28 19:30 UTC

README

PHP client to interact with our IdP ID Broker's API.

This client is built on top of Guzzle, the PHP HTTP Client. Guzzle has a simple way to create API clients by describing the API in a Swagger-like format without the need to implement every method yourself. So adding support for more APIs is relatively simple.

Install

Installation is simple with Composer:

$ composer require silinternational/idp-id-broker-php-client

Usage

Example:

<?php

use Sil\Idp\IdBroker\Client\IdBrokerClient;

$idBrokerClient = new IdBrokerClient(
    'https://api.example.com/', // The base URI for the API.
    'DummyAccessToken', // Your HTTP header authorization bearer token.
    [
        'http_client_options' => [
            'timeout' => 10, // An (optional) custom HTTP timeout, in seconds.
        ],
    ]
);

$users = $idBrokerClient->listUsers();

User Information

Information about a user returned by this client (such as by getUser(...)) can include the following fields:

  • employee_id (string)
  • first_name (string)
  • last_name (string)
  • display_name (string)
  • username (string)
  • email (string)
  • active (string: 'yes' or 'no')
  • locked (string: 'yes' or 'no')

Tests

To run the unit tests for this, run make test.

Guzzle Service Client Notes