You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creating a comment via the API requires two parameters in the request body: author and comment.
Creating a comment works just fine, this is an example how I print also the HTTP response code:
bob@bobs-mbp $ curl -w "\nHTTP Status: %{http_code}" -k -s -u icinga:icinga -H 'Accept: application/json' -X POST 'https://demo:5665/v1/actions/add-comment?service=demo%21disk' -d '{ "author": "icingaadmin", "comment": "This is a comment" }'
{"results":[{"code":200.0,"legacy_id":10.0,"name":"demo!disk!demo-1490607359-8","status":"Successfully added comment 'demo!disk!demo-1490607359-8' for object 'demo!disk'."}]}
HTTP Status: 200
When I omit one of the required parameters, lets say I don't set the author, the response I get tells me that something is wrong. However, the HTTP response code is still 200.
bob@bobs-mbp $ curl -w "\nHTTP Status: %{http_code}" -k -s -u icinga:icinga -H 'Accept: application/json' -X POST 'https://demo:5665/v1/actions/add-comment?service=demo%21disk' -d '{ "comment": "This is a comment" }'
{"results":[{"code":403.0,"status":"Comments require author and comment."}]}
HTTP Status: 200
The text was updated successfully, but these errors were encountered:
Creating a comment via the API requires two parameters in the request body:
author
andcomment
.Creating a comment works just fine, this is an example how I print also the HTTP response code:
When I omit one of the required parameters, lets say I don't set the
author
, the response I get tells me that something is wrong. However, the HTTP response code is still 200.The text was updated successfully, but these errors were encountered: