# PaperdbClient.FilesApi

All URIs are relative to *http://localhost:8880/*

Method | HTTP request | Description
------------- | ------------- | -------------
[**deleteFile**](FilesApi.md#deleteFile) | **DELETE** /person/{uuid}/file/{hash} | 
[**getFileContent**](FilesApi.md#getFileContent) | **GET** /file/{hash}/content | 
[**getFileMetadata**](FilesApi.md#getFileMetadata) | **GET** /person/{uuid}/file/{hash} | 
[**listPersonFiles**](FilesApi.md#listPersonFiles) | **POST** /person/{uuid}/files | 
[**replaceFileMetadata**](FilesApi.md#replaceFileMetadata) | **PUT** /person/{uuid}/file/{hash} | 
[**updateFileMetadata**](FilesApi.md#updateFileMetadata) | **PATCH** /person/{uuid}/file/{hash} | 


<a name="deleteFile"></a>
# **deleteFile**
> deleteFile(uuid, hash)



Delete a file and its content

### Example
```javascript
var PaperdbClient = require('paperdb-client');

var apiInstance = new PaperdbClient.FilesApi();

var uuid = "uuid_example"; // String | 

var hash = "hash_example"; // String | 

apiInstance.deleteFile(uuid, hash).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **uuid** | **String**|  | 
 **hash** | **String**|  | 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

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

<a name="getFileContent"></a>
# **getFileContent**
> getFileContent(hash)



Downlod a file&#39;s content

### Example
```javascript
var PaperdbClient = require('paperdb-client');

var apiInstance = new PaperdbClient.FilesApi();

var hash = "hash_example"; // String | 

apiInstance.getFileContent(hash).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **hash** | **String**|  | 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

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

<a name="getFileMetadata"></a>
# **getFileMetadata**
> FileDetails getFileMetadata(uuid, hash)



Get metadata for a specific file

### Example
```javascript
var PaperdbClient = require('paperdb-client');

var apiInstance = new PaperdbClient.FilesApi();

var uuid = "uuid_example"; // String | 

var hash = "hash_example"; // String | 

apiInstance.getFileMetadata(uuid, hash).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **uuid** | **String**|  | 
 **hash** | **String**|  | 

### Return type

[**FileDetails**](FileDetails.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="listPersonFiles"></a>
# **listPersonFiles**
> listPersonFiles(uuid, metadata)



### Example
```javascript
var PaperdbClient = require('paperdb-client');

var apiInstance = new PaperdbClient.FilesApi();

var uuid = "uuid_example"; // String | 

var metadata = new PaperdbClient.FileCreationDetails(); // FileCreationDetails | 

apiInstance.listPersonFiles(uuid, metadata).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **uuid** | **String**|  | 
 **metadata** | [**FileCreationDetails**](FileCreationDetails.md)|  | 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: multipart/form-data
 - **Accept**: application/json

<a name="replaceFileMetadata"></a>
# **replaceFileMetadata**
> replaceFileMetadata(uuid, hash, metadata)



### Example
```javascript
var PaperdbClient = require('paperdb-client');

var apiInstance = new PaperdbClient.FilesApi();

var uuid = "uuid_example"; // String | 

var hash = "hash_example"; // String | 

var metadata = new PaperdbClient.FileCreationDetails(); // FileCreationDetails | 

apiInstance.replaceFileMetadata(uuid, hash, metadata).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **uuid** | **String**|  | 
 **hash** | **String**|  | 
 **metadata** | [**FileCreationDetails**](FileCreationDetails.md)|  | 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

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

<a name="updateFileMetadata"></a>
# **updateFileMetadata**
> updateFileMetadata(uuid, hash, metadata)



### Example
```javascript
var PaperdbClient = require('paperdb-client');

var apiInstance = new PaperdbClient.FilesApi();

var uuid = "uuid_example"; // String | 

var hash = "hash_example"; // String | 

var metadata = new PaperdbClient.FileDetailsDelta(); // FileDetailsDelta | 

apiInstance.updateFileMetadata(uuid, hash, metadata).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **uuid** | **String**|  | 
 **hash** | **String**|  | 
 **metadata** | [**FileDetailsDelta**](FileDetailsDelta.md)|  | 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

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

