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
Guest
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: 4,157

Re: POST update not working properly

Did you try PUT instead of POST ?


Trouver la panne avant de réparer...
*GLPI 9.1.6+fusion9.1+1.1+behaviours1.5.0+reports+fields+appliances+pdf+badges+formcreator2.5.2 PHP7.0 Mariadb10
*GLPI 9.2.4(behaviours1.5.2+fusion9.2+1.0+applicatifs2.3.0+dashboard 0.8.9)hebergé sur serveur mutualisé.
*GLPI 9.3.1  en test (ubuntu 16.04 mariadb 10.2.4)

Offline

Board footer

Powered by FluxBB