truly-systems / glpi-sdk-python

GLPI SDK writen in Python.
Apache License 2.0
22 stars 21 forks source link

Update GET header API Token for new GLPI versions #30

Open Tedezed opened 5 years ago

Tedezed commented 5 years ago

Solution to error App token in new version of GLPI: ERROR_WRONG_APP_TOKEN_PARAMETER

Custom example code, dodge TypeError: cannot concatenate 'str' and 'tuple' objects'

import os
from glpi import GLPI
import json

url = "https://glpi.example.com/apirest.php"
user = None
password = None
token = "XXXXXXXXXXXXXXXX"

glpi = GLPI(url, token, token)
glpi.kill()
print glpi.get('getMyProfiles')