cloudmersive-spam-detection-api-client
CloudmersiveSpamDetectionApiClient - the Ruby gem for the spamapi
Easily and directly scan and block spam security threats in input.
This SDK is automatically generated by the Swagger Codegen project:
- API version: v1
- Package version: 2.4.0
- Build package: io.swagger.codegen.languages.RubyClientCodegen
Installation
Build a gem
To build the Ruby code into a gem:
gem build cloudmersive-spam-detection-api-client.gemspec
Then either install the gem locally:
gem install ./cloudmersive-spam-detection-api-client-2.4.0.gem
(for development, run gem install --dev ./cloudmersive-spam-detection-api-client-2.4.0.gem to install the development dependencies)
or publish the gem to a gem hosting service, e.g. RubyGems.
Finally add this to the Gemfile:
gem 'cloudmersive-spam-detection-api-client', '~> 2.4.0'
Install from Git
If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
gem 'cloudmersive-spam-detection-api-client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
Include the Ruby code directly
Include the Ruby code directly using -I as follows:
ruby -Ilib script.rb
Getting Started
Please follow the installation procedure and then run the following code:
# Load the gem
require 'cloudmersive-spam-detection-api-client'
# Setup authorization
CloudmersiveSpamDetectionApiClient.configure do |config|
# Configure API key authorization: Apikey
config.api_key['Apikey'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['Apikey'] = 'Bearer'
end
api_instance = CloudmersiveSpamDetectionApiClient::SpamDetectionApi.new
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.
allow_phishing: false, # BOOLEAN | True if phishing should be allowed, false otherwise
allow_unsolicited_sales: false, # BOOLEAN | True if unsolicited sales should be allowed, false otherwise
allow_promotional_content: true, # BOOLEAN | True if promotional content should be allowed, false otherwise
input_file: File.new('/path/to/file.txt') # File |
}
begin
#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.
result = api_instance.spam_detect_file_advanced_post(opts)
p result
rescue CloudmersiveSpamDetectionApiClient::ApiError => e
puts "Exception when calling SpamDetectionApi->spam_detect_file_advanced_post: #{e}"
end
Documentation for API Endpoints
All URIs are relative to https://localhost
| Class | Method | HTTP request | Description |
|---|---|---|---|
| CloudmersiveSpamDetectionApiClient::SpamDetectionApi | spam_detect_file_advanced_post | POST /spam/detect/file/advanced | 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. |
| CloudmersiveSpamDetectionApiClient::SpamDetectionApi | spam_detect_file_post | POST /spam/detect/file | 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. |
| CloudmersiveSpamDetectionApiClient::SpamDetectionApi | spam_detect_form_submission_advanced_post | POST /spam/detect/form-submission/advanced | 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. |
| CloudmersiveSpamDetectionApiClient::SpamDetectionApi | spam_detect_text_string_advanced_post | POST /spam/detect/text-string/advanced | 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. |
| CloudmersiveSpamDetectionApiClient::SpamDetectionApi | spam_detect_text_string_post | POST /spam/detect/text-string | 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. |
Documentation for Models
- CloudmersiveSpamDetectionApiClient::SpamDetectionAdvancedFormField
- CloudmersiveSpamDetectionApiClient::SpamDetectionAdvancedFormSubmissionRequest
- CloudmersiveSpamDetectionApiClient::SpamDetectionAdvancedRequest
- CloudmersiveSpamDetectionApiClient::SpamDetectionAdvancedResponse
- CloudmersiveSpamDetectionApiClient::SpamDetectionFormSubmissionAdvancedResponse
- CloudmersiveSpamDetectionApiClient::SpamDetectionRequest
- CloudmersiveSpamDetectionApiClient::SpamDetectionResponse
Documentation for Authorization
Apikey
- Type: API key
- API key parameter name: Apikey
- Location: HTTP header