I have looked through the documentations and Questions/Discussions on this forum, and yet wasn't able to create a bitbucket branch using the API
I've tried exactly what the documentation suggests:
curl -X POST -s \
--url "https://api.bitbucket.org/2.0/repositories/$WORKSPACE/$REPO_NAME/refs/branches" \
--header 'Accept: application/json' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
-d '{ "name" : "test", "target" : { "hash" : "develop" } }'
and it returns me the error:
{"type": "error", "error": {"message": "Bad request", "fields": {"name": "required key not provided", "target": "required key not provided"}}}
and I've also tried:
curl -X POST -s \
--url "https://api.bitbucket.org/2.0/repositories/$WORKSPACE/$REPO_NAME/src/" \
-F "branch=test" \
--header 'Accept: application/json' \
--header "Authorization: Bearer $ACCESS_TOKEN"
as mentioned in this discussion:
and got the errors:{"type":"error","error":{"message":"Something went wrong","id":"db9155a6a32946e99dbc2d9201a9dd57"}}
{"type":"error","error":{"message":"Something went wrong","id":"153531f483bb4baf90ad8968311670da"}}
{"type":"error","error":{"message":"Something went wrong","id":"aa3bd7c29ad44b559a4c450e2e2db7f6"}}
Can anyone help me with this?
Confirmation that your end is working is also appreciated.
edit: Spelling