Snippets

Get a snippet's raw file

Retrieves the raw contents of a specific file in the snippet. The Content-Disposition header will be "attachment" to avoid issues with malevolent executable files.

The file's mime type is derived from its filename and returned in the Content-Type header.

Note that for text files, no character encoding is included as part of the content type.

get/snippets/{workspace}/{encoded_id}/{node_id}/files/{path}

Request

  • Base URL
    https://api.bitbucket.org/2.0
  • URL
    https://api.bitbucket.org/2.0/snippets/{workspace}/{encoded_id}/{node_id}/files/{path}
  • Auth
    • OAuth 2
      Authorization code: https://bitbucket.org/site/oauth2/authorize
      Token URL: https://bitbucket.org/site/oauth2/access_token scopes: snippet
    • or HTTP basic
    • or API key in header Authorization

Response

Returns the contents of the specified file.

Changes

No recorded changes to this operation across all 15 revisions of this API.