src Resources

Overview

You can use the Bitbucket src resource to browse directories and view files. This is a read-only resource.

GET a list of repo source

Gets a list of the src in a repository. You must supply the following parameters:

Parameter Description
accountname A team or individual account name.
repo_slug The repository's name.
revision A value representing the revision or branch to list.
path The path can be a filename or a directory path. If path ends with / it is interpreted as a directory and returns a list.
https://api.bitbucket.org/1.0/repositories/{accountname}/{repo_slug}/src/{revision}/{path}
  Click to view the data returned on success...

GET raw content of an individual file

Gets information about an individual file. This method returns the file's size and contents.  If the file is encoded, this method returns the files encoding; Currently, Bitbucket supports only base64 encoding. You must supply the following parameters:

Parameter Required Description
accountname Yes A team or individual account name.
repo_slug Yes The repository's name.
revision Yes A value representing the revision or branch to list.
path Yes The path can be a filename or a directory path. If path ends with / (forward slash), Bitbucket interprets the path as a directory and returns a list.

Supply a path value whose end node is a file name.

https://api.bitbucket.org/1.0/repositories/{accountname}/{repo_slug}/raw/{revision}/{path}
  Click to view the data returned on success...

Was this helpful?

Thanks for your feedback!

Why was this unhelpful?

Have a question about this article?

See questions about this article

Powered by Confluence and Scroll Viewport