Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events