Get

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

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

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

Request

REQUIRED SCOPES
WORKSPACE, REPOSITORY_READ
URL PARAMETERS
domainrequired string
The workspace domain.
pathrequired string
The file or directory location in the repository.
project_namerequired string
The name ID of the project.
GET PARAMETERS
revisionstring
Specifies the revision to return the contents of the commit.

Last modified on Sep 23, 2024

Example:

CURL
curl -X GET "https://api.buddy.works/workspaces/:domain/projects/:project_name/repository/contents/:path" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "Content-Type: application/json" \
EXAMPLE RESPONSE
{ "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" } ] }
STATUS
200 OK
LIMITS
X-Rate-Limit-Limit: 1 X-Rate-Limit-Remaining: 999