You are not logged in.
Pages: 1
I tried to do a PutAsync through my C# program to make the ticket assigned to a specific person, i've done this:
HttpResponseMessage response = await client.PutAsync("apirest.php/Ticket/", contentString);
My contentString goes with this:
"{\"input\":{\"tickets_id\":8316,\"users_id\":10,\"type\":\"2\"}}"
When i do this Put it says OK, but doesn't appear the person to who i assigned it in the interface, what is wrong?
Last edited by NicolasSousa (2018-04-03 11:44:23)
Offline
you're trying to add user to "Ticket". you should add user to "Ticket_User"
try this
$ticket_id="MyTicketID";
$user_id="IdOfTheTechnician";
$input='{ "input": {"tickets_id": '.$ticket_id.' ,"users_id": '.$user_id.',"type": "2","use_notification": "1"}}';
$url=$api_url . "/Ticket/".$ticket_id."/Ticket_User/";
Trouver la panne avant de réparer...
GLPI10.0.16 (ubuntu 22.04 PHP8.1 Mariadb10.6 ) plugins : comportements 2.7.3 reports 1.16.0 formcreator 2.13.9, datainjection 2.13.5 fields 1.21.9
Offline
client.PutAsync($"apirest.php/Ticket/{ticketUpdate.tickets_id}/Ticket_User/", contentString);
I've done just like you said, it says OK but still not appearing!
Last edited by NicolasSousa (2018-04-03 12:30:21)
Offline
Found it, instead of a Put I should do a Post.
It's Working now, thank you
Offline
Pages: 1