Hi everyone,
I'm trying to automate some Bitbucket tasks using the REST API and repository access tokens, but I'm having some issues.
Use Case:
I am building a documentation project that will store files on Bitbucket, I need scoped access tokens that will have no access to any other repo on the same workspace. with zero user interactions, because I will not use Bitbucket Oauth, I will be using Google's
What I'm trying to do:
Commit Changes: I want to be able to programmatically create or update files in my repository using the token, but I'm not sure how to structure the requests or what endpoints to use.
Delete Files: I also need to be able to delete files remotely using the API and the token.
What I've tried:
- I've created a repository access token with the
repository:write permission. - I've looked through the Bitbucket API documentation, but the examples mostly use personal access tokens or OAuth. ( source endpoints )
My Questions:
- Can someone provide specific examples (preferably in curl) of how to use a repository access token to:
- Commit new files to a repository
- Update existing files
- Delete files
Any help or guidance would be greatly appreciated!