Run this command to install the SDK:
npm install cloudmersive-dlpapi-client --save
Or add this snippet to your package.json:
"dependencies": {
"cloudmersive-dlpapi-client": "^2.0.0"
}Run this command to install the SDK:
npm install cloudmersive-dlpapi-client --save
Or add this snippet to your package.json:
"dependencies": {
"cloudmersive-dlpapi-client": "^2.0.0"
}var CloudmersiveDlpapiClient = require('cloudmersive-dlpapi-client');
var defaultClient = CloudmersiveDlpapiClient.ApiClient.instance;
// Configure API key authorization: Apikey
var Apikey = defaultClient.authentications['Apikey'];
Apikey.apiKey = 'YOUR API KEY';
var apiInstance = new CloudmersiveDlpapiClient.RedactApi();
var opts = {
'body': new CloudmersiveDlpapiClient.DlpDocumentRedactionRequest() // DlpDocumentRedactionRequest | Input request
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.redactDocument(opts, callback);
Run this command to install the SDK:
pip install cloudmersive-dlp-api-client
from __future__ import print_function
import time
import cloudmersive_dlp_api_client
from cloudmersive_dlp_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: Apikey
configuration = cloudmersive_dlp_api_client.Configuration()
configuration.api_key['Apikey'] = 'YOUR_API_KEY'
# create an instance of the API class
api_instance = cloudmersive_dlp_api_client.RedactApi(cloudmersive_dlp_api_client.ApiClient(configuration))
body = cloudmersive_dlp_api_client.DlpDocumentRedactionRequest() # DlpDocumentRedactionRequest | Input request (optional)
try:
# Redact User Data in Document
api_response = api_instance.redact_document(body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling RedactApi->redact_document: %s\n" % e)
Run this command to install the SDK:
Install-Package Cloudmersive.APIClient.NET.DLP -Version 4.0.0
Run this command to install the SDK:
Install-Package Cloudmersive.APIClient.NETCore.DLP -Version 1.1.0
using System.Collections.Generic;
using System.Diagnostics;
using Cloudmersive.APIClient.NET.DLP.Api;
using Cloudmersive.APIClient.NET.DLP.Client;
using Cloudmersive.APIClient.NET.DLP.Model;
namespace Example
{
public class RedactDocumentExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://localhost";
// Configure API key authorization: Apikey
config.AddApiKey("Apikey", "YOUR_API_KEY");
// config.AddApiKeyPrefix("Apikey", "Bearer");
var apiInstance = new RedactApi(config);
var body = new DlpDocumentRedactionRequest(); // DlpDocumentRedactionRequest | Input request (optional)
try
{
// Redact User Data in Document
DlpDocumentRedactionResponse result = apiInstance.RedactDocument(body);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RedactApi.RedactDocument: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
using System;
using System.Diagnostics;
using Cloudmersive.APIClient.NETCore.DLP.Api;
using Cloudmersive.APIClient.NETCore.DLP.Client;
using Cloudmersive.APIClient.NETCore.DLP.Model;
namespace Example
{
public class RedactDocumentExample
{
public void main()
{
// Configure API key authorization: Apikey
Configuration.Default.AddApiKey("Apikey", "YOUR_API_KEY");
var apiInstance = new RedactApi();
var body = new DlpDocumentRedactionRequest(); // DlpDocumentRedactionRequest | Input request (optional)
try
{
// Redact User Data in Document
DlpDocumentRedactionResponse result = apiInstance.RedactDocument(body);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling RedactApi.RedactDocument: " + e.Message );
}
}
}
}
To install with Maven, add a reference to the repository in pom.xml:
And add a reference to the dependency in pom.xml:
To install with Gradle, add it in your root build.gradle at the end of repositories:
And add the dependency in build.gradle:
Run this command to install the SDK:
composer require cloudmersive/cloudmersive_dlp_api_client
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: Apikey
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Apikey', 'YOUR_API_KEY');
$apiInstance = new Swagger\Client\Api\RedactApi(
new GuzzleHttp\Client(),
$config
);
$body = new \Swagger\Client\Model\DlpDocumentRedactionRequest(); // \Swagger\Client\Model\DlpDocumentRedactionRequest | Input request
try {
$result = $apiInstance->redactDocument($body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling RedactApi->redactDocument: ', $e->getMessage(), PHP_EOL;
}
?>
Add the Objective-C client to your Podfile:
Add the Ruby client to your Gemfile:
gem 'cloudmersive-dlp-api-client', '~> 2.2'
# load the gem
require 'cloudmersive-dlp-api-client'
# setup authorization
CloudmersiveDlpApiClient.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 = CloudmersiveDlpApiClient::RedactApi.new
opts = {
body: CloudmersiveDlpApiClient::DlpDocumentRedactionRequest.new # DlpDocumentRedactionRequest | Input request
}
begin
#Redact User Data in Document
result = api_instance.redact_document(opts)
p result
rescue CloudmersiveDlpApiClient::ApiError => e
puts "Exception when calling RedactApi->redact_document: #{e}"
end
SwagRedactApi api = new SwagRedactApi();
SwagClient client = api.getClient();
// Configure API key authorization: Apikey
ApiKeyAuth Apikey = (ApiKeyAuth) client.getAuthentication('Apikey');
Apikey.setApiKey('YOUR API KEY');
Map<String, Object> params = new Map<String, Object>{
'body' => SwagDlpDocumentRedactionRequest.getExample()
};
try {
// cross your fingers
SwagDlpDocumentRedactionResponse result = api.redactDocument(params);
System.debug(result);
} catch (Swagger.ApiException e) {
// ...handle your exceptions
}
Install libcurl in your C/C++ project:
libcurl/7.75.0
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_URL, "//dlp/redact/document");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Content-Type: application/json");
headers = curl_slist_append(headers, "Apikey: YOUR-API-KEY-HERE");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
const char *data = "{\n \"InputFile\": \"<byte>\",\n \"FileName\": \"<string>\",\n \"RecognitionMode\": \"<string>\",\n \"RedactionMode\": \"<string>\",\n \"AllowEmailAddress\": \"<boolean>\",\n \"AllowPhoneNumber\": \"<boolean>\",\n \"AllowStreetAddress\": \"<boolean>\",\n \"AllowPersonName\": \"<boolean>\",\n \"AllowBirthDate\": \"<boolean>\",\n \"AllowPassportNumber\": \"<boolean>\",\n \"AllowDriversLicense\": \"<boolean>\",\n \"AllowSocialSecurityNumber\": \"<boolean>\",\n \"AllowTaxpayerID\": \"<boolean>\",\n \"AllowCreditCardNumber\": \"<boolean>\",\n \"AllowCreditCardExpirationDate\": \"<boolean>\",\n \"AllowCreditCardVerificationCode\": \"<boolean>\",\n \"AllowBankAccountNumber\": \"<boolean>\",\n \"AllowIBAN\": \"<boolean>\",\n \"AllowHealthInsuranceNumber\": \"<boolean>\",\n \"AllowBearerToken\": \"<boolean>\",\n \"AllowHttpCookie\": \"<boolean>\",\n \"AllowPrivateKeys\": \"<boolean>\",\n \"AllowCredentials\": \"<boolean>\",\n \"AllowDeepWebUrls\": \"<boolean>\",\n \"AllowSourceCode\": \"<boolean>\",\n \"AllowIpAddress\": \"<boolean>\",\n \"AllowMacAddress\": \"<boolean>\"\n}";
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);
curl --location --request POST '//dlp/redact/document' \
--header 'Content-Type: application/json' \
--header 'Apikey: YOUR-API-KEY-HERE' \
--data-raw '{
"InputFile": "<byte>",
"FileName": "<string>",
"RecognitionMode": "<string>",
"RedactionMode": "<string>",
"AllowEmailAddress": "<boolean>",
"AllowPhoneNumber": "<boolean>",
"AllowStreetAddress": "<boolean>",
"AllowPersonName": "<boolean>",
"AllowBirthDate": "<boolean>",
"AllowPassportNumber": "<boolean>",
"AllowDriversLicense": "<boolean>",
"AllowSocialSecurityNumber": "<boolean>",
"AllowTaxpayerID": "<boolean>",
"AllowCreditCardNumber": "<boolean>",
"AllowCreditCardExpirationDate": "<boolean>",
"AllowCreditCardVerificationCode": "<boolean>",
"AllowBankAccountNumber": "<boolean>",
"AllowIBAN": "<boolean>",
"AllowHealthInsuranceNumber": "<boolean>",
"AllowBearerToken": "<boolean>",
"AllowHttpCookie": "<boolean>",
"AllowPrivateKeys": "<boolean>",
"AllowCredentials": "<boolean>",
"AllowDeepWebUrls": "<boolean>",
"AllowSourceCode": "<boolean>",
"AllowIpAddress": "<boolean>",
"AllowMacAddress": "<boolean>"
}'
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
var semaphore = DispatchSemaphore (value: 0)
let parameters = "{\n \"InputFile\": \"<byte>\",\n \"FileName\": \"<string>\",\n \"RecognitionMode\": \"<string>\",\n \"RedactionMode\": \"<string>\",\n \"AllowEmailAddress\": \"<boolean>\",\n \"AllowPhoneNumber\": \"<boolean>\",\n \"AllowStreetAddress\": \"<boolean>\",\n \"AllowPersonName\": \"<boolean>\",\n \"AllowBirthDate\": \"<boolean>\",\n \"AllowPassportNumber\": \"<boolean>\",\n \"AllowDriversLicense\": \"<boolean>\",\n \"AllowSocialSecurityNumber\": \"<boolean>\",\n \"AllowTaxpayerID\": \"<boolean>\",\n \"AllowCreditCardNumber\": \"<boolean>\",\n \"AllowCreditCardExpirationDate\": \"<boolean>\",\n \"AllowCreditCardVerificationCode\": \"<boolean>\",\n \"AllowBankAccountNumber\": \"<boolean>\",\n \"AllowIBAN\": \"<boolean>\",\n \"AllowHealthInsuranceNumber\": \"<boolean>\",\n \"AllowBearerToken\": \"<boolean>\",\n \"AllowHttpCookie\": \"<boolean>\",\n \"AllowPrivateKeys\": \"<boolean>\",\n \"AllowCredentials\": \"<boolean>\",\n \"AllowDeepWebUrls\": \"<boolean>\",\n \"AllowSourceCode\": \"<boolean>\",\n \"AllowIpAddress\": \"<boolean>\",\n \"AllowMacAddress\": \"<boolean>\"\n}"
let postData = parameters.data(using: .utf8)
var request = URLRequest(url: URL(string: "//dlp/redact/document")!,timeoutInterval: Double.infinity)
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
request.addValue("YOUR-API-KEY-HERE", forHTTPHeaderField: "Apikey")
request.httpMethod = "POST"
request.httpBody = postData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
semaphore.signal()
return
}
print(String(data: data, encoding: .utf8)!)
semaphore.signal()
}
task.resume()
semaphore.wait()
This code snippet uses the built-in JavaScript XHR request capability
Run this command to install jQuery:
bower install jquery
var data = JSON.stringify({
"InputFile": "<byte>",
"FileName": "<string>",
"RecognitionMode": "<string>",
"RedactionMode": "<string>",
"AllowEmailAddress": "<boolean>",
"AllowPhoneNumber": "<boolean>",
"AllowStreetAddress": "<boolean>",
"AllowPersonName": "<boolean>",
"AllowBirthDate": "<boolean>",
"AllowPassportNumber": "<boolean>",
"AllowDriversLicense": "<boolean>",
"AllowSocialSecurityNumber": "<boolean>",
"AllowTaxpayerID": "<boolean>",
"AllowCreditCardNumber": "<boolean>",
"AllowCreditCardExpirationDate": "<boolean>",
"AllowCreditCardVerificationCode": "<boolean>",
"AllowBankAccountNumber": "<boolean>",
"AllowIBAN": "<boolean>",
"AllowHealthInsuranceNumber": "<boolean>",
"AllowBearerToken": "<boolean>",
"AllowHttpCookie": "<boolean>",
"AllowPrivateKeys": "<boolean>",
"AllowCredentials": "<boolean>",
"AllowDeepWebUrls": "<boolean>",
"AllowSourceCode": "<boolean>",
"AllowIpAddress": "<boolean>",
"AllowMacAddress": "<boolean>"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "//dlp/redact/document");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Apikey", "YOUR-API-KEY-HERE");
xhr.send(data);
var settings = {
"url": "//dlp/redact/document",
"method": "POST",
"timeout": 0,
"headers": {
"Content-Type": "application/json",
"Apikey": "YOUR-API-KEY-HERE"
},
"data": JSON.stringify({
"InputFile": "<byte>",
"FileName": "<string>",
"RecognitionMode": "<string>",
"RedactionMode": "<string>",
"AllowEmailAddress": "<boolean>",
"AllowPhoneNumber": "<boolean>",
"AllowStreetAddress": "<boolean>",
"AllowPersonName": "<boolean>",
"AllowBirthDate": "<boolean>",
"AllowPassportNumber": "<boolean>",
"AllowDriversLicense": "<boolean>",
"AllowSocialSecurityNumber": "<boolean>",
"AllowTaxpayerID": "<boolean>",
"AllowCreditCardNumber": "<boolean>",
"AllowCreditCardExpirationDate": "<boolean>",
"AllowCreditCardVerificationCode": "<boolean>",
"AllowBankAccountNumber": "<boolean>",
"AllowIBAN": "<boolean>",
"AllowHealthInsuranceNumber": "<boolean>",
"AllowBearerToken": "<boolean>",
"AllowHttpCookie": "<boolean>",
"AllowPrivateKeys": "<boolean>",
"AllowCredentials": "<boolean>",
"AllowDeepWebUrls": "<boolean>",
"AllowSourceCode": "<boolean>",
"AllowIpAddress": "<boolean>",
"AllowMacAddress": "<boolean>"
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "//dlp/redact/document"
method := "POST"
payload := strings.NewReader(`{
"InputFile": "<byte>",
"FileName": "<string>",
"RecognitionMode": "<string>",
"RedactionMode": "<string>",
"AllowEmailAddress": "<boolean>",
"AllowPhoneNumber": "<boolean>",
"AllowStreetAddress": "<boolean>",
"AllowPersonName": "<boolean>",
"AllowBirthDate": "<boolean>",
"AllowPassportNumber": "<boolean>",
"AllowDriversLicense": "<boolean>",
"AllowSocialSecurityNumber": "<boolean>",
"AllowTaxpayerID": "<boolean>",
"AllowCreditCardNumber": "<boolean>",
"AllowCreditCardExpirationDate": "<boolean>",
"AllowCreditCardVerificationCode": "<boolean>",
"AllowBankAccountNumber": "<boolean>",
"AllowIBAN": "<boolean>",
"AllowHealthInsuranceNumber": "<boolean>",
"AllowBearerToken": "<boolean>",
"AllowHttpCookie": "<boolean>",
"AllowPrivateKeys": "<boolean>",
"AllowCredentials": "<boolean>",
"AllowDeepWebUrls": "<boolean>",
"AllowSourceCode": "<boolean>",
"AllowIpAddress": "<boolean>",
"AllowMacAddress": "<boolean>"
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Apikey", "YOUR-API-KEY-HERE")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}