# ClientDocumentsApi

All URIs are relative to *http://localhost:8889/api*

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**createDocument**](#createdocument) | **POST** /clients/{clientId}/documents | Create client document|
|[**getClientDocumentById**](#getclientdocumentbyid) | **GET** /clients/documents/{documentId}/metadata | Get client document|
|[**getClientDocumentFileById**](#getclientdocumentfilebyid) | **GET** /clients/documents/{documentId} | Download client document|
|[**getDocumentsByClientId**](#getdocumentsbyclientid) | **GET** /clients/{clientId}/documentsMetadata | Get all client documents|

# **createDocument**
> Document createDocument()


### Example

```typescript
import {
    ClientDocumentsApi,
    Configuration
} from './api';

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

let clientId: string; //The ID or encoded key of the client to be returned. (default to undefined)
let file: File; //The file to be attached for a client. (default to undefined)
let idempotencyKey: string; //Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. (optional) (default to undefined)
let name: string; //The name (title) of the attached file. (optional) (default to undefined)
let notes: string; //The description of the attached file. (optional) (default to undefined)

const { status, data } = await apiInstance.createDocument(
    clientId,
    file,
    idempotencyKey,
    name,
    notes
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **clientId** | [**string**] | The ID or encoded key of the client to be returned. | defaults to undefined|
| **file** | [**File**] | The file to be attached for a client. | defaults to undefined|
| **idempotencyKey** | [**string**] | Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. | (optional) defaults to undefined|
| **name** | [**string**] | The name (title) of the attached file. | (optional) defaults to undefined|
| **notes** | [**string**] | The description of the attached file. | (optional) defaults to undefined|


### Return type

**Document**

### Authorization

[basic](../README.md#basic)

### HTTP request headers

 - **Content-Type**: multipart/form-data
 - **Accept**: application/vnd.mambu.v2+json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**201** | Document created. |  -  |
|**400** | Bad request |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |
|**404** | Client not found. |  -  |

[[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)

# **getClientDocumentById**
> Document getClientDocumentById()


### Example

```typescript
import {
    ClientDocumentsApi,
    Configuration
} from './api';

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

let documentId: string; //The ID or encoded key of the client document to be returned. (default to undefined)

const { status, data } = await apiInstance.getClientDocumentById(
    documentId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **documentId** | [**string**] | The ID or encoded key of the client document to be returned. | defaults to undefined|


### Return type

**Document**

### Authorization

[basic](../README.md#basic)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/vnd.mambu.v2+json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Successfully returned the metadata of a client document. |  -  |
|**400** | Bad request |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |
|**404** | Client not found. |  -  |

[[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)

# **getClientDocumentFileById**
> File getClientDocumentFileById()


### Example

```typescript
import {
    ClientDocumentsApi,
    Configuration
} from './api';

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

let documentId: string; //The ID or encoded key of the client document to be returned. (default to undefined)

const { status, data } = await apiInstance.getClientDocumentFileById(
    documentId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **documentId** | [**string**] | The ID or encoded key of the client document to be returned. | defaults to undefined|


### Return type

**File**

### Authorization

[basic](../README.md#basic)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/vnd.mambu.v2+file


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Client document downloaded. |  * Content-Disposition - \&quot;The format is - attachment; filename&#x3D;\\\&quot;{fileName}.extension\\\&quot;\&quot;; <br>  * Content-Length - The size of the file. <br>  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |
|**404** | Client not found. |  -  |

[[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)

# **getDocumentsByClientId**
> Array<Document> getDocumentsByClientId()


### Example

```typescript
import {
    ClientDocumentsApi,
    Configuration
} from './api';

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

let clientId: string; //The ID or encoded key of the client to be returned. (default to undefined)
let offset: number; //Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results (optional) (default to undefined)
let limit: number; //Pagination, the number of elements to retrieve, used in combination with offset to paginate results (optional) (default to undefined)
let paginationDetails: 'ON' | 'OFF'; //Flag specifying whether the pagination  details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs (optional) (default to 'OFF')

const { status, data } = await apiInstance.getDocumentsByClientId(
    clientId,
    offset,
    limit,
    paginationDetails
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **clientId** | [**string**] | The ID or encoded key of the client to be returned. | defaults to undefined|
| **offset** | [**number**] | Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results | (optional) defaults to undefined|
| **limit** | [**number**] | Pagination, the number of elements to retrieve, used in combination with offset to paginate results | (optional) defaults to undefined|
| **paginationDetails** | [**&#39;ON&#39; | &#39;OFF&#39;**]**Array<&#39;ON&#39; &#124; &#39;OFF&#39;>** | Flag specifying whether the pagination  details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs | (optional) defaults to 'OFF'|


### Return type

**Array<Document>**

### Authorization

[basic](../README.md#basic)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/vnd.mambu.v2+json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Successfully returned the list of all client documents metadata. |  * Items-Limit - Pagination details, the requested page size <br>  * Items-Offset - Pagination details, the index of the first returned item <br>  * Items-Total - Pagination details, the total available items <br>  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |
|**404** | Client not found. |  -  |

[[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)

