Get

Returns the contents of the repository for the specified revision or HEAD.

Required scopes: WORKSPACE, REPOSITORY_READ

Resource URL

GET /workspaces/:domain/projects/:project_name/repository/contents/:path

URL Parameters

NameTypeDescription
domain
Required
StringThe workspace domain.
path
Required
StringThe file or directory location in the repository.
project_name
Required
StringThe name ID of the project.

GET Parameters

NameTypeDescription
revisionStringSpecifies the revision to return the contents of the commit.

Example

Request

GET https://api.buddy.works/workspaces/buddy/projects/company-website/repository/contents?revision=development

Sample Response

HTTP

Status: 200 OK
X-Rate-Limit-Limit: 1
X-Rate-Limit-Remaining: 999

JSON

{
  "url": "https://api.buddy.works/workspaces/buddy/projects/company-website/repository/contents/?revision=development",
  "html_url": "https://app.buddy.works/buddy/company-website/repository/content/branch/development",
  "contents": [
    {
      "url": "https://api.buddy.works/workspaces/buddy/projects/company-website/repository/contents/scss?revision=development",
      "html_url": "https://app.buddy.works/buddy/company-website/repository/content/branch/development/%2Fscss",
      "content_type": "DIR",
      "name": "scss",
      "path": "/scss"
    },
    {
      "url": "https://api.buddy.works/workspaces/buddy/projects/company-website/repository/contents/.gitignore?revision=development",
      "html_url": "https://app.buddy.works/buddy/company-website/repository/content/branch/development/.gitignore",
      "content_type": "FILE",
      "encoding": "base64",
      "size": 22,
      "name": ".gitignore",
      "path": ".gitignore",
      "content": "LmlkZWEvCi5EU19TdG9yZQpjc3MvCg=="
    },
    {
      "url": "https://api.buddy.works/workspaces/buddy/projects/company-website/repository/contents/public?revision=development",
      "html_url": "https://app.buddy.works/buddy/company-website/repository/content/branch/development/%2Fpublic",
      "content_type": "SUB_MODULE",
      "name": "public",
      "path": "/public"
    }
  ]
}

content_type can be either FILE, DIR, SYMLINK, or SUB_MODULE. encoding always set to base64

Last modified on April 26, 2022

Questions?

Not sure how to configure a pipeline for your process? Reach out on the live-chat or contact support

Get Started

Sign up for free and deploy your project in less than 10 minutes.