Below is an end-to-end example of submitting a ConvertRedact request using Perl programming language:

# Simple script to make and process the results of a ConvertRedact request to the LEADTOOLS CloudServices.
# In order to run this script, the following changes will need to be added:
#	1) Place your Application ID in the $appId variable.
#	2) Place your Application Password in the $password variable
# The script will perform the following operations in order:
#	1)Perform a ConvertRedact request to the LEADTOOLS CloudServices.  A successfully made request will return a unique identifier.
#	2)We will then query the services using the GUID -- if the file is finished processing, the body will contain all the
#	  request data.
#	3)We will take the json data that was returned, parse it, and display all the information that was returned.
# This script makes use of the following Perl libraries:
#	1) Http-Message -
#	2) libwww-perl  -
#	3) JSON-Parse   -
#	4) Try-Tiny     -

use base 'HTTP::Message';
use HTTP::Request::Common;
use LWP::UserAgent ();
use JSON::Parse ':all';
use Try::Tiny;

require HTTP::Request;
require HTTP::Headers;

my $servicesUrl = "";

#The first page in the file to mark for processing
my $firstPage = 1;

#Sending a value of -1 will indicate to the services that the rest of the pages in the file should be processed.
my $lastPage = -1;

#Enum corresponding to the output format for the file. For the purposes of this script, we will be converting to tif.
my $format = 3;

my $pattern = '(LEAD)';

my $appId = 'Replace with Application ID';
my $password = 'Replace with Application Password';

#If uploading via a URL,  the Content_length needs to be set to 0.
#If you are passing a file as multi-part content, the Content_Length does not need to be predefined.
my $headers = HTTP::Headers->new(
    Content_Length => 0
$headers->authorization_basic($appId, $password);

#The User Agent to be used when making requests
my $ua = LWP::UserAgent->new;

#We will be uploading the file via a URL.  Files can also be passed by adding a PostFile to the request.  Only 1 file will be accepted per request.
#The services will use the following priority when determining what a request is trying to do GUID > URL > Request Body Content
my $fileURL = '';
my $conversionUrl = $servicesUrl . 'Conversion/ConvertRedact?firstPage=' . $firstPage . '&lastPage=' . $lastPage . '&format=' . $format . '&fileurl=' . $fileURL . '&pattern=' . $pattern;
my $request = POST $conversionUrl,
   Content =>[];

#If uploading a file as multi-part content:
#my $conversionUrl = $servicesUrl . 'Conversion/ConvertRedact?firstPage=' . $firstPage . '&lastPage=' . $lastPage . '&format=' . $format . '&pattern=' . $pattern;
#my $request = POST $conversionUrl,
#    Content_Type => 'form-data',
#    Content=>[
#        FILE => [ "path/to/input/file" ]
#    ];

$request->authorization_basic($appId, $password);

my $response = $ua->request($request);
    print STDERR $response->status_line, "\n";

$guid = $response->decoded_content;
print("Unique ID returned by the services: " . $guid . "\n");

my $queryUrl = $servicesUrl . 'Query?id=' . $guid;
    $request = HTTP::Request->new(POST => $queryUrl, $headers);
    $response = $ua->request($request);

    $returnedData = parse_json($response->decoded_content);
    if($returnedData->{'FileStatus'} != 100 && $returnedData->{'FileStatus'} != 123){

print("File finished processing with file status: " . $returnedData->{'FileStatus'} . "\n");

    # The file did not process successfully.  Refer to our documentation for the full list of File Statuses and their associated meanings.
    if($returnedData->{'FileStatus'} != 200){
    print("Results: \n");
    $parsedResponse = $returnedData->{'RequestData'};
    foreach my $serviceResults (@@$parsedResponse){
        print "Service Type: " . $serviceResults->{'ServiceType'} . "\n";
        $urls = $serviceResults->{'urls'};
        print "URL List: \n";
        foreach my $url (@@$urls){
            print $url . "\n";
    print "Failed to parse JSON: " . 

Perl ConvertRedact Tutorial

Below is an end-to-end example of submitting a ConvertRedact request using Perl programming language:

; }