You are not logged in.
I can pull date with a get, but when trying to post anything back using the api, I keep getting the response of:
["ERROR_BAD_ARRAY","input parameter must be an array of objects; view documentation in your browser at https//glpi.mydomain.net/apirest.php/#ERROR_BAD_ARRAY"]
I've tried this, along with the exact syntax listed in the api docs...
curl -X PUT -H 'Context-Type: application/json' -H "Session-Token: my-session-token" -H 'App-Token: my-app-token' 'http//glpi.mydomain.net/apirest.php/Computer/5380' -d '{"input": {"comment": "test"}}'
I had also tried encapsulating the data portion like this as seen in another response: {"input": [{"comment": "test"}]}
no matter what I try, I seem to get the same error.
Offline
Hello,
Did you try on POSTMAN to test your command ?
In Postman if i type this : (PUT) https://server/apirest.php/Computer/69/?expand_drodpowns=false&range=0-200&order=desc&session_token=37lgkfkii67ff248kt34XXXXX
Body => Raw (JSON)
{"input":{"comment":"test"}}
it's working well
Apps Android GLPI Management : https://play.google.com/store/apps/deta … fr.dmn.app
Site Web : http://mdu-tech.fr/
GLPI 9.5.5 sur IIS 10 / PHP 8 / MySQL
Offline
I'm not sure just what your getting at.
yes, I agree, it should work, but when posting agains GLPI, it does not.
Offline
POSTMAN is a tool where you can try your command (https://www.postman.com/)
When I check your command CURL I see that : 'Context-Type: application/json' but the documentation use this : 'Content-Type: application/json'
May be this part is wrong on your command.
Sorry but in my side I do only HTTP request
Apps Android GLPI Management : https://play.google.com/store/apps/deta … fr.dmn.app
Site Web : http://mdu-tech.fr/
GLPI 9.5.5 sur IIS 10 / PHP 8 / MySQL
Offline
Put is for updating data.
Use post to add .
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