# LogicalDocRestApi.DocumentApi

All URIs are relative to *https://localhost:8080/services/rest*

Method | HTTP request | Description
------------- | ------------- | -------------
[**addNote**](DocumentApi.md#addNote) | **POST** /document/addNote | Adds a new note for the given document
[**callDelete**](DocumentApi.md#callDelete) | **DELETE** /document/delete | Deletes a document
[**checkin**](DocumentApi.md#checkin) | **POST** /document/checkin | Check-in an existing document
[**checkout**](DocumentApi.md#checkout) | **POST** /document/checkout | Checkout a document
[**createAlias**](DocumentApi.md#createAlias) | **POST** /document/createAlias | Creates a new document alias
[**createDocument**](DocumentApi.md#createDocument) | **POST** /document/create | Creates a new document
[**createDownloadTicket**](DocumentApi.md#createDownloadTicket) | **POST** /document/createDownloadTicket | Creates a new download ticket
[**createPdf**](DocumentApi.md#createPdf) | **PUT** /document/createPdf | Creates the PDF conversion of the given document; if the PDF conversion was already created, nothing will happen
[**createThumbnail**](DocumentApi.md#createThumbnail) | **PUT** /document/createThumbnail | Creates the thumbail of the given document; if the thumbnail was already created, nothing will happen
[**deleteLink**](DocumentApi.md#deleteLink) | **DELETE** /document/deleteLink | Removes an existing link
[**deleteNote**](DocumentApi.md#deleteNote) | **DELETE** /document/deleteNote | Deletes a note
[**deleteVersion**](DocumentApi.md#deleteVersion) | **DELETE** /document/deleteVersion | Delete the version of a document
[**getAliases**](DocumentApi.md#getAliases) | **GET** /document/getAliases | Gets the aliases
[**getContent**](DocumentApi.md#getContent) | **GET** /document/getContent | Gets the document content
[**getDocument**](DocumentApi.md#getDocument) | **GET** /document/getDocument | Gets document metadata
[**getDocumentByCustomId**](DocumentApi.md#getDocumentByCustomId) | **GET** /document/getDocumentByCustomId | Gets document metadata by custom ID
[**getDocuments**](DocumentApi.md#getDocuments) | **GET** /document/getDocuments | Gets the metadata of a collection of document
[**getExtractedText**](DocumentApi.md#getExtractedText) | **GET** /document/getExtractedText | Gets the extracted text of a document
[**getLinks**](DocumentApi.md#getLinks) | **GET** /document/getLinks | Gets the links of a document
[**getNotes**](DocumentApi.md#getNotes) | **GET** /document/getNotes | Gets all the notes of a document
[**getRatings**](DocumentApi.md#getRatings) | **GET** /document/getRatings | Retrieves the different ratings of a focuments
[**getRecentDocuments**](DocumentApi.md#getRecentDocuments) | **GET** /document/getRecentDocuments | Gets the last modified documents
[**getResource**](DocumentApi.md#getResource) | **GET** /document/getResource | Gets the content of a resource
[**getVersionContent**](DocumentApi.md#getVersionContent) | **GET** /document/getVersionContent | Gets the document content by version
[**getVersions**](DocumentApi.md#getVersions) | **GET** /document/getVersions | Gets the versions
[**isReadable**](DocumentApi.md#isReadable) | **GET** /document/isReadable | Tests if a document is readable
[**link**](DocumentApi.md#link) | **POST** /document/link | Creates a link between two documents
[**list**](DocumentApi.md#list) | **GET** /document/list | Lists documents by folder
[**listDocuments**](DocumentApi.md#listDocuments) | **GET** /document/listDocuments | Lists documents by folder and filename
[**lock**](DocumentApi.md#lock) | **PUT** /document/lock | Locks a document
[**move**](DocumentApi.md#move) | **PUT** /document/move | Moves an existing document with the given identifier
[**promoteVersion**](DocumentApi.md#promoteVersion) | **PUT** /document/promoteVersion | Promotes an old version to the current default one
[**rateDocument**](DocumentApi.md#rateDocument) | **PUT** /document/rateDocument | Add/Update the user's vote for a document
[**reindex**](DocumentApi.md#reindex) | **POST** /document/reindex | Re-indexes a document
[**rename**](DocumentApi.md#rename) | **PUT** /document/rename | Renames the title of an existing document with the given identifier
[**replaceFile**](DocumentApi.md#replaceFile) | **POST** /document/replaceFile | Replace the file of a version
[**restore**](DocumentApi.md#restore) | **PUT** /document/restore | Restores a deleted document
[**saveNote**](DocumentApi.md#saveNote) | **POST** /document/saveNote | Adds a new note
[**sendEmail**](DocumentApi.md#sendEmail) | **POST** /document/sendEmail | Sends documents by email
[**setPassword**](DocumentApi.md#setPassword) | **POST** /document/setPassword | Password protect a document
[**unlock**](DocumentApi.md#unlock) | **PUT** /document/unlock | Unlocks the document
[**unprotect**](DocumentApi.md#unprotect) | **POST** /document/unprotect | Temporarily removes password protection
[**unsetPassword**](DocumentApi.md#unsetPassword) | **POST** /document/unsetPassword | Removes password protection
[**update**](DocumentApi.md#update) | **PUT** /document/update | Updates an existing document
[**upload**](DocumentApi.md#upload) | **POST** /document/upload | Uploads a document
[**uploadResource**](DocumentApi.md#uploadResource) | **POST** /document/uploadResource | Uploads a new resource of the document


<a name="addNote"></a>
# **addNote**
> WSNote addNote(docId, note)

Adds a new note for the given document



### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var docId = 789; // Number | Document ID

var note = "note_example"; // String | Text of the note to add


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.addNote(docId, note, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docId** | **Number**| Document ID | 
 **note** | **String**| Text of the note to add | 

### Return type

[**WSNote**](WSNote.md)

### Authorization

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

### HTTP request headers

 - **Content-Type**: application/x-www-form-urlencoded
 - **Accept**: application/json

<a name="callDelete"></a>
# **callDelete**
> callDelete(docId)

Deletes a document



### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var docId = 789; // Number | Document ID to delete


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.callDelete(docId, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docId** | **Number**| Document ID to delete | 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

<a name="checkin"></a>
# **checkin**
> checkin(docId, filename, filedata, opts)

Check-in an existing document

Performs a check-in (commit) operation of new content over an existing document. The document must be in checked-out status

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var docId = 56; // Number | The ID of an existing document to update

var filename = "filename_example"; // String | File name

var filedata = "/path/to/file.txt"; // File | File data

var opts = { 
  'comment': "comment_example", // String | An optional comment
  'release': "release_example" // String | Indicates whether to create or not a new major release of the updated document
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.checkin(docId, filename, filedata, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docId** | **Number**| The ID of an existing document to update | 
 **filename** | **String**| File name | 
 **filedata** | **File**| File data | 
 **comment** | **String**| An optional comment | [optional] 
 **release** | **String**| Indicates whether to create or not a new major release of the updated document | [optional] 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

 - **Content-Type**: multipart/form-data
 - **Accept**: text/plain, application/json, application/xml

<a name="checkout"></a>
# **checkout**
> checkout(opts)

Checkout a document

Performs the checkout operation on a document. The document status will be changed to checked-out

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var opts = { 
  'docId': 789 // Number | 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.checkout(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docId** | **Number**|  | [optional] 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

 - **Content-Type**: application/x-www-form-urlencoded
 - **Accept**: application/json

<a name="createAlias"></a>
# **createAlias**
> WSDocument createAlias(docId, folderId, type)

Creates a new document alias

Creates a new document alias for the given document inside a specified folder

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var docId = 789; // Number | Source document ID

var folderId = 789; // Number | Target folder ID

var type = "type_example"; // String | Type of the alias (use 'pdf' to create an alias to the PDF conversion)


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.createAlias(docId, folderId, type, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docId** | **Number**| Source document ID | 
 **folderId** | **Number**| Target folder ID | 
 **type** | **String**| Type of the alias (use 'pdf' to create an alias to the PDF conversion) | 

### Return type

[**WSDocument**](WSDocument.md)

### Authorization

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

### HTTP request headers

 - **Content-Type**: application/x-www-form-urlencoded
 - **Accept**: application/json

<a name="createDocument"></a>
# **createDocument**
> WSDocument createDocument(document, content)

Creates a new document

Creates a new document using the metadata document object provided as JSON/XML

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var document = "document_example"; // String | The document metadata provided as WSDocument object encoded in JSON/XML format

var content = "/path/to/file.txt"; // File | File data


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.createDocument(document, content, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **document** | **String**| The document metadata provided as WSDocument object encoded in JSON/XML format | 
 **content** | **File**| File data | 

### Return type

[**WSDocument**](WSDocument.md)

### Authorization

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

### HTTP request headers

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

<a name="createDownloadTicket"></a>
# **createDownloadTicket**
> 'String' createDownloadTicket(docId, maxDownloads, opts)

Creates a new download ticket

Creates a new download ticket to the original document or it's PDF conversion

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var docId = 789; // Number | Source document ID

var maxDownloads = 56; // Number | maximum number of downloads allowed

var opts = { 
  'suffix': "suffix_example", // String | can be null or 'conversion.pdf'
  'expireHours': 56, // Number | expiration time expressed in hours
  'expireDate': "expireDate_example" // String | exact expiration date expressed in the format yyyy-MM-dd
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.createDownloadTicket(docId, maxDownloads, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docId** | **Number**| Source document ID | 
 **maxDownloads** | **Number**| maximum number of downloads allowed | 
 **suffix** | **String**| can be null or 'conversion.pdf' | [optional] 
 **expireHours** | **Number**| expiration time expressed in hours | [optional] 
 **expireDate** | **String**| exact expiration date expressed in the format yyyy-MM-dd | [optional] 

### Return type

**'String'**

### Authorization

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

### HTTP request headers

 - **Content-Type**: application/x-www-form-urlencoded
 - **Accept**: application/json

<a name="createPdf"></a>
# **createPdf**
> createPdf(opts)

Creates the PDF conversion of the given document; if the PDF conversion was already created, nothing will happen



### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var opts = { 
  'docId': 789, // Number | 
  'fileVersion': "fileVersion_example" // String | 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.createPdf(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docId** | **Number**|  | [optional] 
 **fileVersion** | **String**|  | [optional] 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

<a name="createThumbnail"></a>
# **createThumbnail**
> createThumbnail(opts)

Creates the thumbail of the given document; if the thumbnail was already created, nothing will happen



### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var opts = { 
  'docId': 789, // Number | 
  'fileVersion': "fileVersion_example" // String | 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.createThumbnail(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docId** | **Number**|  | [optional] 
 **fileVersion** | **String**|  | [optional] 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

<a name="deleteLink"></a>
# **deleteLink**
> deleteLink(id)

Removes an existing link



### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var id = 789; // Number | ID of the link


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.deleteLink(id, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **Number**| ID of the link | 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

<a name="deleteNote"></a>
# **deleteNote**
> deleteNote(noteId)

Deletes a note



### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var noteId = 789; // Number | ID of the note to delete


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.deleteNote(noteId, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **noteId** | **Number**| ID of the note to delete | 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

<a name="deleteVersion"></a>
# **deleteVersion**
> 'String' deleteVersion(docId, opts)

Delete the version of a document

Deletes the version of a document using the document ID and version. You can not delete the latest version of a document. Returns the latest version of the document

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var docId = 789; // Number | Document ID

var opts = { 
  'version': "version_example" // String | 
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docId** | **Number**| Document ID | 
 **version** | **String**|  | [optional] 

### Return type

**'String'**

### Authorization

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

### HTTP request headers

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

<a name="getAliases"></a>
# **getAliases**
> [WSDocument] getAliases(docId)

Gets the aliases

Gets the aliases of the given document; returns an array of WSDocument that are aliases

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var docId = 789; // Number | The document ID


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docId** | **Number**| The document ID | 

### Return type

[**[WSDocument]**](WSDocument.md)

### Authorization

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

### HTTP request headers

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

<a name="getContent"></a>
# **getContent**
> DataHandler getContent(opts)

Gets the document content

Returns the content of a document using the document ID in input

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var opts = { 
  'docId': 789 // Number | 
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docId** | **Number**|  | [optional] 

### Return type

[**DataHandler**](DataHandler.md)

### Authorization

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

### HTTP request headers

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

<a name="getDocument"></a>
# **getDocument**
> WSDocument getDocument(opts)

Gets document metadata

Gets the document metadata

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var opts = { 
  'docId': 789 // Number | 
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docId** | **Number**|  | [optional] 

### Return type

[**WSDocument**](WSDocument.md)

### Authorization

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

### HTTP request headers

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

<a name="getDocumentByCustomId"></a>
# **getDocumentByCustomId**
> WSDocument getDocumentByCustomId(customId)

Gets document metadata by custom ID

Gets document metadata of an existing document with the given custom identifier

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var customId = "customId_example"; // String | The custom ID


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **customId** | **String**| The custom ID | 

### Return type

[**WSDocument**](WSDocument.md)

### Authorization

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

### HTTP request headers

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

<a name="getDocuments"></a>
# **getDocuments**
> [WSDocument] getDocuments(docIds)

Gets the metadata of a collection of document

Gets document metadata of a collection of existing documents with the given identifiers; returns an array of WSDocument

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var docIds = [3.4]; // [Number] | Array of document IDs


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docIds** | [**[Number]**](Number.md)| Array of document IDs | 

### Return type

[**[WSDocument]**](WSDocument.md)

### Authorization

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

### HTTP request headers

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

<a name="getExtractedText"></a>
# **getExtractedText**
> 'String' getExtractedText(docId)

Gets the extracted text of a document

Gets the document's text stored in the full-text index

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var docId = 789; // Number | The document ID


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docId** | **Number**| The document ID | 

### Return type

**'String'**

### Authorization

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

### HTTP request headers

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

<a name="getLinks"></a>
# **getLinks**
> [WSLink] getLinks(docId)

Gets the links of a document

Gets all the links of a specific document; returns an array of links

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var docId = 789; // Number | The document ID


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docId** | **Number**| The document ID | 

### Return type

[**[WSLink]**](WSLink.md)

### Authorization

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

### HTTP request headers

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

<a name="getNotes"></a>
# **getNotes**
> [WSNote] getNotes(docId)

Gets all the notes of a document



### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var docId = 789; // Number | Document ID


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docId** | **Number**| Document ID | 

### Return type

[**[WSNote]**](WSNote.md)

### Authorization

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

### HTTP request headers

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

<a name="getRatings"></a>
# **getRatings**
> [WSRating] getRatings(docId)

Retrieves the different ratings of a focuments



### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var docId = 789; // Number | Document ID


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docId** | **Number**| Document ID | 

### Return type

[**[WSRating]**](WSRating.md)

### Authorization

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

### HTTP request headers

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

<a name="getRecentDocuments"></a>
# **getRecentDocuments**
> [WSDocument] getRecentDocuments(maxHits)

Gets the last modified documents

Lists of last modified documents of the current session

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var maxHits = 56; // Number | Maximum number of returned records


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **maxHits** | **Number**| Maximum number of returned records | 

### Return type

[**[WSDocument]**](WSDocument.md)

### Authorization

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

### HTTP request headers

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

<a name="getResource"></a>
# **getResource**
> DataHandler getResource(docId, opts)

Gets the content of a resource

Gets the content of a resource associated to the given document; returns the raw content of the file

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var docId = 789; // Number | The document ID

var opts = { 
  'fileVersion': "fileVersion_example", // String | The file version to retrieve
  'suffix': "suffix_example" // String | suffix specification(it cannot be empty, use 'conversion.pdf' to get the PDF conversion)
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docId** | **Number**| The document ID | 
 **fileVersion** | **String**| The file version to retrieve | [optional] 
 **suffix** | **String**| suffix specification(it cannot be empty, use 'conversion.pdf' to get the PDF conversion) | [optional] 

### Return type

[**DataHandler**](DataHandler.md)

### Authorization

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

### HTTP request headers

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

<a name="getVersionContent"></a>
# **getVersionContent**
> DataHandler getVersionContent(opts)

Gets the document content by version

Returns the content of a document using the document ID and version

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var opts = { 
  'docId': 789, // Number | 
  'version': "version_example" // String | 
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docId** | **Number**|  | [optional] 
 **version** | **String**|  | [optional] 

### Return type

[**DataHandler**](DataHandler.md)

### Authorization

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

### HTTP request headers

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

<a name="getVersions"></a>
# **getVersions**
> [WSDocument] getVersions(docId)

Gets the versions

Gets the version history of an existing document with the given identifier

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var docId = 789; // Number | Document ID


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docId** | **Number**| Document ID | 

### Return type

[**[WSDocument]**](WSDocument.md)

### Authorization

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

### HTTP request headers

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

<a name="isReadable"></a>
# **isReadable**
> 'Boolean' isReadable(docId)

Tests if a document is readable

Tests if a document is readable; returns True if the identifier denotes a document, otherwise false

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var docId = 789; // Number | Document ID


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docId** | **Number**| Document ID | 

### Return type

**'Boolean'**

### Authorization

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

### HTTP request headers

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

<a name="link"></a>
# **link**
> WSLink link(doc1, doc2, opts)

Creates a link between two documents

Creates a new link between two documents; returns the created link object

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var doc1 = 789; // Number | ID of document 1

var doc2 = 789; // Number | ID of document 2

var opts = { 
  'type': "type_example" // String | type of the link (use 'pdf' to point to the pdf conversion)
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.link(doc1, doc2, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **doc1** | **Number**| ID of document 1 | 
 **doc2** | **Number**| ID of document 2 | 
 **type** | **String**| type of the link (use 'pdf' to point to the pdf conversion) | [optional] 

### Return type

[**WSLink**](WSLink.md)

### Authorization

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

### HTTP request headers

 - **Content-Type**: application/x-www-form-urlencoded
 - **Accept**: application/json

<a name="list"></a>
# **list**
> [WSDocument] list(opts)

Lists documents by folder

Lists Documents by folder identifier

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var opts = { 
  'folderId': 789 // Number | 
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **folderId** | **Number**|  | [optional] 

### Return type

[**[WSDocument]**](WSDocument.md)

### Authorization

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

### HTTP request headers

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

<a name="listDocuments"></a>
# **listDocuments**
> [WSDocument] listDocuments(opts)

Lists documents by folder and filename

Lists Documents by folder ID filtering the results by filename

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var opts = { 
  'folderId': 789, // Number | 
  'fileName': "fileName_example" // String | 
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **folderId** | **Number**|  | [optional] 
 **fileName** | **String**|  | [optional] 

### Return type

[**[WSDocument]**](WSDocument.md)

### Authorization

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

### HTTP request headers

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

<a name="lock"></a>
# **lock**
> lock(docId)

Locks a document

Locks an existing document with the given identifier

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var docId = 789; // Number | Document ID


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.lock(docId, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docId** | **Number**| Document ID | 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

<a name="move"></a>
# **move**
> move(docId, folderId)

Moves an existing document with the given identifier



### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var docId = 789; // Number | Document ID

var folderId = 789; // Number | Target Folder ID


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.move(docId, folderId, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docId** | **Number**| Document ID | 
 **folderId** | **Number**| Target Folder ID | 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

<a name="promoteVersion"></a>
# **promoteVersion**
> promoteVersion(docId, opts)

Promotes an old version to the current default one



### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var docId = 789; // Number | Document ID

var opts = { 
  'version': "version_example" // String | 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.promoteVersion(docId, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docId** | **Number**| Document ID | 
 **version** | **String**|  | [optional] 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

<a name="rateDocument"></a>
# **rateDocument**
> WSRating rateDocument(docId, vote)

Add/Update the user's vote for a document



### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var docId = 789; // Number | Document ID

var vote = 56; // Number | The user's vote


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.rateDocument(docId, vote, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docId** | **Number**| Document ID | 
 **vote** | **Number**| The user's vote | 

### Return type

[**WSRating**](WSRating.md)

### Authorization

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

### HTTP request headers

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

<a name="reindex"></a>
# **reindex**
> reindex(doc1, opts)

Re-indexes a document

re-indexes(or indexes from scratch) a document

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var doc1 = 789; // Number | Document ID

var opts = { 
  'content': "content_example" // String | Document ID
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.reindex(doc1, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **doc1** | **Number**| Document ID | 
 **content** | **String**| Document ID | [optional] 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

 - **Content-Type**: application/x-www-form-urlencoded
 - **Accept**: application/json

<a name="rename"></a>
# **rename**
> rename(docId, name)

Renames the title of an existing document with the given identifier



### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var docId = 789; // Number | Document ID

var name = "name_example"; // String | The new document filename


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.rename(docId, name, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docId** | **Number**| Document ID | 
 **name** | **String**| The new document filename | 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

<a name="replaceFile"></a>
# **replaceFile**
> replaceFile(docId, filedata, opts)

Replace the file of a version

Replaces the file associated to a given version.

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var docId = 56; // Number | The ID of an existing document to update

var filedata = "/path/to/file.txt"; // File | File data

var opts = { 
  'fileVersion': "fileVersion_example", // String | The file version
  'comment': "comment_example" // String | Comment
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.replaceFile(docId, filedata, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docId** | **Number**| The ID of an existing document to update | 
 **filedata** | **File**| File data | 
 **fileVersion** | **String**| The file version | [optional] 
 **comment** | **String**| Comment | [optional] 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

 - **Content-Type**: multipart/form-data
 - **Accept**: text/plain, application/json, application/xml

<a name="restore"></a>
# **restore**
> restore(docId, folderId)

Restores a deleted document



### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var docId = 789; // Number | Document ID

var folderId = 789; // Number | Folder ID (target)


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.restore(docId, folderId, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docId** | **Number**| Document ID | 
 **folderId** | **Number**| Folder ID (target) | 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

<a name="saveNote"></a>
# **saveNote**
> WSNote saveNote(docId, note)

Adds a new note

Adds/modifies a note for the given document

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var docId = 789; // Number | Document ID

var note = "note_example"; // String | the WSNote representation as json string


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.saveNote(docId, note, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docId** | **Number**| Document ID | 
 **note** | **String**| the WSNote representation as json string | 

### Return type

[**WSNote**](WSNote.md)

### Authorization

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

### HTTP request headers

 - **Content-Type**: application/x-www-form-urlencoded
 - **Accept**: application/json

<a name="sendEmail"></a>
# **sendEmail**
> sendEmail(docIds, recipients, opts)

Sends documents by email

Sends a set of documents as mail attachments

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var docIds = [3.4]; // [Number] | Document IDs

var recipients = "recipients_example"; // String | Set of recipients(comma separated)

var opts = { 
  'subject': "subject_example", // String | The email subject
  'message': "message_example" // String | The email message body
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.sendEmail(docIds, recipients, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docIds** | [**[Number]**](Number.md)| Document IDs | 
 **recipients** | **String**| Set of recipients(comma separated) | 
 **subject** | **String**| The email subject | [optional] 
 **message** | **String**| The email message body | [optional] 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

 - **Content-Type**: application/x-www-form-urlencoded
 - **Accept**: application/json

<a name="setPassword"></a>
# **setPassword**
> setPassword(docId, password)

Password protect a document

Protects with a password the given document

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var docId = 789; // Number | Document ID

var password = "password_example"; // String | A password


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.setPassword(docId, password, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docId** | **Number**| Document ID | 
 **password** | **String**| A password | 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

 - **Content-Type**: application/x-www-form-urlencoded
 - **Accept**: application/json

<a name="unlock"></a>
# **unlock**
> unlock(docId)

Unlocks the document

Unlocks an existing document with the given identifier

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var docId = 789; // Number | Document ID


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.unlock(docId, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docId** | **Number**| Document ID | 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

<a name="unprotect"></a>
# **unprotect**
> 'Boolean' unprotect(docId, password)

Temporarily removes password protection

Unprotect a document that is password protected. If the given password is right, the document remains unprotected for the duration of the session

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var docId = 789; // Number | Document ID

var password = "password_example"; // String | A password


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.unprotect(docId, password, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docId** | **Number**| Document ID | 
 **password** | **String**| A password | 

### Return type

**'Boolean'**

### Authorization

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

### HTTP request headers

 - **Content-Type**: application/x-www-form-urlencoded
 - **Accept**: application/json

<a name="unsetPassword"></a>
# **unsetPassword**
> unsetPassword(docId, currentPassword)

Removes password protection

Removes the password protection from the document

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var docId = 789; // Number | Document ID

var currentPassword = "currentPassword_example"; // String | A password


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.unsetPassword(docId, currentPassword, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docId** | **Number**| Document ID | 
 **currentPassword** | **String**| A password | 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

 - **Content-Type**: application/x-www-form-urlencoded
 - **Accept**: application/json

<a name="update"></a>
# **update**
> update(body)

Updates an existing document

Updates the metadata of an existing document. The ID of the document must be specified in the WSDocument value object. The provided example moves document with ID 1111111 to folder 3435433

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var body = new LogicalDocRestApi.WSDocument(); // WSDocument | Document object that needs to be updated


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.update(body, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**WSDocument**](WSDocument.md)| Document object that needs to be updated | 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

<a name="upload"></a>
# **upload**
> upload(filename, filedata, opts)

Uploads a document

Creates or updates an existing document, if used in update mode docId must be provided, when used in create mode folderId is required. Returns the ID of the created/updated document. &lt;br/&gt;Example: curl -u admin:admin -H ''Accept: application/json'' -X POST -F folderId=4 -F filename=newDoc.txt -F filedata=@newDoc.txt http://localhost:8080/services/rest/document/upload

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var filename = "filename_example"; // String | File name

var filedata = "/path/to/file.txt"; // File | File data

var opts = { 
  'docId': 56, // Number | The ID of an existing document to update
  'folderId': "folderId_example", // String | Folder ID where to place the document
  'release': "release_example", // String | Indicates whether to create or not a new major release of an updated document
  'language': "en" // String | Language of the document (ISO 639-2)
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.upload(filename, filedata, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **filename** | **String**| File name | 
 **filedata** | **File**| File data | 
 **docId** | **Number**| The ID of an existing document to update | [optional] 
 **folderId** | **String**| Folder ID where to place the document | [optional] 
 **release** | **String**| Indicates whether to create or not a new major release of an updated document | [optional] 
 **language** | **String**| Language of the document (ISO 639-2) | [optional] [default to en]

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

 - **Content-Type**: multipart/form-data
 - **Accept**: text/plain, application/json, application/xml

<a name="uploadResource"></a>
# **uploadResource**
> uploadResource(docId, suffix, content, opts)

Uploads a new resource of the document

Uploads a new resource attached to the given document. If the resource already exists it is overwritten

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.DocumentApi();

var docId = 56; // Number | the document id

var suffix = "suffix_example"; // String | suffix specification(it cannot be empty, use 'conversion.pdf' to put the PDF conversion)

var content = "/path/to/file.txt"; // File | raw content of the file

var opts = { 
  'fileVersion': "fileVersion_example" // String | the specific file version
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.uploadResource(docId, suffix, content, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **docId** | **Number**| the document id | 
 **suffix** | **String**| suffix specification(it cannot be empty, use 'conversion.pdf' to put the PDF conversion) | 
 **content** | **File**| raw content of the file | 
 **fileVersion** | **String**| the specific file version | [optional] 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

