With a private repo on github, I can generate a "personal access token" and
curl https://<oauth-secret>:[email protected]/<me>/<repo>/master/<file> and get the content of the file. Is the same thing possible with bitbucket?
With a private repo on github, I can generate a "personal access token" and
curl https://<oauth-secret>:[email protected]/<me>/<repo>/master/<file> and get the content of the file. Is the same thing possible with bitbucket?
Oh hey, it turns out you can just use http(s) authentication.
curl --user <username>:<password> https://bitbucket.org/<username>/<repo>/raw/<file> It's a bit of a bigger security hole having a username and password in a script than a token (for which you can restrict permissions), but it gets the job done in this case.
According to OAuth on Bitbucket Cloud you need to write https://x-token-auth:{access_token}@bitbucket.org so that you are using the token as password instead of username.
Use OAuth token and Bitbucket api with access_token param:
https://api.bitbucket.org/2.0/repositories/{username}/{repo_slug}/src/master/{file}?access_token={access_token}
{"type": "error", "error": {"message": "Token is invalid or not supported for this endpoint."}}