Details
-
Bug
-
Resolution: Invalid
-
Medium
Description
I'm working with private BitBucket:
https://bitbucket.custom.com
I'm trying to implement some scripts for automatic creation of some kind of pull requests.
I'm working with Python. I have the following code:
#!python from requests.auth import HTTPBasicAuth config = HTTPBasicAuth(username, b64decode(password)) session = config.session url = 'https://bitbucket.custom.com/rest/api/1.0/projects/MY/repos/REPO/pull-requests' json_data = {'source': {'repository': {'full_name': 'REPO'}, 'branch': {'name': 'master'}}, 'destination': {'branch': {'name': 'feature-1'}}, 'reviewers': [{'username': 'reviewers'}], 'description': 'Automatic merging branches via script', 'title': '[AUTO] Merge branches'} headers = {"Content-type": "application/json", "User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0"} session.post(url, data=dumps(json_data), headers=headers, **kwargs)
It exits with 403 code. What is wrong here?
P.S. Bitbucket v4.0.3