Forums

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

Create Tag using bitbucket rest api fails

Tejas Shah
Contributor
June 28, 2018

Hi 

 

I am trying to use the bitbucket rest api to create a tag in bitbucket. However I am getting the error

 

curl -X POST -k -H 'Authorization: Basic <<Authentication String>>' -i 'https://api.bitbucket.org/2.0/repositories/lv_digital/code-commerce/refs/tags' --data '{
"name":"5.17.0-eco-05",
"target":{
"hash":"eda5e9c5565c8b56b55672fc21e20068116df84b"
}
} '

I get the following error 

{"type": "error", "error": {"fields": {"": "expected a dictionary"}, "message": "Bad request"}}

 

I am unable to figure out anything wrong with the request.  

 

Regards

Tejas

1 answer

0 votes
Anton Perera July 1, 2018

Hi @Tejas Shah,
I'm not an expert with the Bitbucket API. But as I have understood and the knowledge with this link code seems to be correct.

https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/refs/tags#post

How about trying with the GET method as in the documentation.

(If it is an option for you in your case only. I mean if not you need this to be exactly on POST method)

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, jira cloud certification, managing jira projects, jira project administration, jira cloud exam, atlassian certification, agile project management, jira workflows, jira permissions, jira training, jira cloud skills, atlassian learning

Become a Certified Jira Service Project Expert 🦸🏻‍♂️

Validate your expertise in managing Jira Service Projects for Cloud. Master configuration, optimize workflows, and manage users seamlessly. Earn global 🗺️ recognition and advance your career as a trusted Jira Service management expert.

Get Certified! ✍️
AUG Leaders

Atlassian Community Events