# StorageFilesApi

All URIs are relative to *https://admin-api.connected.dev*

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**getFile**](#getfile) | **GET** /files/{fileId} | Get a stored file|
|[**getFiles**](#getfiles) | **GET** /files | List stored files|
|[**uploadFile**](#uploadfile) | **POST** /files | Upload a file from a data URI|

# **getFile**
> UploadFile200Response getFile()

Returns the details of a single uploaded file by ID; requires \"read\" permission on \"storage\".

### Example

```typescript
import {
    StorageFilesApi,
    Configuration
} from '@connectedxm/admin-sdk';

const configuration = new Configuration();
const apiInstance = new StorageFilesApi(configuration);

let fileId: string; //The file identifier (default to undefined)

const { status, data } = await apiInstance.getFile(
    fileId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **fileId** | [**string**] | The file identifier | defaults to undefined|


### Return type

**UploadFile200Response**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth), [OrganizationId](../README.md#OrganizationId)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Successful response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **getFiles**
> GetFiles200Response getFiles()

Returns a paginated list of uploaded files for the organization, optionally filtered by source and searched/ordered; requires \"read\" permission on \"storage\".

### Example

```typescript
import {
    StorageFilesApi,
    Configuration
} from '@connectedxm/admin-sdk';

const configuration = new Configuration();
const apiInstance = new StorageFilesApi(configuration);

let source: string; //Filter by source (optional) (default to undefined)
let page: number; //Page number (optional) (default to 1)
let pageSize: number; //Number of items per page (optional) (default to 25)
let orderBy: string; //Field to order by (optional) (default to undefined)
let search: string; //Search query (optional) (default to undefined)

const { status, data } = await apiInstance.getFiles(
    source,
    page,
    pageSize,
    orderBy,
    search
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **source** | [**string**] | Filter by source | (optional) defaults to undefined|
| **page** | [**number**] | Page number | (optional) defaults to 1|
| **pageSize** | [**number**] | Number of items per page | (optional) defaults to 25|
| **orderBy** | [**string**] | Field to order by | (optional) defaults to undefined|
| **search** | [**string**] | Search query | (optional) defaults to undefined|


### Return type

**GetFiles200Response**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth), [OrganizationId](../README.md#OrganizationId)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Successful response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **uploadFile**
> UploadFile200Response uploadFile(uploadFileRequest)

Uploads a file encoded as a base64 data URI directly to storage and records it, tagging it with the given source (\"admin\" or \"response\") and optional name, requiring create permission on storage.

### Example

```typescript
import {
    StorageFilesApi,
    Configuration,
    UploadFileRequest
} from '@connectedxm/admin-sdk';

const configuration = new Configuration();
const apiInstance = new StorageFilesApi(configuration);

let uploadFileRequest: UploadFileRequest; //

const { status, data } = await apiInstance.uploadFile(
    uploadFileRequest
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **uploadFileRequest** | **UploadFileRequest**|  | |


### Return type

**UploadFile200Response**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth), [OrganizationId](../README.md#OrganizationId)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Successful response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

