Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-13759

HTTPError: 403 Forbidden for list of pull requests via API

    XMLWordPrintable

Details

    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

      Attachments

        Activity

          People

            Unassigned Unassigned
            f6ca606c0250 StrongBrain
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: