Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,298,228
Community Members
 
Community Events
165
Community Groups

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

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
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,225 views 2 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you