Get a file
const url = 'https://example.com/v1/example/files/file?path=example';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://example.com/v1/example/files/file?path=example' \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The project ID of the space
Query Parameters
Section titled “Query Parameters”The file’s path in the space
Redirect to the file itself, rather than describing it.
Responses
Section titled “Responses”The file
object
The path the space’s document uses for the file.
The file’s key in the file store.
Where the file can be downloaded from.
Where in the space the file is used, e.g. entities.desk.banner.
The file’s size in bytes. Only given for a single file.
Only given for a single file.
Example generated
{ "path": "example", "key": "example", "url": "example", "usedBy": [ "example" ], "size": 1, "contentType": "example"}The file itself, with redirect
The body is invalid. issues describes what was wrong.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}The token is missing or invalid.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}The token has no access to this space.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}No item has this id.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}Too many requests. Retry after Retry-After seconds.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}Headers
Section titled “Headers”Seconds to wait before retrying
Something upstream failed.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}The space is moving between servers. Retry after Retry-After seconds.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}Headers
Section titled “Headers”Seconds to wait before retrying
Something upstream timed out.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}