gentlemen, I’m trying to create a call in GLPI through the API provided by the tool. The documentation asks you to do the following:
curl -X POST -H ‘Content-Type: application/json’ -H “Session-Token: xxxxxxxx” -d ‘{“input”: {“name”: “Ticket Name”, “content”: “Ticket Desc”}}’ ‘http://glpiserver/apirest.php/Ticket/’
the URL is: http://xxx/apirest.php/Ticket/
for the input:
name: ticket title
content: ticket description
itilcategories_id: ticket category id
type: ticket type id
locations_id : location id
you get session token from initsession:
$ curl -X GET
-H ‘Content-Type: application/json’
-H “Authorization: Basic base64({login}:{password})”
-H “App-Token: f7g3csp8mgatg5ebc5elnazakw20i9fyev1qopya7”
‘http://xxx/apirest.php/initSession’
my difficulty is in the parameters below:
for the input:
name: ticket title
content: ticket description
itilcategories_id: ticket category id
type: ticket type id
locations_id : location id
I did it this way, but it returns a message I think I must be doing something wrong but I don’t know how it should be, can someone help me?