# File

**Beta:**
Salaxy API v04 is in beta: it may change, and it is not used in production yet. Build on v03, the current version.

User-specific files and other files related functionality: Image processing, preview etc.

Salaxy API v04 (beta), **Finland only**. 6 operations. Interactive version: [REST API reference](https://code.salaxy.com/reference/rest-api-v04.md). Machine-readable: [OpenAPI document](https://code.salaxy.com/openapi/salaxy-04.json).

**The reference wins:**
These pages are generated from the OpenAPI document. If a guide and this reference disagree about a field, follow the reference. Error responses are not in the document — see [Errors](https://code.salaxy.com/reference/errors.md).

## `GET /v04/api/files`

**Returns list of files for the current owner.**

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `$search` | query | string |  |  |
| `$filter` | query | string |  | Specifies the logic to pull back a subset of records. |
| `$orderby` | query | string |  | Specifies the values used to sort the collection of entries. |
| `$select` | query | string |  | The $select system query option allows the clients to requests a limited set of properties for each entry. |
| `$top` | query | number |  | Specifies the subset of entries by count. |
| `$skip` | query | number |  | Specifies the count of entries to skip. |
| `$count` | query | boolean |  | Indicates whether or not to include a total entry count. |

Response: `PageResultOfFileListItem`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api-v04.md#tag/file/GET/v04/api/files)

## `GET /v04/api/files/{id}`

**Gets a single object based on identier**

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string | yes | Unique identifier for the object |

Response: `BlobFile`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api-v04.md#tag/file/GET/v04/api/files/{id})

## `GET /v04/api/files/{id}/content`

**Gets the content for a single file.**

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string | yes |  |

Response: `string`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api-v04.md#tag/file/GET/v04/api/files/{id}/content)

## `GET /v04/api/files/type/{type}`

**Gets all the Files of specific type for this user.**

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `type` | path | BlobFileType | yes |  |

Response: `BlobFile[]`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api-v04.md#tag/file/GET/v04/api/files/type/{type})

## `GET /v04/api/files/{id}/stream`

**Gets the file stream / blob for a single file**

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string | yes |  |

Response: `string`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api-v04.md#tag/file/GET/v04/api/files/{id}/stream)

## `GET /v04/api/files/{id}/preview`

**Gets the preview image (currently always PNG) for the file, if available.**

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string | yes | Identifier of the file that potentially has preview |

Response: `string`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api-v04.md#tag/file/GET/v04/api/files/{id}/preview)
