cloudmersive-cdr-api-client

CloudmersiveCdrApiClient - the Ruby gem for the CDR API

Use the Content Disarm and Reconstruction API to remove security risks from documents by tearing them down, removing unsafe content and rebuilding them.

This SDK is automatically generated by the Swagger Codegen project:

  • API version: v1
  • Package version: 2.0.1
  • Build package: io.swagger.codegen.languages.RubyClientCodegen

Installation

Build a gem

To build the Ruby code into a gem:

gem build cloudmersive-cdr-api-client.gemspec

Then either install the gem locally:

gem install ./cloudmersive-cdr-api-client-2.0.1.gem

(for development, run gem install --dev ./cloudmersive-cdr-api-client-2.0.1.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-cdr-api-client', '~> 2.0.1'

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-cdr-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-cdr-api-client'

# Setup authorization
CloudmersiveCdrApiClient.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 = CloudmersiveCdrApiClient::FileSanitizationApi.new

opts = { 
  input_file: File.new('/path/to/file.txt') # File | Input document, or photos of a document, to extract data from
}

begin
  #Content Disarm and Reconstruction on a File
  result = api_instance.file(opts)
  p result
rescue CloudmersiveCdrApiClient::ApiError => e
  puts "Exception when calling FileSanitizationApi->file: #{e}"
end

Documentation for API Endpoints

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

Class Method HTTP request Description
CloudmersiveCdrApiClient::FileSanitizationApi file POST /cdr/sanitization/file Content Disarm and Reconstruction on a File
CloudmersiveCdrApiClient::FileSanitizationApi file_advanced POST /cdr/sanitization/file/advanced Advanced Content Disarm and Reconstruction on a File
CloudmersiveCdrApiClient::FileSanitizationApi file_to_pdf POST /cdr/sanitization/file/to/pdf Content Disarm and Reconstruction on a File with PDFA Output
CloudmersiveCdrApiClient::FileSanitizationApi file_to_pdf_advanced POST /cdr/sanitization/file/to/pdf/advanced Advanced Content Disarm and Reconstruction on a File with PDFA Output

Documentation for Models

Documentation for Authorization

Apikey

  • Type: API key
  • API key parameter name: Apikey
  • Location: HTTP header