We need help. Set Downtime for service . Rest APi

Dear Team, we have a problem. We want to cotrol our downtime via Rest Api. We would like to start / stop one service on the host.
We call the scheduler and returns with xxx-status_code=204.
What could be the problem.
Thank you in advance,
Robert Rabb
API_URL=“https://$HOST_NAME/$SITE_NAME/check_mk/api/1.0”
The Code:
out=$(
curl -vv
–request POST
–write-out “\nxxx-status_code=%{http_code}\n”
–header “Authorization: Bearer $USERNAME $PASSWORD”
–header “Accept: application/json”
–header “Content-Type: application/json”
–data ‘{
“comment”: “Securit_ updates”,
“downtime_type”: “service”,
“duration”: 3600,
“end_time”: “2022-03-31T11:30:28Z”,
“host_name”: “ourhost”,
“recur”: “hour”,
“service_descriptions”: [
“CPU utilization”
],
“start_time”: “2022-03-31T11:22:28Z”
}’
“$API_URL/domain-types/downtime/collections/service”)

Hi @rabbrobert
It’s expected to get http code 204.
Can’t you see your downtime in your scheduled downtimes either ?
Cheers,

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.