Skip to content

ajsb85/php-library-glpi

 
 

Repository files navigation

GLPI API Client Library for PHP

GLPI banner

License Follow twitter Project Status: WIP Telegram Group Conventional Commits

GLPI (Gestionnaire Libre de Parc Informatique) is a free IT Asset Management, issue tracking system and service desk solution. This open source software is written in PHP.

It helps companies to manage their information system, since it's able to build an inventory of all the organization's assets and to manage administrative and financial tasks.

Table of Contents

Synopsis

This library specifically designed for PHP, features several functionalities common to all GLPI APIs, for example:

  • HTTP transport to APIs
  • Error handling
  • Authentication
  • JSON parsing
  • Batching

You will be able to call to all the methods that belong to the GLPI REST API, for more information visit the project's website.

Build Status

Release channel Beta Channel
Travis build Travis build

Installation

composer require glpi-project/rest-api-client

Code examples

It's easy to implement, as you see in the following example:

use GlpiProject\API\Rest\Client;
use GuzzleHttp\Client as HttpClient;

// Instanciate the API client
$client = new Client(new HttpClient(), 'http://localhost/glpi/apirest.php/');

// Authenticate
if (!$client->initSessionByCredentials('glpi', 'glpi')) {
   die('failed to authenticate');
}

// The client handles the session token for you (app token not yet supported)

// do something
try {
   $response = $client->computer('post', ['name' => 'computer 0001']);
} catch (\Exception $e) {
   // Handle here HTTP >= 400
}

Documentation

We maintain a detailed documentation of the project in the project's website.

Versioning

In order to provide transparency on our release cycle and to maintain backward compatibility, Flyve MDM is maintained under the Semantic Versioning guidelines. We are committed to following and complying with the rules, the best we can.

See the tags section of our GitHub project for changelogs for each release version of Flyve MDM. Release announcement posts on the official Teclib' blog contain summaries of the most noteworthy changes made in each release.

Contact

For notices about major changes and general discussion of Flyve MDM development, subscribe to the /r/FlyveMDM subreddit. You can also chat with us via IRC in #flyve-mdm on freenode or @flyvemdmdev on Telegram.

Contribute

Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing and then check out one of our issues in the Issues Dashboard.

Copying

  • Name: Flyve MDM is a registered trademark of Teclib'.
  • Code: you can redistribute it and/or modify it under the terms of the GNU General Public License (GPLv3).
  • Documentation: released under Attribution 4.0 International (CC BY 4.0).

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%