Since GLPI version 9.1 a REST API is available to extend functionalities and enable integrations with third-party solutions.

You will learn how to set it up in these tutorial.

Currently, you can use GLPI REST API with two of our developments:

You need at least 3 steps

Tutorial

1. Enable Rest API

First, head to: Setup > General > API

GLPI-API-Setup-1

There are 4 main settings there:

  1. URL of the API is one of the most important parameters you will need to setup your application. You won’t need to change it.
  2. Now, Enable REST API by setting the dropdown to YES.
  3. Then you have to choose if you’re going to use user credentials, a token or both of them (as in the screenshot above). Enable the ones you need and save the changes.

2. Add an API Client

By default, GLPI API is only allowed to be accessed from the same server.

We need to create at least an API client to grant our clients, access to it. So, let’s go back to our previous, API setup page, and click on the Add API Client button.

On this form, you can Enable multiple API Clients, just:

  1. Add a descriptive name
  2. Set active to YES.
  3. It’s not compulsory, but you should log every connection. You can choose between enabling log connections onto the GLPI log, or on a log file.
  4. Finally, you can filter access by IP.
  5. Save and you’re good to go, unless the app you’re using supports application token, in which case you will need to regenerate it and add it to the app setup. This is an optional extra security layer.
->  "Upload incomplete. Failed files" error when uploading a file to Gapp

3. The user APP Token (if you need it)

If your app needs it, as for our GLPI Reminders browser extension, one last step needs to be performed in order to get it working.

GLPI App-token setup

Go to your user profile (each user has to perform this step), and on the lower section Remote access keys, click on Regenerate and save.

Afterwards, you will have a new API token. You can copy it by clicking on the copy icon on the right. Then paste it on your software configuration.

If using GLPI Reminders, will look like this.

GLPI Reminders

And that’s it!

 

Pin It on Pinterest

Share This