cloudmersive / cloudmersive_spam_api_client
Installs: 3
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/cloudmersive/cloudmersive_spam_api_client
Requires
- php: >=7.2.5
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.5
Requires (Dev)
- friendsofphp/php-cs-fixer: ~2.12
- phpunit/phpunit: ^4.8
- squizlabs/php_codesniffer: ~2.6
This package is not auto-updated.
Last update: 2025-12-18 05:21:02 UTC
README
Easily and directly scan and block spam security threats in input.
Cloudmersive Barcode API provides advanced spam detection capabilities.
- API version: v1
- Package version: 3.1.1
Requirements
PHP 5.5 and later
Installation & Usage
Composer
To install the bindings via Composer, add the following to composer.json:
{
"repositories": [
{
"type": "git",
"url": "https://github.com/cloudmersive/cloudmersive_spam_api_client.git"
}
],
"require": {
"cloudmersive/cloudmersive_spam_api_client": "*@dev"
}
}
Then run composer install
Manual Installation
Download the files and include autoload.php:
require_once('/path/to/cloudmersive_spam_api_client/vendor/autoload.php');
Tests
To run the unit tests:
composer install
./vendor/bin/phpunit
Getting Started
Please follow the installation procedure and then run the following:
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: Apikey $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Apikey', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Apikey', 'Bearer'); $apiInstance = new Swagger\Client\Api\SpamDetectionApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client(), $config ); $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; // bool | True if phishing should be allowed, false otherwise $allow_unsolicited_sales = false; // bool | True if unsolicited sales should be allowed, false otherwise $allow_promotional_content = true; // bool | True if promotional content should be allowed, false otherwise $custom_policy_id = "custom_policy_id_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 $input_file = "/path/to/file.txt"; // \SplFileObject | try { $result = $apiInstance->spamDetectFileAdvancedPost($model, $preprocessing, $allow_phishing, $allow_unsolicited_sales, $allow_promotional_content, $custom_policy_id, $input_file); print_r($result); } catch (Exception $e) { echo 'Exception when calling SpamDetectionApi->spamDetectFileAdvancedPost: ', $e->getMessage(), PHP_EOL; } ?>
Documentation for API Endpoints
All URIs are relative to https://localhost
| Class | Method | HTTP request | Description |
|---|---|---|---|
| SpamDetectionApi | spamDetectFileAdvancedPost | POST /spam/detect/file/advanced | Perform advanced AI spam detection and classification against input text file. |
| SpamDetectionApi | spamDetectFilePost | POST /spam/detect/file | Perform AI spam detection and classification on an input image or document (PDF or DOCX) |
| SpamDetectionApi | spamDetectFormSubmissionAdvancedPost | POST /spam/detect/form-submission/advanced | Perform advanced AI spam detection and classification against a form submission |
| SpamDetectionApi | spamDetectTextStringAdvancedPost | POST /spam/detect/text-string/advanced | Perform advanced AI spam detection and classification against input text string |
| SpamDetectionApi | spamDetectTextStringPost | POST /spam/detect/text-string | Perform AI spam detection and classification against input text string |
Documentation For Models
- SpamDetectionAdvancedFormField
- SpamDetectionAdvancedFormSubmissionRequest
- SpamDetectionAdvancedRequest
- SpamDetectionAdvancedResponse
- SpamDetectionFormSubmissionAdvancedResponse
- SpamDetectionRequest
- SpamDetectionResponse
Documentation For Authorization
Apikey
- Type: API key
- API key parameter name: Apikey
- Location: HTTP header