Administration manual


To use plugin GLPI, you must :

activateAPI REST: this is done in the configuration>General> screen.API

  • URL API, a specific can be chosen. This is not necessarily the php file used to access the documentation (apirest.php). URL URL URL API
  • ActivateAPI Rest > Yes
  • Enable connection with external token > Yes

  • Add a customer toAPI : click on "Add a customer API". 
    • Active > Yes
    • Regenerate generates an identifier that constitutes the appToken to be entered in the configuration.

Have a user authorized to useAPI : a user created specifically for this connection is recommended.

  • Create a user in Administration > Users > add user
  • Once the user has been created, you need to generate his userToken by going to the user's preferences. Administration > Users, search for the user you've created and click on on identifier. In the Preferences section, you can generate this token as a remote access key.
  • This user must be able to search for users and search for all tickets.

The token generated under the remote access key is the userToken to be entered in the configuration.

Depending on the version of GLPI, you may see the following screen, in which case the usertoken to use is theAPI 

 

Here are a few commands for testing rights on the command line:

curl -X GET -H 'Content-Type: application/json' -H "Authorization: user_token Ak1icAj6Ftm7RMfgRjICopBg9Py2aZmU5LzI" -H "App-Token: fxX7VU64iDgYwnqFk6uoVqd1tiNEIna7UTH" 'https://gpilurl/glpi/apirest.php/initSession' -> returns a sessionToken

curl -X GET -H 'Content-Type: application/json' -H "Session-Token: cjj6klc3ctv3an85ltttmmois9" -H "App-Token: fxX7VU64iDgYwnqFk6uoVqd1tiNEIna7UTH" 'https://gpilurl/glpi/apirest.php/search/user?range\=0-1\&forcedisplay\[0\]\=1\&forcedisplay\[1\]\=2\&criteria\[0\]\[field\]\=8\\&criteria\[0\]\[searchtype\]\=contains\\&criteria\[0\]\[value\]\=1\'

Back to top

GLPI