You are not logged in.
Hi, I was looking at the documentation for the API in the version 9+.
I can`t find the procedure to create a ticket manually through the API.
I am not sure if I should use CreateItems(https://fossies.org/dox/glpi-9.1.3/classAPI.html#ac7f13f8b6f29aa2ac95226eecb6f1fd6) or CreateTicket(https://fossies.org/dox/glpi-9.1.3/classTicketRecurrent.html#acd62a67b699bec6f0223c0de9153562b).
More information about what exactly I am trying to do:
We have an homemade .NET app. We want to use the GLPI`s API inside our custom APP to create tickets. At the same time, we would like to fill the ticket's basic information (title, description, watchers, assigned, few more) - nothing too fancy
May someone provide me few hints/advice to do this ?
Thank you
Note: Github issue link
Last edited by hypemonkey (2017-06-05 15:59:45)
Offline
May I have some help on this? It would be greatly appreciated!
thx
Last edited by hypemonkey (2017-06-06 14:31:38)
Offline
You must use http://localhost/glpi91/apirest.php/#add-items
CentOS 6.5 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6 - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)
Offline
Hi, thank you for the suggestion. I have a problem, I am stuck on initSession...
here's my code:
Dim wHeader As WebHeaderCollection = New WebHeaderCollection()
wHeader.Clear()
wHeader.Add("Authorization: user_token xxx")
wHeader.Add("App-Token: xxx")
Dim sUrl As String = "http://glpi/apirest.php/initSession/"
Dim wRequest As HttpWebRequest = DirectCast(WebRequest.Create(sUrl), HttpWebRequest)
wRequest.ContentType = "application/json"
wRequest.Headers = wHeader
wRequest.Method = "GET"
Dim wResponse As HttpWebResponse = DirectCast(wRequest.GetResponse(), HttpWebResponse)
When I run this code, it stuck on wRequest.GetResponse() and eventually, the request just time out... Any idea ?
Thx !
Last edited by hypemonkey (2017-06-12 19:17:22)
Offline
Hi,
did youy try :
Dim sUrl As String ="http://glpi/apirest.php/initSession/?Content-Type=%20application/json&app_token=".$app_token ."&user_token=".$user_token"
Trouver la panne avant de réparer...
GLPI10.0.10 (ubuntu 22.04 PHP8.1 Mariadb10.6 ) plugins : comportements 2.7.2 reports 1.16.0 formcreator 2.13.8, datainjection 2.13.4 fields 1.21.6
Offline
Thank you for the tip! I just tried it in the browser directly. It look like the page don't load (load infinitely). Maybe I am missing a config in GLPI ?
Note: I can see the log in GLPI: 9224588 2017-06-12 16:02 Enpoint 'initSession' called by xx.xx.xx.xx
The server just return nothing...
Really weird
Last edited by hypemonkey (2017-06-12 22:07:34)
Offline
hi,
check :"http://localhost/glpi/apirest.php" you should get api help page.
setup>general>API(tab)
check if api is active,
check if authentication with user token is active
check if your client ip is allowed.
Trouver la panne avant de réparer...
GLPI10.0.10 (ubuntu 22.04 PHP8.1 Mariadb10.6 ) plugins : comportements 2.7.2 reports 1.16.0 formcreator 2.13.8, datainjection 2.13.4 fields 1.21.6
Offline
I can see I get the session token from the url you said. But, it is really really slow to get a response (10 mins). It just make no sense... Any idea why it is slow like this ?
Thx !
Offline
Hi, I wonder if I may get some help on this... InitSession is extremely slow... Thx !
Offline