This is a quick example of making an authenticated call to Bitbucket using an OAuth 2 Authorization token. The token is from a 'client_credentials' grant, which allows for server-to-server API calls in high-trust situations. (I'm using it for internal access to our own Git repos hosted on Bitbucket)
You'll need an .env
file with CLIENT_ID, CLIENT_SECRET and TEAM to make this work.