Hi, I’m trying to add a host into “host categories” in my centreon server using Rest API v1, but it seems to not work properly:
The command
curl --silent --location 'http://centreon.local/centreon/api/index.php?action=authenticate' --header 'centreon-auth-token: some_secret' --header 'Content-Type: application/json' --data '{
"object": "HC",
"action": "addmember",
"values": "mycategorie;my.host.lan"
}'
The result:
400Bad Request → "Bad parameters"
But going to the server and executing the command, it works.
centreon -u admin -p 'some_secret' -o HC -a addmember -v "mycategorie;my.host.lan"
centreon -u admin -p 'some_secret' -o HC -a getmember -v "mycategorie"
id;name
2787;my.host.lan
I’m missing something?
https://docs.centreon.com/docs/api/rest-api-v1/#host-categories
https://docs.centreon.com/docs/api/clapi/#addmember-and-setmember