cloudmersive-virus-api-client
Version:
The_Cloudmersive_Virus_Scan_API_lets_you_scan_files_and_content_for_viruses_and_identify_security_issues_with_content_
197 lines (141 loc) • 13.4 kB
Markdown
//api.cloudmersive.com*
Method | HTTP request | Description
------------- | ------------- | -------------
[**scanFile**](ScanApi.md
[**scanFileAdvanced**](ScanApi.md
[**scanWebsite**](ScanApi.md
<a name="scanFile"></a>
> VirusScanResult scanFile(inputFile)
Scan a file for viruses
Scan files and content for viruses. Leverage continuously updated signatures for millions of threats, and advanced high-performance scanning capabilities. Over 17 million virus and malware signatures. Continuous cloud-based updates. Wide file format support including Office, PDF, HTML, Flash. Zip support including .Zip, .Rar, .DMG, .Tar, and other archive formats. Multi-threat scanning across viruses, malware, trojans, ransomware, and spyware. High-speed in-memory scanning delivers subsecond typical response time.
### Example
```javascript
var CloudmersiveVirusApiClient = require('cloudmersive-virus-api-client');
var defaultClient = CloudmersiveVirusApiClient.ApiClient.instance;
// Configure API key authorization: Apikey
var Apikey = defaultClient.authentications['Apikey'];
Apikey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Apikey.apiKeyPrefix = 'Token';
var apiInstance = new CloudmersiveVirusApiClient.ScanApi();
var inputFile = "/path/to/file.txt"; // File | Input file to perform the operation on.
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.scanFile(inputFile, callback);
```
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**inputFile** | **File**| Input file to perform the operation on. |
[**VirusScanResult**](VirusScanResult.md)
[ ](../README.md
- **Content-Type**: multipart/form-data
- **Accept**: application/json, text/json, application/xml, text/xml
<a name="scanFileAdvanced"></a>
> VirusScanAdvancedResult scanFileAdvanced(inputFile, opts)
Advanced Scan a file for viruses
Advanced Scan files with 360-degree Content Protection across Viruses and Malware, executables, invalid files, scripts, and even restrictions on accepted file types with complete content verification. Customize threat rules to your needs. Leverage continuously updated signatures for millions of threats, and advanced high-performance scanning capabilities. Over 17 million virus and malware signatures. Continuous cloud-based updates. Block threats beyond viruses including executables, scripts, invalid files, and more. Optionally limit input files to a specific set of file types (e.g. PDF and Word Documents only). Wide file format support including Office, PDF, HTML, Flash, MSG, and a wide range of image file formats. Zip support including .Zip, .Rar, .DMG, .Tar, and other archive formats. Multi-threat scanning across viruses, malware, trojans, ransomware, and spyware. High-speed in-memory scanning delivers subsecond typical response time.
### Example
```javascript
var CloudmersiveVirusApiClient = require('cloudmersive-virus-api-client');
var defaultClient = CloudmersiveVirusApiClient.ApiClient.instance;
// Configure API key authorization: Apikey
var Apikey = defaultClient.authentications['Apikey'];
Apikey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Apikey.apiKeyPrefix = 'Token';
var apiInstance = new CloudmersiveVirusApiClient.ScanApi();
var inputFile = "/path/to/file.txt"; // File | Input file to perform the operation on.
var opts = {
'allowExecutables': true, // Boolean | Set to false to block executable files (program code) from being allowed in the input file. Default is false (recommended).
'allowInvalidFiles': true, // Boolean | Set to false to block invalid files, such as a PDF file that is not really a valid PDF file, or a Word Document that is not a valid Word Document. Default is false (recommended).
'allowScripts': true, // Boolean | Set to false to block script files, such as a PHP files, Python scripts, and other malicious content or security threats that can be embedded in the file. Set to true to allow these file types. Default is false (recommended).
'allowPasswordProtectedFiles': true, // Boolean | Set to false to block password protected and encrypted files, such as encrypted zip and rar files, and other files that seek to circumvent scanning through passwords. Set to true to allow these file types. Default is false (recommended).
'allowMacros': true, // Boolean | Set to false to block macros and other threats embedded in document files, such as Word, Excel and PowerPoint embedded Macros (including support for .DOCX, .XLSX, .PPTX, .DOC and .XLS), and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended).
'allowXmlExternalEntities': true, // Boolean | Set to false to block XML External Entities and other threats embedded in XML files, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended).
'allowInsecureDeserialization': true, // Boolean | Set to false to block Insecure Deserialization and other threats embedded in JSON and other object serialization files, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended).
'allowHtml': true, // Boolean | Set to false to block HTML input in the top level file; HTML can contain XSS, scripts, local file accesses and other threats. Set to true to allow these file types. Default is false (recommended) [for API keys created prior to the release of this feature default is true for backward compatability]. If set to true, HTML files containing script tags will be allowed, but ContainsScript will be set to true if script tags are present.
'allowUnsafeArchives': true, // Boolean | Set to false to block unsafe archives such as Zip Bombs, and other archives that can cause unsafe extraction outcomes. Default is false (recommended). If set to true, unsafe archives will be allowed.
'allowOleEmbeddedObject': true, // Boolean | Set to false to block OLE embedded objects, which can contain vulnerabilities and executable code. Default is false (recommended). If set to true, OLE embedded objects will be allowed.
'options': "options_example", // String | Comma separated set of configuration operations. Include permitJavascriptAndHtmlInPDFs to allow JavaScript and HTML in PDF files. Default is no options.
'restrictFileTypes': "restrictFileTypes_example" // String | Specify a restricted set of file formats to allow as clean as a comma-separated list of file formats, such as .pdf,.docx,.png would allow only PDF, PNG and Word document files. All files must pass content verification against this list of file formats, if they do not, then the result will be returned as CleanResult=false. Set restrictFileTypes parameter to null or empty string to disable; default is disabled.
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.scanFileAdvanced(inputFile, opts, callback);
```
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**inputFile** | **File**| Input file to perform the operation on. |
**allowExecutables** | **Boolean**| Set to false to block executable files (program code) from being allowed in the input file. Default is false (recommended). | [optional]
**allowInvalidFiles** | **Boolean**| Set to false to block invalid files, such as a PDF file that is not really a valid PDF file, or a Word Document that is not a valid Word Document. Default is false (recommended). | [optional]
**allowScripts** | **Boolean**| Set to false to block script files, such as a PHP files, Python scripts, and other malicious content or security threats that can be embedded in the file. Set to true to allow these file types. Default is false (recommended). | [optional]
**allowPasswordProtectedFiles** | **Boolean**| Set to false to block password protected and encrypted files, such as encrypted zip and rar files, and other files that seek to circumvent scanning through passwords. Set to true to allow these file types. Default is false (recommended). | [optional]
**allowMacros** | **Boolean**| Set to false to block macros and other threats embedded in document files, such as Word, Excel and PowerPoint embedded Macros (including support for .DOCX, .XLSX, .PPTX, .DOC and .XLS), and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended). | [optional]
**allowXmlExternalEntities** | **Boolean**| Set to false to block XML External Entities and other threats embedded in XML files, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended). | [optional]
**allowInsecureDeserialization** | **Boolean**| Set to false to block Insecure Deserialization and other threats embedded in JSON and other object serialization files, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended). | [optional]
**allowHtml** | **Boolean**| Set to false to block HTML input in the top level file; HTML can contain XSS, scripts, local file accesses and other threats. Set to true to allow these file types. Default is false (recommended) [for API keys created prior to the release of this feature default is true for backward compatability]. If set to true, HTML files containing script tags will be allowed, but ContainsScript will be set to true if script tags are present. | [optional]
**allowUnsafeArchives** | **Boolean**| Set to false to block unsafe archives such as Zip Bombs, and other archives that can cause unsafe extraction outcomes. Default is false (recommended). If set to true, unsafe archives will be allowed. | [optional]
**allowOleEmbeddedObject** | **Boolean**| Set to false to block OLE embedded objects, which can contain vulnerabilities and executable code. Default is false (recommended). If set to true, OLE embedded objects will be allowed. | [optional]
**options** | **String**| Comma separated set of configuration operations. Include permitJavascriptAndHtmlInPDFs to allow JavaScript and HTML in PDF files. Default is no options. | [optional]
**restrictFileTypes** | **String**| Specify a restricted set of file formats to allow as clean as a comma-separated list of file formats, such as .pdf,.docx,.png would allow only PDF, PNG and Word document files. All files must pass content verification against this list of file formats, if they do not, then the result will be returned as CleanResult=false. Set restrictFileTypes parameter to null or empty string to disable; default is disabled. | [optional]
[**VirusScanAdvancedResult**](VirusScanAdvancedResult.md)
[ ](../README.md
- **Content-Type**: multipart/form-data
- **Accept**: application/json, text/json, application/xml, text/xml
<a name="scanWebsite"></a>
> WebsiteScanResult scanWebsite(input)
Scan a website for malicious content and threats
Operation includes scanning the content of the URL for various types of malicious content and threats, including viruses and threats (including Phishing).
### Example
```javascript
var CloudmersiveVirusApiClient = require('cloudmersive-virus-api-client');
var defaultClient = CloudmersiveVirusApiClient.ApiClient.instance;
// Configure API key authorization: Apikey
var Apikey = defaultClient.authentications['Apikey'];
Apikey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Apikey.apiKeyPrefix = 'Token';
var apiInstance = new CloudmersiveVirusApiClient.ScanApi();
var input = new CloudmersiveVirusApiClient.WebsiteScanRequest(); // WebsiteScanRequest |
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.scanWebsite(input, callback);
```
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**input** | [**WebsiteScanRequest**](WebsiteScanRequest.md)| |
[**WebsiteScanResult**](WebsiteScanResult.md)
[ ](../README.md
- **Content-Type**: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded
- **Accept**: application/json, text/json, application/xml, text/xml
All URIs are relative to *https: