Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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

Edited

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