/repositories/{username}/{repo_slug} endpoint not working when no username is defined.

XMLWordPrintable

    • 1
    • Severity 2 - Major
    • 27

      Summary:

      Manipulating the repository using the below API works except for the PUT method.

      That is, it is possible to READ and DELETE a repo using its UUID, but the update fails.

      The below API call using the team name or username and repository UUID works.

      curl --request PUT --url https://api.bitbucket.org/2.0/repositories/{accountName}/{repoUUID} -H "Content-Type: application/json" -d '\{"is_private": true,"fork_policy": "no_public_forks"}' -u username:app_password
      

      The below call with empty field and repository UUID does not work:

      curl --request PUT --url https://api.bitbucket.org/2.0/repositories/%7B%7D/{repoUUID} -H "Content-Type: application/json" -d '\{"is_private": true,"fork_policy": "no_public_forks"}' -u username:app_password 
      {"type": "error", "error": {"message": "No user with username \"{}\"."}}
      

      The below documentation says we can use empty field and repository UUID to make API calls.

      https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D#post

      https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D#post

      Workaround

      Call API using /repositories/{username}/{repo_slug} instead of using /repositories/{}/{repo_slug} 

            Assignee:
            Unassigned
            Reporter:
            Alexandre M (Inactive)
            Votes:
            6 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: