Skip to content

Get a snippet's raw file

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

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.

encoded_id
required
string

The snippet id.

node_id
required
string

A commit revision (SHA1).

path
required
string

Path to the file.

workspace
required
string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

Returns the contents of the specified file.

Content-Disposition
string

Attachment

If the authenticated user does not have access to the snippet.

Media type application/json
Error

Base type for most resource objects. It defines the common type element that identifies an object’s type. It also identifies the element as Swagger’s discriminator.

object
type
required
string
error
object
message
required
string
detail
string
data

Optional structured data that is endpoint-specific.

object
key
additional properties
any
key
additional properties
any
Example generated
{
"type": "example",
"error": {
"message": "example",
"detail": "example",
"data": {}
}
}

If the file or snippet does not exist.

Media type application/json
Error

Base type for most resource objects. It defines the common type element that identifies an object’s type. It also identifies the element as Swagger’s discriminator.

object
type
required
string
error
object
message
required
string
detail
string
data

Optional structured data that is endpoint-specific.

object
key
additional properties
any
key
additional properties
any
Example generated
{
"type": "example",
"error": {
"message": "example",
"detail": "example",
"data": {}
}
}