I want to create a tag for a specific branch, but I have the following error:
{"errors":[{"context":null,"message":"Can not instantiate value of type [map type; class com.atlassian.stash.internal.rest.repository.RestCreateTagRequest, [simple type, class java.lang.String] -> [simple type, class java.lang.Object]] from JSON String; no single-String constructor/factory method","exceptionName":"org.codehaus.jackson.map.JsonMappingException"}]}== Info: Closing connection 0 == Info: schannel: shutting down SSL/TLS connection with code.waters.com port 443
I using this curl command for posting the tag:
curl -X POST -u <<USER>>:<<PASSWORD>> -H "Content-Type: application/json" -v --trace - -d """{"name":"TAG_CURL_TEST_01","target":{"hash":"dd0ad6f53a9ca318b1441ed1XXXXXXXX"}}""" https://HOSTNAME/bitbucket/rest/api/1.0/projects/{project-id}/repos/{repo-id}/tagsJson:
size 25 limit 25 isLastPage false values 0
id "refs/tags/NG930_WSM210_20220712_B15" displayId "NG930_WSM210_20220712_B15" type "TAG" latestCommit "c85f121e9841489949baa789a2090c37c2826485" latestChangeset "c85f121e9841489949baa789a2090c37c2826485" hash "2fef60e14fa60462e00673150b658cf6b910a841"
Community moderators have prevented the ability to post new answers.
Hi Vladut,
Welcome to the Bitbucket Cloud community!
Based on the request, you are wanting to create a tag in Bitbucket Cloud using our API endpoint.
The endpoint you are using is incorrect however, you will need to use the endpoint contained here:
https://developer.atlassian.com/cloud/bitbucket/rest/api-group-refs/#api-repositories-workspace-repo-slug-refs-tags-post
Hope this helps.
Cheers!
- Ben (Bitbucket Cloud Support)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.