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 :D
Is it possible to have some help on this? It would be greatly appreciated ! 馃
have a look to glpi forums, you might get some help
here some simple ticket
{
$titre='MyTitle';
$description='MyContent';
$ch = curl_init();
$url=glpi/apirest.php/Ticket/";
$fields='{
"input": {
"name": "' .$titre. '","requesttypes_id": "1","content": "'.$description.'","type": "1"
}
}';
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
$request_result = curl_exec($ch);
curl_close ($ch);
$obj = json_decode($request_result,true);
$ticket_id=$obj['id'];
}?>
Alright! Thx, I will take a look at this. (Good thing I speak french)
Closing fro now. Feel free to reopen if there really is an issue.
Most helpful comment
here some simple ticket
{
$titre='MyTitle';
$description='MyContent';
}';
}?>