Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Access contents of a private repository with API

novocien October 6, 2018

I need a simplest way to embed Bitbucket data into your own site. I would like to get raw contents of the most recent version of a file in a selected branch. Is it possible through the API?
If yes, is there a tutorial anywhere?
I have read Bitbucket API, bitbucket API v2 /repositories/{username}/{repo_slug}/ permissions problem, and REST APIs but have not found any definite explanation.

I would like:

  • to keep the repository private,
  • the simplest or not any authentication, preferably a secret URL

Let's assume my repository name is game, branch is beta, and the file characters.txt. How do I access /repositories/novocien/game/ characters.txt of beta?

Any help most appreciated.

1 answer

1 accepted

0 votes
Answer accepted
novocien October 19, 2018

In the meantime of waiting for an answer I figured it out myself, though never have I expected to spend two weeks on that. I put a file with an example and an answer to my repository.

Feel free to comment it here. Or, if you are an Atlassian developer, answer when does /2.0/repositories/{username}/{repo_slug}/refs/branches/{name} answer with `type:"named branch"` and when with `type:"commit"`

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events