# CloudmersiveSpamapiClient.SpamDetectionApi

All URIs are relative to *https://api.cloudmersive.com*

Method | HTTP request | Description
------------- | ------------- | -------------
[**spamDetectFileAdvancedPost**](SpamDetectionApi.md#spamDetectFileAdvancedPost) | **POST** /spam/detect/file/advanced | Perform advanced AI spam detection and classification against input text file.
[**spamDetectFilePost**](SpamDetectionApi.md#spamDetectFilePost) | **POST** /spam/detect/file | Perform AI spam detection and classification on an input image or document (PDF or DOCX)
[**spamDetectFormSubmissionAdvancedPost**](SpamDetectionApi.md#spamDetectFormSubmissionAdvancedPost) | **POST** /spam/detect/form-submission/advanced | Perform advanced AI spam detection and classification against a form submission
[**spamDetectTextStringAdvancedPost**](SpamDetectionApi.md#spamDetectTextStringAdvancedPost) | **POST** /spam/detect/text-string/advanced | Perform advanced AI spam detection and classification against input text string
[**spamDetectTextStringPost**](SpamDetectionApi.md#spamDetectTextStringPost) | **POST** /spam/detect/text-string | Perform AI spam detection and classification against input text string


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

Perform advanced AI spam detection and classification against input text file.

Analyzes input content as well as embedded URLs with AI deep learning to detect spam, phishing and other unsafe content.  Uses 25-100 API calls depending on model selected.  Supported file formats include DOCX, PDF, XLSX, PPTX, EML, MSG, JPG, PNG and WEBP.

### Example
```javascript
var CloudmersiveSpamapiClient = require('cloudmersive-spamapi-client');
var defaultClient = CloudmersiveSpamapiClient.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 CloudmersiveSpamapiClient.SpamDetectionApi();

var opts = { 
  'model': "Advanced", // String | Optional: Specify which AI model to use.  Possible choices are Normal and Advanced.  Default is Advanced.
  'preprocessing': "Auto", // String | Optional: Specify which preprocessing to Use.  Possible choices are None, Compatability and Auto.  Default is Auto.
  'allowPhishing': false, // Boolean | True if phishing should be allowed, false otherwise
  'allowUnsolicitedSales': false, // Boolean | True if unsolicited sales should be allowed, false otherwise
  'allowPromotionalContent': true, // Boolean | True if promotional content should be allowed, false otherwise
  'customPolicyId': "customPolicyId_example", // String | Apply a Custom Policy for Spam Enforcement by providing the ID; to create a Custom Policy, navigate to the Cloudmersive Management Portal and select Custom Policies.  Requires Managed Instance or Private Cloud
  'inputFile': "/path/to/file.txt" // File | 
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **model** | **String**| Optional: Specify which AI model to use.  Possible choices are Normal and Advanced.  Default is Advanced. | [optional] [default to Advanced]
 **preprocessing** | **String**| Optional: Specify which preprocessing to Use.  Possible choices are None, Compatability and Auto.  Default is Auto. | [optional] [default to Auto]
 **allowPhishing** | **Boolean**| True if phishing should be allowed, false otherwise | [optional] [default to false]
 **allowUnsolicitedSales** | **Boolean**| True if unsolicited sales should be allowed, false otherwise | [optional] [default to false]
 **allowPromotionalContent** | **Boolean**| True if promotional content should be allowed, false otherwise | [optional] [default to true]
 **customPolicyId** | **String**| Apply a Custom Policy for Spam Enforcement by providing the ID; to create a Custom Policy, navigate to the Cloudmersive Management Portal and select Custom Policies.  Requires Managed Instance or Private Cloud | [optional] 
 **inputFile** | **File**|  | [optional] 

### Return type

[**SpamDetectionAdvancedResponse**](SpamDetectionAdvancedResponse.md)

### Authorization

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

### HTTP request headers

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

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

Perform AI spam detection and classification on an input image or document (PDF or DOCX)

Analyzes input content as well as embedded URLs with AI deep learnign to detect spam, phishing and other unsafe content.  Uses 100-125 API calls depending on model selected.  Supported file formats include DOCX, PDF, XLSX, PPTX, EML, MSG, JPG, PNG and WEBP.

### Example
```javascript
var CloudmersiveSpamapiClient = require('cloudmersive-spamapi-client');
var defaultClient = CloudmersiveSpamapiClient.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 CloudmersiveSpamapiClient.SpamDetectionApi();

var opts = { 
  'model': "Advanced", // String | Model to use; default setting is Advanced
  'inputFile': "/path/to/file.txt" // File | 
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **model** | **String**| Model to use; default setting is Advanced | [optional] [default to Advanced]
 **inputFile** | **File**|  | [optional] 

### Return type

[**SpamDetectionResponse**](SpamDetectionResponse.md)

### Authorization

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

### HTTP request headers

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

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

Perform advanced AI spam detection and classification against a form submission

Analyzes form input content as well as embedded URLs with AI deep learnign to detect spam, phishing and other unsafe content.  Uses 25-100 API calls depending on model selected.

### Example
```javascript
var CloudmersiveSpamapiClient = require('cloudmersive-spamapi-client');
var defaultClient = CloudmersiveSpamapiClient.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 CloudmersiveSpamapiClient.SpamDetectionApi();

var opts = { 
  'body': new CloudmersiveSpamapiClient.SpamDetectionAdvancedFormSubmissionRequest() // SpamDetectionAdvancedFormSubmissionRequest | Spam detection request
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**SpamDetectionAdvancedFormSubmissionRequest**](SpamDetectionAdvancedFormSubmissionRequest.md)| Spam detection request | [optional] 

### Return type

[**SpamDetectionFormSubmissionAdvancedResponse**](SpamDetectionFormSubmissionAdvancedResponse.md)

### Authorization

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

### HTTP request headers

 - **Content-Type**: application/json, text/json, application/_*+json
 - **Accept**: text/plain, application/json, text/json

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

Perform advanced AI spam detection and classification against input text string

Analyzes input content as well as embedded URLs with AI deep learnign to detect spam, phishing and other unsafe content.  Uses 25-100 API calls depending on model selected.

### Example
```javascript
var CloudmersiveSpamapiClient = require('cloudmersive-spamapi-client');
var defaultClient = CloudmersiveSpamapiClient.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 CloudmersiveSpamapiClient.SpamDetectionApi();

var opts = { 
  'body': new CloudmersiveSpamapiClient.SpamDetectionAdvancedRequest() // SpamDetectionAdvancedRequest | Spam detection request
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**SpamDetectionAdvancedRequest**](SpamDetectionAdvancedRequest.md)| Spam detection request | [optional] 

### Return type

[**SpamDetectionAdvancedResponse**](SpamDetectionAdvancedResponse.md)

### Authorization

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

### HTTP request headers

 - **Content-Type**: application/json, text/json, application/_*+json
 - **Accept**: text/plain, application/json, text/json

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

Perform AI spam detection and classification against input text string

Analyzes input content as well as embedded URLs with AI deep learnign to detect spam, phishing and other unsafe content.  Uses 25-75 API calls depending on model selected.

### Example
```javascript
var CloudmersiveSpamapiClient = require('cloudmersive-spamapi-client');
var defaultClient = CloudmersiveSpamapiClient.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 CloudmersiveSpamapiClient.SpamDetectionApi();

var opts = { 
  'body': new CloudmersiveSpamapiClient.SpamDetectionRequest() // SpamDetectionRequest | Spam detection request
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**SpamDetectionRequest**](SpamDetectionRequest.md)| Spam detection request | [optional] 

### Return type

[**SpamDetectionResponse**](SpamDetectionResponse.md)

### Authorization

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

### HTTP request headers

 - **Content-Type**: application/json, text/json, application/_*+json
 - **Accept**: text/plain, application/json, text/json

