I am trying to run the following script for tagging my commit -
curl https://api.bitbucket.org/2.0/repositories/{orgname}/{repo}/refs/tags -D- \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization:Basic {emailId:token encoded string}" \
-d \
"{
\"name\" : \"new-tag-name\",
\"target\" : {
\"hash\" : \"{full hash of the commit I am trying to tag}\",
}
}" \
The script returns the following response -
HTTP/2 401
server: nginx
www-authenticate: Basic realm="Bitbucket.org HTTP"
content-type: text/html; charset=utf-8
strict-transport-security: max-age=31536000; includeSubDomains; preload
Can someone please point out what I am doing wrong?