You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2017-10-31 13:57:10

catchvjay
Member
Registered: 2017-10-10
Posts: 3

POST update not working properly

Hi,

I am using 9.1.2 version and trying to automate comment update of a computer. As per documentation, I am using following command to update the asset.

curl -X POST -H 'Content-Type: application/json' -H "Session-Token: xxxx" -H "App-Token: xxxx" -d '{"input": {"comment": "IM234"}}' 'http://glpi.myhost.com/apirest.php/Computer/232'

Also tried using following command too.

curl -X POST -H 'Content-Type: application/json' -H "Session-Token: xxxx" -H "App-Token: xxxx" -d '{"input": {"id": 232, "comment": "IM234"}}' 'http://glpi.myhost.com/apirest.php/Computer/'

The issue is, in both cases it is creating new entry with new index id instead of updating the existing one with id 232. Can some one point out the problem here which is preventing the existing record update?

Appreciate your time.

Regards,
Vj

Offline

#2 2017-11-09 00:09:31

LaDenrée
HELPER
Registered: 2012-11-19
Posts: 6,287

Re: POST update not working properly

Did you try PUT instead of POST ?


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

#3 2024-10-30 14:21:31

fredericoferraz
Member
Registered: 2024-10-30
Posts: 2

Re: POST update not working properly

I'm having the same problem. I carried out the configuration within Postman, using PUT and PUSH, but I still cannot insert a new "comment" within the ticket. I can change the description, but this would not be feasible due to the breach of ticket integrity.



If you have another suggestion or solution, I would be grateful.

Offline

#4 2024-10-30 20:47:45

LaDenrée
HELPER
Registered: 2012-11-19
Posts: 6,287

Re: POST update not working properly

"Comment" is not related to tickets; do you mean followup or task ?


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

#5 2024-11-06 22:18:37

fredericoferraz
Member
Registered: 2024-10-30
Posts: 2

Re: POST update not working properly

Thanks... Work in Ticket/id_Ticket/ITILFollowup


God bless you

Offline

Board footer

Powered by FluxBB