# VmosoApi.AttachmentApi

All URIs are relative to *https://www.vmoso.com/svc*

Method | HTTP request | Description
------------- | ------------- | -------------
[**getAttachments**](AttachmentApi.md#getAttachments) | **GET** /attachmentsV2/{objectID} | 
[**getAttachmentsByName**](AttachmentApi.md#getAttachmentsByName) | **GET** /attachmentsV2/getByName | 
[**getDuplicates**](AttachmentApi.md#getDuplicates) | **POST** /attachmentsV2/duplicate | 


<a name="getAttachments"></a>
# **getAttachments**
> GetAttachmentsResult getAttachments(objectID, opts)



Get a list of attachments.

### Example
```javascript
var VmosoApi = require('vmoso-api');
var defaultClient = VmosoApi.ApiClient.default;

// Configure API key authorization: vmoso_auth
var vmoso_auth = defaultClient.authentications['vmoso_auth'];
vmoso_auth.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//vmoso_auth.apiKeyPrefix['X-CV-Authorization'] = "Token"

var apiInstance = new VmosoApi.AttachmentApi()

var objectID = "objectID_example"; // {String} Vmoso ID.

var opts = { 
  'options': "options_example", // {String} Search criteria. Set sort_attr to either LAST_ACTIVITY_TIME or OBJECT_NAME. Set creator_filter to all, my, or shared.
  'pg': "pg_example", // {String} Pagination preferences.
  'format': "format_example" // {String} 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getAttachments(objectID, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **objectID** | **String**| Vmoso ID. | 
 **options** | **String**| Search criteria. Set sort_attr to either LAST_ACTIVITY_TIME or OBJECT_NAME. Set creator_filter to all, my, or shared. | [optional] 
 **pg** | **String**| Pagination preferences. | [optional] 
 **format** | **String**|  | [optional] 

### Return type

[**GetAttachmentsResult**](GetAttachmentsResult.md)

### Authorization

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

### HTTP reuqest headers

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

<a name="getAttachmentsByName"></a>
# **getAttachmentsByName**
> GetAttachmentsByNameResult getAttachmentsByName(objectID, options)



Get an attachment by file name.

### Example
```javascript
var VmosoApi = require('vmoso-api');
var defaultClient = VmosoApi.ApiClient.default;

// Configure API key authorization: vmoso_auth
var vmoso_auth = defaultClient.authentications['vmoso_auth'];
vmoso_auth.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//vmoso_auth.apiKeyPrefix['X-CV-Authorization'] = "Token"

var apiInstance = new VmosoApi.AttachmentApi()

var objectID = "objectID_example"; // {String} Vmoso ID of object.

var options = "options_example"; // {String} Specify a search_string that identifies the name of the attachment (such as welcome.docx) and a type_filter that specifies the type of content. The default content type is file.


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getAttachmentsByName(objectID, options, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **objectID** | **String**| Vmoso ID of object. | 
 **options** | **String**| Specify a search_string that identifies the name of the attachment (such as welcome.docx) and a type_filter that specifies the type of content. The default content type is file. | 

### Return type

[**GetAttachmentsByNameResult**](GetAttachmentsByNameResult.md)

### Authorization

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

### HTTP reuqest headers

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

<a name="getDuplicates"></a>
# **getDuplicates**
> GetDuplicatesResult getDuplicates(input)



Get duplicate attachments created by me and created by others.

### Example
```javascript
var VmosoApi = require('vmoso-api');
var defaultClient = VmosoApi.ApiClient.default;

// Configure API key authorization: vmoso_auth
var vmoso_auth = defaultClient.authentications['vmoso_auth'];
vmoso_auth.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//vmoso_auth.apiKeyPrefix['X-CV-Authorization'] = "Token"

var apiInstance = new VmosoApi.AttachmentApi()

var input = new VmosoApi.GetDuplicatesInput(); // {GetDuplicatesInput} The Vmoso ID and document name for which to find duplicates.


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getDuplicates(input, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **input** | [**GetDuplicatesInput**](GetDuplicatesInput.md)| The Vmoso ID and document name for which to find duplicates. | 

### Return type

[**GetDuplicatesResult**](GetDuplicatesResult.md)

### Authorization

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

### HTTP reuqest headers

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

