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,141

Re: POST update not working properly

Did you try PUT instead of POST ?


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

Board footer

Powered by FluxBB