Error when deleting Host Objects from Director using curl

Hi everyone,
I am using director modele and so far I have succeeded with adding Hosts using curl command, this is my code:

Blockquote

curl -X POST -H ‘Accept: application/json’ -u ‘domain\username:password’ -d ‘{“object_name”: “testobj”,
“object_type”: “object”,
“address”: “1.0.0.1”,
“display_name”: “testobj”,
“imports”: “Linux-Host-Agent”,
“vars”: {
“os”: “linux”
}}’ ‘http://something.something.something/icingaweb2/director/host

Blockquote

Now, I am having an issue when trying to delete the Hosts using curl!

$ curl -X DELETE -H ‘Accept: application/json’ -u ‘domain\username:password’ -d ‘{“object_name”: “testobj”}’
http://something.something.something/icingaweb2/director/host
I get this result below
{
“error”: “Object is required”
}
I also tried this -d ‘{“object_name”: “testobj”, “object_type”: “object”}’ but I still get the same error :confused:
I would appreciate any help or advice
Thanks in advance

The Director API is different from the Icinga API and there for has different ways to object creation and deletion
Take a look at the Director API docs to see how you delete objects:

Thanks! I think I have crossed my eyes last night and have not seen the proper HTTP request for the deletion … now I see
DELETE director/host?name=apitest
Thanks again
cheers