Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

does json for an annotations API call need to be in a specific format?

Omar Morales September 13, 2021

Hello,

I am trying to post my own test annotations to bitbucket by using the following (sanitized) curl command. Note: I left the actual json intact

curl --request PUT '<bitbucket-base-url>/rest/insights/1.0/projects/<project>/repos/<repo>/commits/<commit>/reports/<Report>/annotations/<externalID>' --header 'Content-Type: application/json' -H 'Authorization: Bearer <token>' --data '{"severity":"HIGH", "path":"/src/File.C", "line":100, "message":"Test Annotation"}'

I get no error message from my console when I run the command, also when I go to the following

<bitbucket-base-url>/rest/insights/1.0/projects/<project>/repos/<repo>/commits/<commit>/reports/<Report>/annotations

using my browser I can see my annotation there just fine. but when I try and go one step deeper and view the annotation itself using the externalID listed

<bitbucket-base-url>/rest/insights/1.0/projects/<project>/repos/<repo>/commits/<commit>/reports/<Report>/annotations/<externalID>

I get the following error message SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data

Does anyone see where the problem with my json is?

Seems like a pretty generic error message

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events