src Resources

Still need help?

The Atlassian Community is here for you.

Ask the community

Bitbucket Cloud v1 APIs are deprecated

Bitbucket Cloud REST API version 1 is deprecated effective 30 June 2018. All 1.0 APIs will be removed from the REST API permanently on 12 April 2019. Read the deprecation notice. Or you can jump right to the version 2.0 REST API documentation.

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...
{
  "node": "40e232b389b9",
  "path": "Readme",
  "data": "Favorite Quotes from bitbuckians\n--------------------------------\n\nThis page lists the favorite quotes from any bitbuckian that cares to\ncontribute. This is a family-oriented site, so only post stuff you are\ncomfortable showing to your family. If your family is seriously abnormal, my\ncondolences and I'm going to reject your sadly twisted pull request.\n\nPlease don't change another user's quote as I'll reject that as well. After\nall, some quotes a meaningful to the people who submit them. You are free to\nfix and/or improve the CSS or code if you like.\n\nNow using SSH\n",
  "size": 571
}

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...



Favorite Quotes from bitbuckians
--------------------------------

This page lists the favorite quotes from any bitbuckian that cares to
contribute. This is a family-oriented site, so only post stuff you are
comfortable showing to your family. If your family is seriously abnormal, my
condolences and I'm going to reject your sadly twisted pull request.

Please don't change another user's quote as I'll reject that as well. After
all, some quotes a meaningful to the people who submit them. You are free to
fix and/or improve the CSS or code if you like.

Now using SSH




Last modified on Jun 14, 2018

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.