The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

How to define a groups in JSON for Branch Restriction using python REST API ?

Karthikraj
November 2, 2022

I tried in cURL its working  But When I use it in same JSON format in python its showing 400. 

 

curl --request POST -u usename:AppPassword \
--url 'https://api.bitbucket.org/2.0/repositories/*****/******/branch-restrictions' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"kind": "restrict_merges",
"branch_match_kind": "glob",
"pattern":"develop",
"groups": [
{
"slug": "administrators",
"full_slug": "****:administrators",
"name": "Administrators",
"default_permission": "admin",
"account_privilege": "admin"
}]
}'

its worked.

_________________________________________________________

 

But python

requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://api.bitbucket.org/2.0/repositories/******/*******/branch-restrictions

 

Please help to solve this issue.

Thanks & Regards,

Karthikraj M

 

0 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events