I'm facing an issue with our custom integration that is designed to fetch the list of repositories, pull requests, and commits. The calls are made with a token generated using OAuth consumer authorised by an admin user.
I am able to retrieve the list of repositories and pull requests successfully, but when attempting to fetch the commit data, in some cases I receive a 404 error with the message "The source or destination could not be found."
Here's a description of the issue I'm encountering, highlighting the steps and relevant details:
- The custom integration uses OAuth consumers to authorize access for admin users.
- The purpose of the custom integration is to gather the repositories, pull requests, and commits data of third party workspaces (so the specific setup of those workspaces are unknown).
- The admin token generated from OAuth has the following scopes:
account, pullrequest, issue, webhook, and team. - The first two API calls to fetch repositories and pull requests data work as expected, returning the desired data.
- When attempting to fetch the commit data (third call), a 404 error is encountered, with the message "The source or destination could not be found."
Steps Taken to Solve the Problem:
I have attempted the following steps to resolve the issue:
- Double-checked the API call URLs to ensure they are valid and correspond to the proper endpoints.
- Verified the admin token permissions to make sure it has the required access rights to fetch commit data.
- Looked through Bitbucket's API documentation for any necessary changes in query parameters or requirements for fetching commit data.
- Ensured that the OAuth consumer is properly configured for admin users.
Unfortunately, after trying the above troubleshooting steps, the problem persists.
The API call URL format is: https://api.bitbucket.org/2.0/repositories/<workspace-name>/<repository-name>/pullrequests/<pullrequet-id>/commits?pagelen=10
Screenshots:
To provide more context, I've included the following screenshot for OAuth consumer permissions:

I would appreciate any guidance or suggestions from the community regarding the possible causes of this issue and how it might be resolved. Are there any additional steps I should take to further troubleshoot the problem, or any known issues that could be causing such an error when using OAuth consumers for admin users?
Thank you in advance for your help!