OmniPage Server API

Files

deleteFile

Deletes the specified file.

Deletes the file from the storage. The file is identified by its ID.


/files/{fileId}

Usage and SDK Samples

curl -X DELETE -H "Accept: application/json" "http://localhost:5001/v3/files/{fileId}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.FilesApi;

import java.io.File;
import java.util.*;

public class FilesApiExample {

    public static void main(String[] args) {
        
        FilesApi apiInstance = new FilesApi();
        String fileId = fileId_example; // String | The identifier of the file
        try {
            apiInstance.deleteFile(fileId);
        } catch (ApiException e) {
            System.err.println("Exception when calling FilesApi#deleteFile");
            e.printStackTrace();
        }
    }
}
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class deleteFileExample
    {
        public void main()
        {

            var apiInstance = new FilesApi();
            var fileId = fileId_example;  // String | The identifier of the file

            try
            {
                // Deletes the specified file.
                apiInstance.deleteFile(fileId);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling FilesApi.deleteFile: " + e.Message );
            }
        }
    }
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.FilesApi()
fileId = fileId_example # String | The identifier of the file

try: 
    # Deletes the specified file.
    api_instance.delete_file(fileId)
except ApiException as e:
    print("Exception when calling FilesApi->deleteFile: %s\n" % e)

Parameters

Path parameters
Name Description
fileId*
String
The identifier of the file
Required

Responses

Status: 200 - The file was successfully deleted.

Status: 400 - Unexpected error

Status: 401 - Unauthorized

Status: 403 - You don't have permission to access this file.

Status: 404 - There is no file available on the server with the specified fileId.

Status: 409 - The server denied the request due to a conflict with the actual state of the resource.


getAllFiles

Provides information about the active files that the user can access.


/files

Usage and SDK Samples

curl -X GET -H "Accept: application/json" "http://localhost:5001/v3/files?filter=&fields=&orderby=&pageSize="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.FilesApi;

import java.io.File;
import java.util.*;

public class FilesApiExample {

    public static void main(String[] args) {
        
        FilesApi apiInstance = new FilesApi();
        String filter = filter_example; 
        String fields = fields_example; // String | Returns with the specified entities only.
        String orderby = orderby_example; // String | Orders the results by the specified field.
        Integer pageSize = 56; // Integer | The maximum number of items in the result
        try {
            array[FileInformation] result = apiInstance.getAllFiles(filter, fields, orderby, pageSize);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling FilesApi#getAllFiles");
            e.printStackTrace();
        }
    }
}
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getAllFilesExample
    {
        public void main()
        {

            var apiInstance = new FilesApi();
            var filter = filter_example;  
            var fields = fields_example;  // String | Returns with the specified entities only. (optional) 
            var orderby = orderby_example;  // String | Orders the results by the specified field. (optional) 
            var pageSize = 56;  // Integer | The maximum number of items in the result (optional) 

            try
            {
                // Provides information about the active files that the user can access.
                array[FileInformation] result = apiInstance.getAllFiles(filter, fields, orderby, pageSize);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling FilesApi.getAllFiles: " + e.Message );
            }
        }
    }
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.FilesApi()
filter = filter_example 
fields = fields_example # String | Returns with the specified entities only. (optional)
orderby = orderby_example # String | Orders the results by the specified field. (optional)
pageSize = 56 # Integer | The maximum number of items in the result (optional)

try: 
    # Provides information about the active files that the user can access.
    api_response = api_instance.get_all_files(filter=filter, fields=fields, orderby=orderby, pageSize=pageSize)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling FilesApi->getAllFiles: %s\n" % e)

Parameters

Query parameters
Name Description
filter
String
Filters files. Use the following scheme for filtering:
filter=fieldName1[comparisonOperator1]'value1' logicalOperator fieldName2[comparisonOperator2]'value2' ...
You may use logical or comparison operators.
Available comparison operators
* eq - equals
* ne - not equals

Available logical operators
* and - logical and
* or - logical or
fields
String
Returns with the specified entities only.
orderby
String
Orders the results by the specified field.
pageSize
Integer (int32)
The maximum number of items in the result

Responses

Status: 200 - Successful operation

Name Type Format Description
ETag String

Status: 400 - Bad Request

Status: 401 - Unauthorized

Status: 404 - Not found.


getFile

Downloads the specified file content from the server.


/files/{fileId}

Usage and SDK Samples

curl -X GET -H "Accept: application/octet-stream,application/json" "http://localhost:5001/v3/files/{fileId}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.FilesApi;

import java.io.File;
import java.util.*;

public class FilesApiExample {

    public static void main(String[] args) {
        
        FilesApi apiInstance = new FilesApi();
        String fileId = fileId_example; // String | The identifier of the file
        try {
            byte[] result = apiInstance.getFile(fileId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling FilesApi#getFile");
            e.printStackTrace();
        }
    }
}
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getFileExample
    {
        public void main()
        {

            var apiInstance = new FilesApi();
            var fileId = fileId_example;  // String | The identifier of the file

            try
            {
                // Downloads the specified file content from the server.
                byte[] result = apiInstance.getFile(fileId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling FilesApi.getFile: " + e.Message );
            }
        }
    }
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.FilesApi()
fileId = fileId_example # String | The identifier of the file

try: 
    # Downloads the specified file content from the server.
    api_response = api_instance.get_file(fileId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling FilesApi->getFile: %s\n" % e)

Parameters

Path parameters
Name Description
fileId*
String
The identifier of the file
Required

Responses

Status: 200 - Successful operation

Name Type Format Description
ETag String

Status: 400 - Bad Request

Status: 401 - Unauthorized

Status: 403 - You don't have permission to access this file.

Status: 404 - File with the specified fileId can not be found on the server.


getFileInfo

Provides information about the specified file.


/files/{fileId}/info

Usage and SDK Samples

curl -X GET -H "Accept: application/json" "http://localhost:5001/v3/files/{fileId}/info"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.FilesApi;

import java.io.File;
import java.util.*;

public class FilesApiExample {

    public static void main(String[] args) {
        
        FilesApi apiInstance = new FilesApi();
        String fileId = fileId_example; // String | The identifier of the file
        try {
            FileInformation result = apiInstance.getFileInfo(fileId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling FilesApi#getFileInfo");
            e.printStackTrace();
        }
    }
}
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getFileInfoExample
    {
        public void main()
        {

            var apiInstance = new FilesApi();
            var fileId = fileId_example;  // String | The identifier of the file

            try
            {
                // Provides information about the specified file.
                FileInformation result = apiInstance.getFileInfo(fileId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling FilesApi.getFileInfo: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiFilesApi();
$fileId = fileId_example; // String | The identifier of the file

try {
    $result = $api_instance->getFileInfo($fileId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FilesApi->getFileInfo: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::FilesApi;

my $api_instance = WWW::SwaggerClient::FilesApi->new();
my $fileId = fileId_example; # String | The identifier of the file

eval { 
    my $result = $api_instance->getFileInfo(fileId => $fileId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling FilesApi->getFileInfo: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.FilesApi()
fileId = fileId_example # String | The identifier of the file

try: 
    # Provides information about the specified file.
    api_response = api_instance.get_file_info(fileId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling FilesApi->getFileInfo: %s\n" % e)

Parameters

Path parameters
Name Description
fileId*
String
The identifier of the file
Required

Responses

Status: 200 - Successful operation

Name Type Format Description
ETag String

Status: 400 - Bad Request

Status: 401 - Unauthorized

Status: 403 - You don't have permission to access this file.

Status: 404 - File with the specified fileId can not be found on the server.


uploadFile

Uploads an input file.

Uploads the byte content of the file.


/files

Usage and SDK Samples

curl -X POST -H "Accept: application/json" -H "Content-Type: application/octet-stream" "http://localhost:5001/v3/files?timeToLive=&metadata="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.FilesApi;

import java.io.File;
import java.util.*;

public class FilesApiExample {

    public static void main(String[] args) {
        
        FilesApi apiInstance = new FilesApi();
        Object body = ; // Object | 
        String timeToLive = timeToLive_example; // String | The life span of the uploaded input file. Format the time duration according to ISO 8601. 
        String metadata = metadata_example; // String | Free text metadata of the file, limited to 127 characters in length.
        try {
            FileInformation result = apiInstance.uploadFile(body, timeToLive, metadata);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling FilesApi#uploadFile");
            e.printStackTrace();
        }
    }
}
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class uploadFileExample
    {
        public void main()
        {

            var apiInstance = new FilesApi();
            var body = new Object(); // Object |  (optional) 
            var timeToLive = timeToLive_example;  // String | The life span of the uploaded input file. Format the time duration according to ISO 8601. 
            var metadata = metadata_example;  // String | Free text metadata of the file, limited to 127 characters in length. (optional) 

            try
            {
                // Uploads an input file.
                FileInformation result = apiInstance.uploadFile(body, timeToLive, metadata);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling FilesApi.uploadFile: " + e.Message );
            }
        }
    }
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.FilesApi()
body =  # Object |  (optional)
timeToLive = timeToLive_example # String | The life span of the uploaded input file. Format the time duration according to ISO 8601. 
metadata = metadata_example # String | Free text metadata of the file, limited to 127 characters in length. (optional)

try: 
    # Uploads an input file.
    api_response = api_instance.upload_file(body=body, timeToLive=timeToLive, metadata=metadata)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling FilesApi->uploadFile: %s\n" % e)

Parameters

Body parameters
Name Description
body
Query parameters
Name Description
timeToLive
String
The life span of the uploaded input file. Format the time duration according to ISO 8601.
This should look like this:
P[date]T[time]
P is the designator for period.
Date:
The date is composed of the following values Year(Y), Month(M), Week(W), Day(D)
Time:
The time is composed of the following values Hour(H), Minute(M), Second(S)

For example, PT1H30M means one and a half hours.
P1D means 1 day.
If the value is null, then the input file will be deleted from the server after the assigned job has been processed.
metadata
String
Free text metadata of the file, limited to 127 characters in length.

Responses

Status: 201 - The file was successfully uploaded.

Status: 400 - Bad Request

Status: 401 - Unauthorized


Jobs

addJob

Creates a new job.


/jobs

Usage and SDK Samples

curl -X POST -H "Accept: application/json" -H "Content-Type: application/json" "http://localhost:5001/v3/jobs"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.JobsApi;

import java.io.File;
import java.util.*;

public class JobsApiExample {

    public static void main(String[] args) {
        
        JobsApi apiInstance = new JobsApi();
        Job body = ; // Job | Job object to create
        try {
            JobInformation result = apiInstance.addJob(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling JobsApi#addJob");
            e.printStackTrace();
        }
    }
}
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class addJobExample
    {
        public void main()
        {

            var apiInstance = new JobsApi();
            var body = new Job(); // Job | Job object to create

            try
            {
                // Creates a new job.
                JobInformation result = apiInstance.addJob(body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling JobsApi.addJob: " + e.Message );
            }
        }
    }
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.JobsApi()
body =  # Job | Job object to create

try: 
    # Creates a new job.
    api_response = api_instance.add_job(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling JobsApi->addJob: %s\n" % e)

Parameters

Body parameters
Name Description
body *

Responses

Status: 201 - Successful operation. The job has been created on the server.

Status: 400 - Bad Request

Status: 401 - Unauthorized


deleteJob

Deletes job related data by job ID

Deletes job related data by job ID. If the job isn't already started then it will be canceled.


/jobs/{jobId}

Usage and SDK Samples

curl -X DELETE -H "Accept: application/json" "http://localhost:5001/v3/jobs/{jobId}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.JobsApi;

import java.io.File;
import java.util.*;

public class JobsApiExample {

    public static void main(String[] args) {
        
        JobsApi apiInstance = new JobsApi();
        String jobId = jobId_example; // String | identifier of the job
        try {
            apiInstance.deleteJob(jobId);
        } catch (ApiException e) {
            System.err.println("Exception when calling JobsApi#deleteJob");
            e.printStackTrace();
        }
    }
}
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class deleteJobExample
    {
        public void main()
        {

            var apiInstance = new JobsApi();
            var jobId = jobId_example;  // String | identifier of the job

            try
            {
                // Deletes job related data by job ID
                apiInstance.deleteJob(jobId);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling JobsApi.deleteJob: " + e.Message );
            }
        }
    }
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.JobsApi()
jobId = jobId_example # String | identifier of the job

try: 
    # Deletes job related data by job ID
    api_instance.delete_job(jobId)
except ApiException as e:
    print("Exception when calling JobsApi->deleteJob: %s\n" % e)

Parameters

Path parameters
Name Description
jobId*
String
identifier of the job
Required

Responses

Status: 200 - Successful operation

Status: 400 - Bad Request

Status: 401 - Unauthorized

Status: 403 - You don't have permission to access this job.

Status: 404 - This job could not be found on the server.

Status: 409 - The server denied the request due to a conflict with the actual state of the resource.


getAllJobs

Provides information about active jobs that the user can access.


/jobs

Usage and SDK Samples

curl -X GET -H "Accept: application/json" "http://localhost:5001/v3/jobs?filter=&fields=&orderby=&pageSize="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.JobsApi;

import java.io.File;
import java.util.*;

public class JobsApiExample {

    public static void main(String[] args) {
        
        JobsApi apiInstance = new JobsApi();
        String filter = filter_example; // String | Filters jobs by id/status.
        String fields = fields_example; // String | Returns only the specified entities.
        String orderby = orderby_example; // String | Orders the entities.
        Integer pageSize = 56; // Integer | The maximum number of items in the result.
        try {
            array[JobInformation] result = apiInstance.getAllJobs(filter, fields, orderby, pageSize);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling JobsApi#getAllJobs");
            e.printStackTrace();
        }
    }
}
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getAllJobsExample
    {
        public void main()
        {

            var apiInstance = new JobsApi();
            var filter = filter_example;  // String | Filters jobs by id/status. (optional)
            var fields = fields_example;  // String | Returns only the specified entities. (optional) 
            var orderby = orderby_example;  // String | Orders the entities. (optional) 
            var pageSize = 56;  // Integer | The maximum number of items in the result. (optional) 

            try
            {
                // Provides information about active jobs that the user can access.
                array[JobInformation] result = apiInstance.getAllJobs(filter, fields, orderby, pageSize);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling JobsApi.getAllJobs: " + e.Message );
            }
        }
    }
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.JobsApi()
filter = filter_example # String | Filters jobs by id/status.
fields = fields_example # String | Returns only the specified entities. (optional)
orderby = orderby_example # String | Orders the entities. (optional)
pageSize = 56 # Integer | The maximum number of items in the result. (optional)

try: 
    # Provides information about active jobs that the user can access.
    api_response = api_instance.get_all_jobs(filter=filter, fields=fields, orderby=orderby, pageSize=pageSize)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling JobsApi->getAllJobs: %s\n" % e)

Parameters

Query parameters
Name Description
filter
String
Filters jobs by id/status.
You may use logical or comparison operators.
Comparison operators * eq - equals * ne - not equals * in - value is included in a list
Logical operators * and - logical and * or - logical or For example, filter=status eq 'Completed' or status eq 'Failed'
fields
String
Returns only the specified entities.
orderby
String
Orders the entities.
pageSize
Integer (int32)
The maximum number of items in the result.

Responses

Status: 200 - Successful operation

Name Type Format Description
ETag String

Status: 400 - Bad Request

Status: 401 - Unauthorized

Status: 404 - Not Found


getAllJobsHead

Provides information about the active jobs that the user can access.


/jobs

Usage and SDK Samples

curl -X HEAD "http://localhost:5001/v3/jobs?filter=&fields=&orderby=&pageSize="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.JobsApi;

import java.io.File;
import java.util.*;

public class JobsApiExample {

    public static void main(String[] args) {
        
        JobsApi apiInstance = new JobsApi();
        String filter = filter_example; // String | Filters jobs by id/status. 
        String fields = fields_example; // String | Returns only the specified entities.
        String orderby = orderby_example; // String | Orders the entities.
        Integer pageSize = 56; // Integer | The maximum number of items in the result.
        try {
            apiInstance.getAllJobsHead(filter, fields, orderby, pageSize);
        } catch (ApiException e) {
            System.err.println("Exception when calling JobsApi#getAllJobsHead");
            e.printStackTrace();
        }
    }
}
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getAllJobsHeadExample
    {
        public void main()
        {

            var apiInstance = new JobsApi();
            var filter = filter_example;  // String | Filters jobs by id/status. (optional)
            var fields = fields_example;  // String | Returns only the specified entities. (optional) 
            var orderby = orderby_example;  // String | Orders the entities. (optional) 
            var pageSize = 56;  // Integer | The maximum number of items in the result. (optional) 

            try
            {
                // Provides information about the active jobs that the user can access.
                apiInstance.getAllJobsHead(filter, fields, orderby, pageSize);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling JobsApi.getAllJobsHead: " + e.Message );
            }
        }
    }
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.JobsApi()
filter = filter_example # String | Filters jobs by id/status. (optional)
fields = fields_example # String | Returns only the specified entities. (optional)
orderby = orderby_example # String | Orders the entities. (optional)
pageSize = 56 # Integer | The maximum number of items in the result. (optional)

try: 
    # Provides information about the active jobs that the user can access.
    api_instance.get_all_jobs_head(filter=filter, fields=fields, orderby=orderby, pageSize=pageSize)
except ApiException as e:
    print("Exception when calling JobsApi->getAllJobsHead: %s\n" % e)

Parameters

Query parameters
Name Description
filter
String
Filters jobs by id/status. You may use logical or comparison operators. Comparison operators * eq - equals * ne - not equals * in - value is included in a list Logical operators * and - logical and * or - logical or For example, filter=status eq 'Completed' or status eq 'Failed'
fields
String
Returns only the specified entities.
orderby
String
Orders the entities.
pageSize
Integer (int32)
The maximum number of items in the result.

Responses

Status: 200 - Successful operation

Name Type Format Description
ETag String

Status: 400 - Bad Request

Status: 401 - Unauthorized

Status: 403 - You don't have permission to access this job

Status: 404 - Job not found on the server


getJob

Provides information about the given job


/jobs/{jobId}

Usage and SDK Samples

curl -X GET -H "Accept: application/json" "http://localhost:5001/v3/jobs/{jobId}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.JobsApi;

import java.io.File;
import java.util.*;

public class JobsApiExample {

    public static void main(String[] args) {
        
        JobsApi apiInstance = new JobsApi();
        String jobId = jobId_example; // String | identifier of the job
        try {
            JobInformation result = apiInstance.getJob(jobId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling JobsApi#getJob");
            e.printStackTrace();
        }
    }
}
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getJobExample
    {
        public void main()
        {

            var apiInstance = new JobsApi();
            var jobId = jobId_example;  // String | identifier of the job

            try
            {
                // Provides information about the given job
                JobInformation result = apiInstance.getJob(jobId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling JobsApi.getJob: " + e.Message );
            }
        }
    }
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.JobsApi()
jobId = jobId_example # String | identifier of the job

try: 
    # Provides information about the given job
    api_response = api_instance.get_job(jobId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling JobsApi->getJob: %s\n" % e)

Parameters

Path parameters
Name Description
jobId*
String
identifier of the job
Required

Responses

Status: 200 - Successful operation

Name Type Format Description
ETag String

Status: 400 - Invalid id supplied

Status: 401 - Unauthorized

Status: 403 - You don't have permission to access this job

Status: 404 - Job not found on the server


getJobHead

Provides information about the given job


/jobs/{jobId}

Usage and SDK Samples

curl -X HEAD "http://localhost:5001/v3/jobs/{jobId}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.JobsApi;

import java.io.File;
import java.util.*;

public class JobsApiExample {

    public static void main(String[] args) {
        
        JobsApi apiInstance = new JobsApi();
        String jobId = jobId_example; // String | identifier of the job
        try {
            apiInstance.getJobHead(jobId);
        } catch (ApiException e) {
            System.err.println("Exception when calling JobsApi#getJobHead");
            e.printStackTrace();
        }
    }
}
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getJobHeadExample
    {
        public void main()
        {

            var apiInstance = new JobsApi();
            var jobId = jobId_example;  // String | identifier of the job

            try
            {
                // Provides information about the given job
                apiInstance.getJobHead(jobId);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling JobsApi.getJobHead: " + e.Message );
            }
        }
    }
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.JobsApi()
jobId = jobId_example # String | identifier of the job

try: 
    # Provides information about the given job
    api_instance.get_job_head(jobId)
except ApiException as e:
    print("Exception when calling JobsApi->getJobHead: %s\n" % e)

Parameters

Path parameters
Name Description
jobId*
String
identifier of the job
Required

Responses

Status: 200 - Successful operation

Name Type Format Description
ETag String

Status: 400 - Invalid id supplied

Status: 401 - Unauthorized

Status: 403 - You don't have permission to access this file

Status: 404 - Job not found on the server


Status

getStatus

Provides status information about the service.

Queries the service status. Checks the file storage, database access, and the queue length.


/status

Usage and SDK Samples

curl -X GET -H "Accept: application/json" "http://localhost:5001/v3/status"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.StatusApi;

import java.io.File;
import java.util.*;

public class StatusApiExample {

    public static void main(String[] args) {
        
        StatusApi apiInstance = new StatusApi();
        try {
            Status result = apiInstance.getStatus();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling StatusApi#getStatus");
            e.printStackTrace();
        }
    }
}
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getStatusExample
    {
        public void main()
        {

            var apiInstance = new StatusApi();

            try
            {
                // Provides status information about the service.
                Status result = apiInstance.getStatus();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling StatusApi.getStatus: " + e.Message );
            }
        }
    }
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.StatusApi()

try: 
    # Provides status information about the service.
    api_response = api_instance.get_status()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling StatusApi->getStatus: %s\n" % e)

Parameters

Responses

Status: 200 - Successful operation

Name Type Format Description
ETag String

Status: 403 - You don't have permission to access this service.

Status: 404 - Not Found.


getStatusHead

Provides status information about the service.

Queries the service status. It checks the file storage, database access, and the queue length.


/status

Usage and SDK Samples

curl -X HEAD "http://localhost:5001/v3/status"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.StatusApi;

import java.io.File;
import java.util.*;

public class StatusApiExample {

    public static void main(String[] args) {
        
        StatusApi apiInstance = new StatusApi();
        try {
            apiInstance.getStatusHead();
        } catch (ApiException e) {
            System.err.println("Exception when calling StatusApi#getStatusHead");
            e.printStackTrace();
        }
    }
}
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getStatusHeadExample
    {
        public void main()
        {

            var apiInstance = new StatusApi();

            try
            {
                // Provides status information about the service.
                apiInstance.getStatusHead();
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling StatusApi.getStatusHead: " + e.Message );
            }
        }
    }
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.StatusApi()

try: 
    # Provides status information about the service.
    api_instance.get_status_head()
except ApiException as e:
    print("Exception when calling StatusApi->getStatusHead: %s\n" % e)

Parameters

Responses

Status: 200 - Successful operation

Name Type Format Description
ETag String

Status: 403 - You don't have permission to access this service.

Status: 404 - Not Found.


Samples

The following samples are based on clients generated from the OpenAPI Specification of the OmniPage Server API, except for Curl. You can generate your client in the following way:
- Download a swagger editor (https://swagger.io/tools/swagger-editor/download/) or use the online version (https://editor.swagger.io/).
- Copy the content of the "rest api v3.0.yaml" to the left panel of the Swagger Editor. The YAML file is part of the OPS package at "Samples.zip\API\restapiv3.0.yaml".
- Click "Generate Client" at the top-right of the menu and pick the preferred language, then download the generated client library. For details, see the Sample Reference Guide.

Simple Conversion Job

This example shows the simplest case, which uploads an input image file, defines a conversion that recognizes the image and converts its content to TEXT, waits for the job to complete, and downloads the result file.

Upload Input Files

Upload input files to the OPS server via the File API or copy them to a file share that OPS can access. An API call can upload only a single input file, so you should repeat this step for each input file.

Request

curl -X POST "http://localhost:5002/v3/files" -H "accept: application/json" -H "content-type: application/octet-stream" --data-binary @c:\OPS\Test\Input\small.jpg

Response

{
  "id": "52267955-f47a-41e4-a93a-e2cf83db023f" 
}
FilesApi filesApi = new FilesApi();
filesApi.getApiClient().setBasePath(baseURL); // e.g. @"http://ops-server:5002/v3"
FileInformation fileInformation = null;
byte[] file = Files.readAllBytes(inputFilePath); // inputFilePath -> java.nio.file.Path
fileInformation = filesApi.uploadFile(file, "PT12H", "InputFile");
String fileId = fileInformation.getId();
FilesApi filesApi = new FilesApi(baseUrl); // e.g. @"http://ops-server:5002/v3"
FileInformation fileInformation;
using (FileStream fileStream = new FileStream(inputFilePath, FileMode.Open, FileAccess.Read))
{
    BinaryReader binaryReader = new BinaryReader(fileStream);
    byte[] fileContent = binaryReader.ReadBytes((int)new FileInfo(inputFilePath).Length);
    fileInformation = filesApi.UploadFile(fileContent);
}
string fileId = fileInformation.Id;
fileapi = swagger_client.FilesApi()
fileapi.api_client.configuration.host = baseURL # e.g. @"http://ops-server:5002/v3"
with open(inputFilePath, 'rb') as f:
    content = f.read()
fileinfo = fileapi.upload_file(body=content)
fileId = fileinfo.id

Create Job

Request

curl -X POST "http://localhost:5002/v3/jobs" -H "accept: application/json" -H "content-type: application/json" -d  @c:\OPS\Test\Input\job.json
The example above contains the content of the uploaded JSON payload object ("job.json"). This example will result in a text conversion leaving all parameters at the default value. The specified URI refers to the input file uploaded to the storage in the previous step.
{
  "inputs": [
  {
    "uri": "storage://52267955-f47a-41e4-a93a-e2cf83db023f",
  }],
  "conversions": 
  {
    "text": [
    {
      "format" : "text"
      "resultFileName" : "result.txt"
    }]
  }
}

Response

{
  "id":"93ccd159-01f0-4605-af7c-0187cd8f3537",
  "status":"waiting",
  "progress": 0 
}
JobsApi  jobsApi  = new JobsApi();
jobsApi.getApiClient().setBasePath(baseURL);

List<Input> inputs = new ArrayList<>();
Input newinput = new Input();
newinput.setUri("storage://" + fileId);
inputs.add(newinput);

List textList = new ArrayList<>();
Text text = new Text();
text.format(Text.FormatEnum.TEXT);
textList.add(text);
Conversions conversion = new Conversions();
conversion.setText(textList);

Job job = new Job();
job.inputs(inputs);
job.conversions(conversion);

JobInformation jobInformation = null;
jobInformation = jobsApi.addJob(job);
JobsApi jobsApi = new JobsApi(ServiceBaseUrl, Client);

Job job = new Job(
    new List<Input>() { new Input("storage://" + fileId) },
    new Conversions() { Text = new List() { new Text() }
);

JobInformation jobInformation = jobsApi.AddJob(job);
jobsapi = swagger_client.JobsApi()
jobsapi.api_client.configuration.host = baseURL # e.g. @"http://ops-server:5002/v3"

inputfile = swagger_client.Input(uri=f"storage://{ fileinfo.id }")
text = swagger_client.Text()
conversions = swagger_client.Conversions(text=[ text ])
job = swagger_client.Job(inputs=[ inputfile ], conversions=conversions)
jobInformation = jobsapi.add_job(body=job)

Get job progress

Keep querying the status of the uploaded job from the server while it returns as "waiting" or "running".

Request

curl -X GET "http://localhost:5002/v3/jobs/93ccd159-01f0-4605-af7c-0187cd8f3537/info" -H  "accept: application/json"

Response

A successful transaction returns the following JSON response, which contains the unique file identifier (id). This id will be required later when attaching the file to a job.

The server responds with the following object when the job is still under processing:

{
    "id": "93ccd159-01f0-4605-af7c-0187cd8f3537",
    "status": "running",
    "request": {
        "inputs": [{
                "uri": "storage://86f268de-0182-4d76-a6b8-c79c9e158908"
            }
        ],
        "conversions": {
            "text": [{}
            ]
        }
    },
    "progress": 17
}

The server responds with the following object when the job is completed:

{
  "id": "93ccd159-01f0-4605-af7c-0187cd8f3537",
  "status": "completed",
  "request": {
    "inputs": [
      {
        "uri": "storage://86f268de-0182-4d76-a6b8-c79c9e158908"
      }
    ],
    "conversions": {
      "text": [
        {}
      ]
    }
  },
  "progress": 100,
  "outputs": [
    {
      "uri": "storage://4f25685f-5ac5-4d97-9f85-1fa1a4cb1346",
      "fileName": "result.txt"
    }
  ]
}
}
do
{
    Thread.sleep(1000);
    jobInformation = jobsApi.getJob(jobInformation.getId());
}
while (jobInformation.getStatus() == JobInformation.StatusEnum.WAITING || jobInformation.getStatus() == JobInformation.StatusEnum.RUNNING);
do
{
    Thread.Sleep(pollingInterval);
    jobInformation = jobsApi.GetJobInformationById(jobInformation.Id);
}
while (jobInformation.Status == JobInformation.StatusEnum.Waiting || jobInformation.Status == JobInformation.StatusEnum.Running);
while True:
time.sleep(1)
jobInformation = jobsapi.get_job(jobInformation.id)
if 'waiting' not in jobInformation.status and 'running' not in jobInformation.status:
    break

Download result

Upload input files to the OPS server via the File API or copy them to a file share that OPS can access. An API call can upload only a single input file, so you should repeat this step for each input file.

Request

curl -X GET "http://localhost:5002/v3/files/4f25685f-5ac5-4d97-9f85-1fa1a4cb1346" -H  "accept: application/json"  --output  c:\OPS\Test\Output\result.txt

Response

{ 
  "id": "52267955-f47a-41e4-a93a-e2cf83db023f" 
}
Output output = jobInformation.getOutputs().get(0);
fileId = output.getUri().substring(10);
java.io.File outputFileContent = filesApi.getFile(fileId);
Files.copy(outputFileContent.toPath(), new File(outputFilePath + "\\" + output.getFileName()).toPath(), StandardCopyOption.REPLACE_EXISTING);
byte[] fileContent = filesApi.GetFile(fileId, "content");

using (FileStream fileStream = new FileStream(filePath, FileMode.Create, FileAccess.Write))
{
    fileStream.Write(fileContent, 0, fileContent.Length);
}
output = jobInformation.outputs[0]
fileID = output.uri[10:]
content = fileapi.get_file(file_id=fileID)
outFile = open(f"{ outputPath }\\{ output.file_name }")
outFile.write(content)
outFile.close()

Complex Conversion Job

The following sample shows a complex job. In this job, we upload several input files. The OCR process results in two output formats (Text and PDF). We set some general parameters (Recognition Languages) and some converter specific parameters (Pdf Compatibility, Text output mode).

Upload Input Files

Upload input files to the OPS server via the File API or copy them to a file share that OPS can access. An API call can upload only a single input file, so you should repeat this step for each input file.

Request

Upload the first input file.

curl -X POST "http://localhost:5002/v3/files" -H "accept: application/json" -H "content-type: application/octet-stream" --data-binary @c:\OPS\Test\Input\input1.tif

Response

{
  "id": "52267955-f47a-41e4-a93a-e2cf83db023f" 
}						   

Request

Upload the second input file.

curl -X POST "http://localhost:5002/v3/files" -H "accept: application/json" -H "content-type: application/octet-stream" --data-binary @c:\OPS\Test\Input\input2.tif

Response

{
  "id": "8c5abbae-ad8c-4d89-b94d-87f7be1baf12" 
}
FilesApi filesApi = new FilesApi();
filesApi.getApiClient().setBasePath(baseURL); // e.g. @"http://ops-server:5002/v3"
List<Input> inputs = new ArrayList<>();

for(Path inputFilePath : inputFilePaths)
{
    byte[] file = Files.readAllBytes(inputFilePath); // inputFilePath -> java.nio.file.Path
    FileInformation fileInformation = filesApi.uploadFile(file, "PT12H", "InputFile");
    Input newinput = new Input();
    newinput.setUri("storage://" + fileInformation.getId());
    newinput.setType(Input.TypeEnum.IMAGE);
    newinput.setPageRange("1-3");
    inputs.add(newinput);
}
FilesApi filesApi = new FilesApi(baseUrl);  // e.g. @"http://ops-server:5002/v3"
List<Input> inputs = new List<Input>();
foreach (string inputFilePath in inputFilePaths)
{
    using (FileStream fileStream = new FileStream(inputFilePath, FileMode.Open, FileAccess.Read))
    {
        BinaryReader binaryReader = new BinaryReader(fileStream);
        byte[] fileContent = binaryReader.ReadBytes((int)new FileInfo(inputFilePath).Length);
        FileInformation fileInformation = filesApi.UploadFile(fileContent);
        inputs.Add(new Input("storage://" + fileInformation.Id)
        {
            PageRange = "1-3",              // process only the first three page
            Type = Input.TypeEnum.Image,    // the uploaded content is image document
        }); 
    }
}
fileapi = swagger_client.FilesApi()
fileapi.api_client.configuration.host = baseURL # e.g. @"http://ops-server:5002/v3"
inputs=[]
for i in range(len(inputFilesPaths)):
    filename = inputFilesPaths[i]
    fileinfo = fileapi.upload_file(body=content)
    with open(filename, 'rb') as f:
        content = f.read()
    uri = f"storage://{ fileinfo.id }"
    inputs.append(swagger_client.Input(uri=uri, type="image", page_range="1-3"))

Create Job

Request

curl -X POST "http://localhost:5002/v3/jobs" -H "accept: application/json" -H "content-type: application/json" -d  @c:\OPS\Test\Input\job.json
The example above contains the content of the uploaded JSON payload object ("job.json"). This example will result in a text conversion leaving all parameters at the default value. The specified URI refers to the input file uploaded to the storage in the previous step.
{
  "inputs": [
    {
      "uri": "storage://f4a397d8-85b4-4774-8a2b-4a6b4880f3c0",
      "type": "image",
      "pageRange": "1-3",
    },
    {
      "uri": "storage://e15c9505-52ee-48b1-9405-95864b251da4",
      "type": "image",
      "pageRange": "1-3",
    }
  ],
  "conversions": {
    "pdf": [
      {
        "format": "normal",
        "resultFileName": "result.pdf",
        "imageQuality": "max",
        "ignoreHeadersFooters": false,
        "compatibility": "pdf17",
      }
    ],
    "office": null,
    "text": [
      {
        "format": "text",
        "resultFileName": "result.txt",
        "outputMode": "flowingPage",
      }
    ]
  },
  "parameters": {
    "recognitionTradeoff": "accuracy",
    "layoutTradeoff": "accuracy",
    "recognitionLanguages": [
      "English",
      "German"
    ]
  }
}

Response

{
  "id":"1f455682-85e1-47ad-8681-dc8d50ce6b5c",
  "status":"waiting",
  "progress": 0 
}
JobsApi  jobsApi  = new JobsApi();
jobsApi.getApiClient().setBasePath(baseURL);

Text text = new Text();
text.format(Text.FormatEnum.TEXT);
text.setResultFileName("result.txt");
text.setOutputMode(Text.OutputModeEnum.FLOWINGPAGE);
List textList = new ArrayList<>();
textList.add(text);

Pdf pdf = new Pdf();
pdf.setFormat(Pdf.FormatEnum.NORMAL);
pdf.setResultFileName("result.pdf");
pdf.setCompatibility(Pdf.CompatibilityEnum.PDF17);
pdf.setImageQuality(Pdf.ImageQualityEnum.MAX);
List pdfList = new ArrayList<>();
pdfList.add(pdf);

Conversions conversions = new Conversions();
conversions.setText(textList);
conversions.setPdf(pdfList);

Parameters parameters = new Parameters();
parameters.setRecognitionTradeoff(Parameters.RecognitionTradeoffEnum.ACCURACY);
parameters.setLayoutTradeoff(Parameters.LayoutTradeoffEnum.ACCURACY);
List languages = new ArrayList<>();
languages.add(Parameters.RecognitionLanguagesEnum.ENGLISH);
languages.add(Parameters.RecognitionLanguagesEnum.GERMAN);
parameters.setRecognitionLanguages(languages);

Job job = new Job();
job.inputs(inputs);
job.conversions(conversions);
job.parameters(parameters);
JobInformation jobInformation = null;
jobInformation = jobsApi.addJob(job);
JobsApi jobApi = new JobsApi(baseUrl);
Conversions conversions = new Conversions()
{
    Text = new List()
    {
        new Text() {
            Format = Text.FormatEnum.Text,
            ResultFileName = "result.txt",
            OutputMode = Text.OutputModeEnum.FlowingPage
        }
    },
    Pdf = new List()
    {
        new Pdf() { 
            Format = Pdf.FormatEnum.Normal, 
            ResultFileName = "result.pdf", 
            Compatibility = Pdf.CompatibilityEnum.Pdf17,
            ImageQuality = Pdf.ImageQualityEnum.Max
        }
    }
};

Parameters parameters = new Parameters()
{
    RecognitionTradeoff = Parameters.RecognitionTradeoffEnum.Accuracy,
    LayoutTradeoff = Parameters.LayoutTradeoffEnum.Accuracy,
    RecognitionLanguages = new List() 
    { 
        Parameters.RecognitionLanguagesEnum.English, 
        Parameters.RecognitionLanguagesEnum.German 
    }
};

Job job = new Job(inputs, conversions, parameters);
JobInformation jobInformation = jobApi.AddJob(job);
jobsapi = swagger_client.JobsApi()
jobsapi.api_client.configuration.host = baseURL # e.g. @"http://ops-server:5002/v3"

text = swagger_client.Text()
text.format = 'text'
text.result_file_name = 'result.txt'
text.output_mode = 'flowingPage'

pdf = swagger_client.Pdf()
pdf.format = 'normal'
pdf.result_file_name = 'result.pdf'
pdf.compatibility = 'pdf17'
pdf.image_quality = 'max'

conversions = swagger_client.Conversions(text=[ text ],  pdf=[ pdf ])

parameters = swagger_client.Parameters(recognition_tradeoff='accuracy', recognition_languages=['English', 'German'], layout_tradeoff='accuracy')

job = swagger_client.Job(inputs=inputs, conversions=conversions, parameters=parameters)
jobInformation = jobsapi.add_job(body=job)

Get job progress

Keep querying the status of the uploaded job from the server while it returns as "waiting" or "running".

Request

curl -X GET "http://localhost:5002/v3/jobs/1f455682-85e1-47ad-8681-dc8d50ce6b5c/info" -H  "accept: application/json"

Response

A successful transaction returns the following JSON response, which contains the unique file identifier (id). This id will be required later when attaching the file to a job.

The server responds with the following object when the job is still under processing:

{
    "Id": "1f455682-85e1-47ad-8681-dc8d50ce6b5c",
    "Status": "running",
    "Progress": 15,
}

The server responds with the following object when the job is completed:

{
  "id": "1f455682-85e1-47ad-8681-dc8d50ce6b5c",
  "status": "completed",
  "request": {
    "inputs": [
      {
        "uri": "storage://72a82bc7-65a4-471f-bcc6-e71e3af4b1b9",
        "type": "image",
        "pageRange": "1-3",
      },
      {
        "uri": "storage://a1b98737-8ff5-49fd-a866-2fc2a2a4adf8",
        "type": "image",
        "pageRange": "1-3",
      }
    ],
    "conversions": {
      "pdf": [
        {
          "format": "normal",
          "resultFileName": "result.pdf",
          "imageQuality": "max",
          "compatibility": "pdf17",
        }
      ],
      "text": [
        {
          "format": "text",
          "resultFileName": "result.txt",
          "outputMode": "flowingPage",
        }
      ]
    },
    "parameters": {
      "recognitionTradeoff": "accuracy",
      "layoutTradeoff": "accuracy",
      "recognitionLanguages": [
        "English",
        "German"
      ],
      "logicalFormRecognition": false
    }
  },
  "progress": 100,
  "outputs": [
    {
      "uri": "storage://b2e124f2-11d8-4968-9923-9fa27c4ec3b1",
      "fileName": "result.pdf"
    },
    {
      "uri": "storage://e251d90f-8dc8-458e-91b7-d911efcd7b0f",
      "fileName": "result.txt"
    }
  ],
  "errors": []
}
do
{
    Thread.sleep(1000);
    jobInformation = jobsApi.getJob(jobInformation.getId());
}
while (jobInformation.getStatus() == JobInformation.StatusEnum.WAITING || jobInformation.getStatus() == JobInformation.StatusEnum.RUNNING);
do
{
    Thread.Sleep(1000);
    jobInformation = jobApi.GetJob(jobInformation.Id);
}
while (jobInformation.Status == JobInformation.StatusEnum.Waiting || jobInformation.Status == JobInformation.StatusEnum.Running);
while True:
    time.sleep(1)
    jobInformation = jobsapi.get_job(jobInformation.id)
    if 'waiting' not in jobInformation.status and 'running' not in jobInformation.status:
        break

Download result

Upload input files to the OPS server via the File API or copy them to a file share that OPS can access. An API call can upload only a single input file, so you should repeat this step for each input file.

Request

curl -X GET "http://localhost:5002/v3/files/b2e124f2-11d8-4968-9923-9fa27c4ec3b1" -H  "accept: application/json"  --output  c:\OPS\Test\Output\result.pdf
						   
curl -X GET "http://localhost:5002/v3/files/e251d90f-8dc8-458e-91b7-d911efcd7b0f" -H  "accept: application/json"  --output  c:\OPS\Test\Output\result.txt

Response

The result contains the output file. In this example the downloaded files are saved directly to the disk.
if (jobInformation.getStatus() == JobInformation.StatusEnum.COMPLETED)
{
    for(Output output : jobInformation.getOutputs())
    {
        String fileId = output.getUri().substring(10);
        java.io.File outputFileContent = filesApi.getFile(fileId);
        Files.copy(outputFileContent.toPath(), new File(outputFilePath + "\\" + output.getFileName()).toPath(), StandardCopyOption.REPLACE_EXISTING);
    }
}

for(Error error : jobInformation.getErrors())
{
    System.out.println(String.format("Error code: {0}, message: {1}", error.getCode(), error.getMessage()));
}
if (jobInformation.Status == JobInformation.StatusEnum.Completed)
{
    foreach (Output output in jobInformation.Outputs)
    {
        string fileId = output.Uri.Substring(10);
        byte[] outputFileContent = filesApi.GetFile(fileId);
        File.WriteAllBytes(Path.Combine(outputFolder, output.FileName), outputFileContent);
    }
}


foreach (Error error in jobInformation.Errors)	// print out the processing errors
{
    Console.WriteLine(string.Format("Error code:{0}, message:{1}", error.Code, error.Message));
}
output = jobInformation.outputs[0]
fileID = output.uri[10:]
content = fileapi.get_file(file_id=fileID)
outFile = open(f"{ outputPath }\\{ output.file_name }")
outFile.write(content)
outFile.close()

Classification Job

Document classification means that documents or pages are assigned to classes. Document classification requires a document classifier project file that can be generated using the Document Classifier Assistant tool. This tool is not provided with OmniPage, but it is the part of the OmniPage Capture SDK (CSDK). For details, refer to the Document Classifier Assistant section in the CSDK Help. In this section, we assume that the you already have a Document Classifier Project file (.dcp). The following example shows how to use OmniPage Server to perform document classification.

Upload Input Files

Upload input files to the OPS server via the File API or copy them to a file share that OPS can access. An API call can upload only a single input file, so you should repeat this step for each input file.

Request

Upload the first input files.

curl -X POST "http://localhost:5002/v3/files" -H "accept: application/json" -H "content-type: application/octet-stream" --data-binary @c:\OPS\Test\Input\input.tif

Response

{
  "id": "52267955-f47a-41e4-a93a-e2cf83db023f" 
}						   

Request

You should upload the document classifier project (.dcp) file the same way as the other input files.

curl -X POST "http://localhost:5002/v3/files" -H "accept: application/json" -H "content-type: application/octet-stream" --data-binary @c:\OPS\Test\Input\classifier.dcp

Response

{
  "id": "8c5abbae-ad8c-4d89-b94d-87f7be1baf12" 
}
FilesApi filesApi = new FilesApi();
filesApi.getApiClient().setBasePath(baseURL); // e.g. @"http://ops-server:5002/v3"
List<Input> inputs = new ArrayList<>();

// upload input files
for(Path inputFilePath : inputFilePaths)
{
    byte[] file = Files.readAllBytes(inputFilePath); // inputFilePath -> java.nio.file.Path
    FileInformation fileInformation = filesApi.uploadFile(file, "PT12H", "InputFile");
    Input newinput = new Input();
    newinput.setUri("storage://" + fileInformation.getId());
    newinput.setType(Input.TypeEnum.IMAGE); // the uploaded content is image document
    inputs.add(newinput);
}

// Upload the project file
byte[] file = Files.readAllBytes(classifierProjectFilePath); // inputFilePath -> java.nio.file.Path
FileInformation fileInformation = filesApi.uploadFile(file, "PT12H", "DCP InputFile");
Input newinput = new Input();
newinput.setUri("storage://" + fileInformation.getId());
newinput.setType(Input.TypeEnum.DOCUMENTCLASSIFIERPROJECT); // the uploaded content is the classifier project file
inputs.add(newinput);
// upload input files 
FilesApi filesApi = new FilesApi(baseUrl);  // e.g. @"http://ops-server:5002/v3"
List<Input> inputs = new List<Input>();
foreach (string inputFilePath in inputFilePaths)
{
    using (FileStream fileStream = new FileStream(inputFilePath, FileMode.Open, FileAccess.Read))
    {
        BinaryReader binaryReader = new BinaryReader(fileStream);
        byte[] fileContent = binaryReader.ReadBytes((int)new FileInfo(inputFilePath).Length);
        FileInformation fileInformation = filesApi.UploadFile(fileContent);
        inputs.Add(new Input("storage://" + fileInformation.Id)
        {
            Type = Input.TypeEnum.Image,                    // the uploaded content is image document
        });
    }
}

// upload the project file 
using (FileStream fileStream = new FileStream(classifierProjectFilePath, FileMode.Open, FileAccess.Read))
{
    BinaryReader binaryReader = new BinaryReader(fileStream);
    byte[] fileContent = binaryReader.ReadBytes((int)new FileInfo(classifierProjectFilePath).Length);
    FileInformation fileInformation = filesApi.UploadFile(fileContent);
    inputs.Add(new Input("storage://" + fileInformation.Id)
    {
        Type = Input.TypeEnum.DocumentClassifierProject,    // the uploaded content is the classifier project file
    });
}
fileapi = swagger_client.FilesApi()
fileapi.api_client.configuration.host = baseURL # e.g. @"http://ops-server:5002/v3"
inputs=[]

# Upload input files
for i in range(len(inputFilesPaths)):
    filename = inputFilesPaths[i]
    with open(filename, 'rb') as f:
        content = f.read()
    fileinfo = fileapi.upload_file(body=content)
    uri = f"storage://{ fileinfo.id }"
    inputs.append(swagger_client.Input(uri=uri, type="image", page_range="1-3"))

# Upload the project file
fileinfo = fileapi.upload_file(body=content, time_to_live='PT12H', metadata='DCProject file for DocumentClassificationSample')
inputs.append(swagger_client.Input(uri=f"storage://{ fileinfo.id }", type="documentClassifierProject"))

Create Job

Request

curl -X POST "http://localhost:5002/v3/jobs" -H "accept: application/json" -H "content-type: application/json" -d  @c:\OPS\Test\Input\job.json
The example above contains the content of the uploaded JSON payload object ("job.json"). The Document Classification cannot be combined with other conversations. It is important to mark the document classifier project (.dcp) file among the inputs by specifying its type (DocumentClassifierProject) A classification can of course contain several input files, but only one document classifier project file.
{
  "inputs": [
    {
      "uri": "storage://52267955-f47a-41e4-a93a-e2cf83db023f",
      "type": "image"
    },
    {
      "uri": "storage://7a77d42a-f100-4bc5-84e2-45866de8bdc6",
      "type": "image"
    },
    {
      "uri": "storage://8c5abbae-ad8c-4d89-b94d-87f7be1baf12",
      "type": "documentClassifierProject"
    }
  ],
  "conversions": {
    "classification": {
      "format": "json",
      "resultFileName": "classification.json"
    }
  }
}

Response

{
  "id":"1f455682-85e1-47ad-8681-dc8d50ce6b5c",
  "status":"waiting",
  "progress": 0 
}
JobsApi  jobsApi  = new JobsApi();
jobsApi.getApiClient().setBasePath(baseURL);

Classification classification = new Classification();
classification.setFormat(Classification.FormatEnum.JSON);
classification.setResultFileName("classification.json");
Conversions conversion = new Conversions();
conversion.setClassification(classification);

Job job = new Job();
job.inputs(inputs);
job.conversions(conversion);

JobInformation jobInformation = null;
jobInformation = jobsApi.addJob(job);
JobsApi jobApi = new JobsApi(baseUrl);
Conversions conversions = new Conversions()
{
    Classification = new Classification()
    {
        Format = IO.Swagger.Model.Classification.FormatEnum.Json,
        ResultFileName = "classification.json"
    }
};

Job job = new Job(inputs, conversions);
JobInformation jobInformation = jobApi.AddJob(job);
jobsapi = swagger_client.JobsApi()
jobsapi.api_client.configuration.host = baseURL # e.g. @"http://ops-server:5002/v3"

classification = swagger_client.Classification(format='json', result_file_name='classification.json')
conversions = swagger_client.Conversions(classification=classification)

job = swagger_client.Job(inputs=inputs, conversions=conversions)
jobInformation = jobsapi.add_job(body=job)

Get job progress

Keep querying the status of the uploaded job from the server while it returns as "waiting" or "running".

Request

curl -X GET "http://localhost:5002/v3/jobs/1f455682-85e1-47ad-8681-dc8d50ce6b5c/info" -H  "accept: application/json"

Response

A successful transaction returns the following JSON response, which contains the unique file identifier (id). This id will be required later when attaching the file to a job.

The server responds with the following object when the job is still under processing:

{
    "Id": "1f455682-85e1-47ad-8681-dc8d50ce6b5c",
    "Status": "running",
    "Progress": 15,
}

The server responds with the following object when the job is completed:

{
  "id": "97330cf2-df08-4eea-8c0c-aa4fc0ebf5e7",
  "status": "completed",
  "request": {
    "inputs": [
      {
        "uri": "storage://2ce437b7-d8e9-4815-90ab-8e9fd7194edd",
        "type": "image",
      },
      {
        "uri": "storage://7a77d42a-f100-4bc5-84e2-45866de8bdc6",
        "type": "image",
      },
      {
        "uri": "storage://4027a279-6c05-43e5-afcf-18c887e25317",
        "type": "documentClassifierProject",
      }
    ],
    "conversions": {
      "classification": {
        "format": "json",
        "resultFileName": "classification.json"
      }
    }
  },
  "progress": 100,
  "outputs": [
    {
      "uri": "storage://b74139b3-3502-4be8-b2b0-1f021a1bc12e",
      "fileName": "classification.json"
    }
  ],
  "errors": []
}
do
{
    Thread.sleep(1000);
    jobInformation = jobsApi.getJob(jobInformation.getId());
}
while (jobInformation.getStatus() == JobInformation.StatusEnum.WAITING || jobInformation.getStatus() == JobInformation.StatusEnum.RUNNING);
do
{
    Thread.Sleep(1000);
    jobInformation = jobApi.GetJob(jobInformation.Id);
}
while (jobInformation.Status == JobInformation.StatusEnum.Waiting || jobInformation.Status == JobInformation.StatusEnum.Running);
while True:
    time.sleep(1)
    jobInformation = jobsapi.get_job(jobInformation.id)
    if 'waiting' not in jobInformation.status and 'running' not in jobInformation.status:
        break

Download result

Upload input files to the OPS server via the File API or copy them to a file share that OPS can access. An API call can upload only a single input file, so you should repeat this step for each input file.

Request

curl -X GET "http://localhost:5002/v3/files/97330cf2-df08-4eea-8c0c-aa4fc0ebf5e7" -H  "accept: application/json"  --output  c:\OPS\Test\Output\classification.json

Response

The result contains the output file. In this example the downloaded files are saved directly to the disk.
Output output = jobInformation.getOutputs().get(0);
String fileId = output.getUri().substring(10);
java.io.File outputFileContent = filesApi.getFile(fileId);
Files.copy(outputFileContent.toPath(), new File(outputFilePath + "\\" + output.getFileName()).toPath(), StandardCopyOption.REPLACE_EXISTING);
if (jobInformation.Status == JobInformation.StatusEnum.Completed)
{
    Output output = jobInformation.Outputs.FirstOrDefault();
    string fileId = output.Uri.Substring(10);
    byte[] outputFileContent = filesApi.GetFile(fileId);
    File.WriteAllBytes(Path.Combine(outputFolder, output.FileName), outputFileContent);
}
output = jobInformation.outputs[0]
fileID = output.uri[10:]
content = fileapi.get_file(file_id=fileID)
outFile = open(f"{ outputPath }\\{ output.file_name }")
outFile.write(content)
outFile.close()

The result file, which can be a JSON or XML file, contains the classification for each page. In our case, in the Classifier project file, the "business letter", "legal", and "contract" classes were defined, among others. The 'confidence' is a number between 0 and 100 and indicates how certain a particular classification is. The 'origin' and 'originindex' can be used to link uploaded files and classification results.

{
  "Classification": {
    "Page": [
      {
        "origin": "storage://2ce437b7-d8e9-4815-90ab-8e9fd7194edd",
        "classifier": "storage://4027a279-6c05-43e5-afcf-18c887e25317",
        "index": "0",
        "originindex": "0",
        "confidencelevel": "33",
        "Class": [
          {
            "name": "businessletter",
            "confidence": "100",
            "confident": "true"
          },
          {
            "name": "legal",
            "confidence": "22",
            "confident": "false"
          },
          {
            "name": "contract",
            "confidence": "17",
            "confident": "false"
          },
          {
            "name": "utilitybill",
            "confidence": "16",
            "confident": "false"
          },
          {
            "name": "invoice",
            "confidence": "15",
            "confident": "false"
          }
        ]
      },
      {
        "origin": "storage://7a77d42a-f100-4bc5-84e2-45866de8bdc6",
        "classifier": "storage://4027a279-6c05-43e5-afcf-18c887e25317",
        "index": "1",
        "originindex": "0",
        "confidencelevel": "33",
        "Class": [
          {
            "name": "invoice",
            "confidence": "93",
            "confident": "true"
          },
          {
            "name": "utilitybill",
            "confidence": "26",
            "confident": "false"
          },
          {
            "name": "legal",
            "confidence": "19",
            "confident": "false"
          },
          {
            "name": "contract",
            "confidence": "16",
            "confident": "false"
          },
          {
            "name": "businessletter",
            "confidence": "0",
            "confident": "false"
          }
        ]
      }
    ]
  }
}

Perform a workflow

The Workflow process is very similar to Document Classification. In this process, you should upload another special file along with the input files, the "Workflow XML" file. The type of this file must be set to "Workflow". The workflow document can be created with the Workflow Designer tool. The Workflow Designer and its documentation is part of the install package, it is located in the Tools\Workflow Designer folder. The conversion parameters come from the workflow xml file, you do not need to set other parameters.

Form Data Extraction

Form Data Extraction supports the automatic processing of filled forms. This job assumes that the user has a 'Form Template Library' which can be created with the 'Form Template Editor' tool. The 'Form Template Editor' tool is not part of the OmniPage Server package, you can download it separately. See the link below for details: https://docshield.kofax.com/OmniPageCaptureSDK/en_US/21.1.0-6ZFWM6PYMZ/help/OmniPageCapture_SDKformtemplateeditor/form_template_editor.html In this special case, input documents that contain completed form elements must be uploaded to a 'Form Template Library' file and set its type to 'formTemplateLibrary'. The rest of the recognition parameters come from the 'formTemplateLibrary' file so setting other parameters is unnecessary. The job result is a CSV document in which the header records contain the names of the zones defined in the Form Template library, and the table cells hold the extracted values of the zones recognized on the page.

Notification

Notification refers to an OPS consumption pattern when the client that creates the conversion job requires notifications from the OPS to the Notification Service about the status changes of the conversion job. This is generally the most efficient way to integrate an application with OPS, but it is limited because OPS requires the Notification Service to be accessible with HTTP(s) requests.

Configure Notification

For security reasons, OPS will notify only the configured Notification Services. See "AllowedNotificationUrls" in the Configuration section of the Administrator's Guide.

Notification Service

The notification service must contain the following two API functions.

If the job completes successfully, the NotifyJobCompletion API function is called.

/NotifyJobCompletion/{jobId}

If the task does not complete successfully, the NotifyJobFailure API function is called.

/NotifyJobFailure/{jobId}
Body parameters

The body parameter is a JobInformation object which is the same as the call result of the getJob API call.

Create a job with notification

The job that uses the notification service differs from other jobs in that it configures its notification service and waits for the notification callback instead of polling.

In the following examples, we assume that the Notification service is hosted on http://ops-notification. In this case, the OPS server will call the http://ops-notification/NotifyJobCompletion/{jobId} or the http://ops-notification/NotifyJobFailure/{jobId} API methods.

Request

curl -X POST "http://localhost:5002/v3/jobs" -H "accept: application/json" -H "content-type: application/json" -d  @c:\OPS\Test\Input\job.json
The content of the uploaded JSON payload object (job.json) found in the example above. This will result a text conversion leaving all parameters at the default value. The specified URI refers to the input file uploaded to the storage in the previous step.
{
  "inputs": [
  {
    "uri": "storage://52267955-f47a-41e4-a93a-e2cf83db023f",
  }],
  "conversions": 
  {
    "text": [
    {
      "format" : "text"
      "resultFileName" : "result.txt"
    }]
  },
  "notifications": [
    {
      "serviceUrl": "http://ops-notification",
    }
  ]  
}

Response

{
  "id":"93ccd159-01f0-4605-af7c-0187cd8f3537",
  "status":"waiting",
  "progress": 0 
}
JobsApi  jobsApi  = new JobsApi();
jobsApi.getApiClient().setBasePath(baseURL);

Input newinput = new Input();
newinput.setUri("storage://" + fileId);
List<Input> inputs = new ArrayList<>();
inputs.add(newinput);

List textList = new ArrayList<>();
Text text = new Text();
text.format(Text.FormatEnum.TEXT);
textList.add(text);
Conversions conversion = new Conversions();
conversion.setText(textList);

Notification notification = new Notification();
notification.setServiceUrl("http://ops-notification");
List notificationList = new ArrayList<>();
notificationList.add(notification);

Job job = new Job();
job.inputs(inputs);
job.conversions(conversion);
job.setNotifications(notificationList);

JobInformation jobInformation = null;
jobInformation = jobsApi.addJob(job);
JobsApi jobsApi = new JobsApi(ServiceBaseUrl, Client);

Job job = new Job(
    new List<Input>() { new Input("storage://" + fileId) },
    new Conversions() { Text = new List() { new Text() },
    Notifications = new List { new Notification("http://ops-notification") }
);

JobInformation jobInformation = jobsApi.AddJob(job);
jobsapi = swagger_client.JobsApi()
jobsapi.api_client.configuration.host = baseURL # e.g. @"http://ops-server:5002/v3"

inputfile = swagger_client.Input(uri=f"storage://{ fileinfo.id }")
text = swagger_client.Text()
conversions = swagger_client.Conversions(text=[ text ])
notification = swagger_client.Notification(service_url="http://ops-notification")

job = swagger_client.Job(inputs=[ inputfile ], conversions=conversions, notifications=[ notification ])
jobInformation = jobsapi.add_job(body=job)

 

Polling

If multiple jobs are running in parallel, job polling is more efficient by requesting job statuses in a single request instead of separate API calls. A request may contain up to 100 jobIds.
Note: Use the 'started' status in the filter in case of 'waiting' jobs.

Request

The -g option enables bracket characters in the request, and the space character must be escaped.

curl -X GET -g "http://localhost:5002/v3/jobs?filter=id%20in%20['83adaa3d-e72c-4af5-b7bc-9bcadc0ad7a8','88f3bd2e-f3ff-4312-bcfa-2a6c7a4571c9','450553da-fa29-4f47-a649-e8e254f78400']%20and%20(%20status%20ne%20'started'%20and%20status%20ne%20'running'%20)%20" -H  "accept: application/json"
JobsApi  jobsApi  = new JobsApi();
jobsApi.getApiClient().setBasePath(baseURL);
List jobInformationList = jobsApi.getAllJobs("id in ['83adaa3d-e72c-4af5-b7bc-9bcadc0ad7a8','88f3bd2e-f3ff-4312-bcfa-2a6c7a4571c9','450553da-fa29-4f47-a649-e8e254f78400'] and ( status ne 'Started' and status ne 'Running' ) ", null, null, null);
string filter = "id in ['83adaa3d-e72c-4af5-b7bc-9bcadc0ad7a8','88f3bd2e-f3ff-4312-bcfa-2a6c7a4571c9','450553da-fa29-4f47-a649-e8e254f78400'] and ( status ne 'Started' and status ne 'Running' ) ";
List jobInformationList = jobsApi.GetAllJobs(filter);
Pjobsapi = swagger_client.JobsApi()
jobsapi.api_client.configuration.host = baseURL # e.g. @"http://ops-server:5002/v3"

jobInformationList = jobsapi.get_all_jobs(filter="id in ['83adaa3d-e72c-4af5-b7bc-9bcadc0ad7a8','88f3bd2e-f3ff-4312-bcfa-2a6c7a4571c9','450553da-fa29-4f47-a649-e8e254f78400'] and ( status ne 'Started' and status ne 'Running' ) ")

 

Appendix

OPS Result Codes


The OPS result codes are signed 32-bit integers. The following table contains the numeric values and the descriptions of the result codes returned by OmniPage Server API in the Error and Warning structures.


Result codeResult message
15728641Job could not be found.
15728644The specified job type is invalid. Use 'GetJobTypes' to get the valid job types.
15728645The specified language code is not valid.
15728646Language codes 'LANG_ALL', 'LANG_ALL_LATIN' and 'LANG_ALL_ASIAN' cannot be combined with other language codes.
15728647Invalid conversion parameter value.
15728660No input files were uploaded.
15728661No output files could be produced by the conversion.
15728662No template file uploaded.
15728663The zone file is not valid.
15728664Invalid barcode type combination.
15728665No template match found.
15728672The given file size splitting parameter is invalid.
15728673The given page count splitting parameter is invalid.
15728674The form template library file is corrupt.
15728675Not all input files have been uploaded
15728676Only one PDF input file can be accepted for this job type.
15728677Not supported image file format or image file type.
15728678No input file configured.
15728679No conversion configured.
15728680Conversion combination not allowed. Workflow, Classification, and Form Data Extraction cannot be combined with other conversions.
15728681File not found with id {ID}.
15728688Uploaded file content is zero.
15728689Invalid 'timeToLive' value.
15728690Input string {ARGUMENT} contains not allowed character.
15728691Input string {ARGUMENT} exceeds the maximum allowed length of {LENGTH}.
15728692Unsupported uri scheme.
15728693Mixed use of 'file' and 'storage' scheme in one job is not supported.
15728694Invalid input scheme.
15728695Invalid URL.
15728696Not allowed URL for notification.
15728697No job configured.
15728704Invalid page range.
15728896A password protected input file caused conversion failure.
15728897A too high resolution input file caused conversion failure.
15728898A corrupted input file caused conversion failure.
15728899The OCR recognition timed out.
15728900CSDK module not present or not licensed.
15728901The recognition process timed out.
15729154General conversion error.
15729155Can not delete the job's {ID} output folder.
15729160General job processing error...
15729168The conversion job could not be completed within the specified job TTL.
15729169There is no valid license for OmniPage Server.
15729408No workflow XML has been uploaded.
15729409More than one workflow XML has been uploaded.
15729410The uploaded input files couldn't be mapped.
15729411Either form template library or zone file can be used in one job.
15732992Invalid command name: {COMMAND}.
15732993Parameter {PARAMETER} is not valid for command {COMMAND}.
15732994Required parameter is missing: {PARAMETER}.
15732995Invalid parameter value. Parameter name: {PARAMETER} value: {VALUE}. Message: {MESSAGE}
15732996Input file not found: {FILE}.
15732997Output file already exists: {FILE}. User the -overwrite switch to enforce the file overwrite.
15732998Cannot write output file {FILE}.
15732999Access is denied. Run a command with elevated privileges!
15733000OmniPage Licensing Agent not registered as windows service. Register first!
15733001OmniPage Licensing Agent already registered as windows service!
15733008OmniPage Licensing Agent hasn't been started!
15733009OmniPage Licensing Agent is already started!
15733010No action defined! Exactly one of the following action should be specified register/unregister/start/stop/restart.
15733011Too many action defined! Exactly one of the following action should be specified register/unregister/start/stop/restart.
15733012Cannot read service status.
15733013Cannot access required resources. Please start the application with elevated privileges.
15733014No action defined! Exactly one of the following action should be specified list/create/update/delete.
15733015Too many action defined! Exactly one of the following action should be specified list/create/update/delete.
15733016The {EMAIL} must be a well-formed email address.
15733017The {ARGUMENT} must be a comma separated email address list. The {EMAIL} doesn't look like a well-formatted email address.
15733024No username defined! The -username switch is required.
15733025No password defined! The -password switch is required.
15733026Improper password. The password must contain at least one digit one uppercase one lowercase letter. The length has to be between 6 and 12.
15733027Inconsistent configuration. If the {ARGUMENT} is set, then the {PARAMETER} field(s) are required.
15733028The operation could not be completed within timeout.
15733029The operation could not be performed. Windows error code: {CODE}.
15733030Invalid scope definition.
15733031Service {SERVICE NAME} isn't run on host {HOST NAME} or cannot report its status.
15733032Service {SERVICE NAME} isn't run on host {HOST NAME} or cannot report its status. The UTC time of the last known status is {TIME}.
15733033Cannot access repository.
15733040Cannot access storage.
15733041The request could not be performed. Check the 'filter' parameter.

                                            



CSDK Result Codes

CSDK result codes are returned if an error occurs during OCR processing.

                                            

Result codeResult message
311315Some zones have incorrect attributes.
312067End of list of available Code Pages.
312073There are more than one matching languages.
312075The specified language is not enabled.
312324Module initialization warning.
312348Crypt module missing.
312352License cannot be validated.
312354Non-fatal error happened during ProcessPages
312355Warnings happened during ProcessPages
312577General RSD warning.
312851Password protected file.
312852The file belonging to this handle does not exist any longer.
312854Image file read problem.
312855Problem in image compression.
312856Illegal password.
312859No font for rendering a glyph.
312860The pdf version is changed because the file size is over 10 GB.
313101No more lines in defined image area.
313105Non-supported resolution.
313106One or more anchor zones were not found.
313108No text zone in the template.
313120The anchor is skipped because template does not match.
313121Anchor text is too short.
313122Zone is not anchored to either reference anchor or to positional anchor.
313123There are too few positional anchors (suggested: 4 - 6 anchors).
313124There are too many positional anchors (suggested: 4 - 6 anchors).
313125The position of the anchors is suboptimal (define anchors near each corner of the page).
313126The anchor is ambigous: there is similar text near the anchor.
313127No zone is anchored to this reference anchor.
313128The drift of the check anchor is too large (suggested: approx. DPI/30 pixel).
313129The drifts of some positional anchors are infinite, while those of others aren't. (Suggestion: either all of them or none of them should be infinite.
313130The checkanchor(s) is/are skipped because there is no positional anchor.
313131None of the templates were matched.
313602No recognized text available: either because the zone is empty or the required recognition module has not been initialized properly.
313603No selected recognition module.
313605No zones found.
313611Color image was downsampled.
313612Invalid zone coordinates.
313613Zone can not have a field name defined.
313614Limited information extacted from input document.
313615The language was inherited from previous page.
314120Barcode type incompatibility detected at kRecRecognize().
314123Force family barcode type if the recognized type is not fit to the enabled type.
314125Character code is not supported by the actual barcode type.
314882Parameter is out of valid range.
315403No more suggestions/items available.
315410Deprecated.
315413Regexp: item does not match.
315651No more items available.
317704The loaded settings file may contain default values.
317706Pending setting has no value in the current Settings Collection.
317953General OmniPage Document (OPD) Warning.
317954Layout Analyser Object not found.
317955Layout Analyser Object not opened.
317956Missing data.
317957Data substitution.
318734Number of recognized characters: {COUNT}.
318735Number of recognized words: {COUNT}.
318736Number of rejected characters: {COUNT}.
318738Rotation: {VALUE}.
318739Large image skew.
318740An incoming barcode cover page was detected and the associated workflow was found.
318742There are no files with a name that matches the specified pattern.
318745Parent window is not defined.
318746Language conflict detected.
318748Image was template zoned: {VALUE}
318751Image was enhanced with {VALUE}.
318752Image was enhanced manually.
318753User performed no manual image enhancement.
318754Page is blank, not saved.
318755Conversion of one or more images was skipped.
318756Output file was not generated.
318762Blank page was detected and skipped.
318763User interaction was suppressed.
318764User canceled the operation.
318765Page could not be classified.
318766Page was classified: {VALUE}
318978User canceled the operation.
319245There are not enough documents in the class.
319246Document does not contain enough info to distinguish classes.
-2147172351Operation not allowed.
-2147172350Only one Engine object can be created.
-2147172349Engine not initialized.
-2147172348ImageFiles collection cannot be created.
-2147172347MemoryBitmaps collection cannot be created.
-2147172346UDManager object cannot be created.
-2147172345BarcodeTypes collection cannot be created.
-2147172344ModuleInfos collection cannot be created.
-2147172343UILanguages collection cannot be created.
-2147172342SpellLanguages collection cannot be created.
-2147172341Documents collection cannot be created.
-2147172338Converters collection cannot be created.
-2147172337SettingManager object cannot be created.
-2147172336Invalid object: cannot be used.
-2147172335ConverterManager not found.
-2147172334Converter not found.
-2147172095File operation internal error.
-2147172094File handling syntax error.
-2147172093File open error.
-2147172092File not found.
-2147172091File read error.
-2147172090File write error.
-2147172089File access denied.
-2147172088File removal error.
-2147172087File creation error.
-2147172086File seek error.
-2147172085Out of memory during file I/O.
-2147172084Disk full.
-2147172083File I/O error.
-2147172082Sharing violation.
-2147172081File already exists
-2147172080Invalid flag specified in a function call
-2147172079Invalid parameter specified in a function call
-2147172078File locking error
-2147172077Directory is not empty
-2147172076Invalid handle specified in a function call
-2147172075File size limit error.
-2147172074Mutex is not available
-2147172073Mutex cannot be created
-2147172072Mutex cannot be released
-2147172071File system initialization error.
-2147172070File Manager's module quit error
-2147172069Function call not implemented yet
-2147172068Invalid pointer specified in a function call
-2147172067The specified flag combination is not supported
-2147171839Not enough memory for this memory operation.
-2147171838Invalid pointer to a memory object.
-2147171583Illegal internal code as a parameter.
-2147171582Set parameter is not acceptable (e.g. size mismatch.)
-2147171580Error while loading the Code Page Definition file (RECOGN.SET).
-2147171579Length of exported code exceeds buffer size.
-2147171578Character conversion is not available for the given character.
-2147171577Conflict: The selected Code Page does not support some characters in the selected languages: there is no exact code in the Code Page for them.
-2147171576Character Set and Code Pages module initialization error.
-2147171574There are no matching languages.
-2147171327Inconsistent Engine configuration.
-2147171326Engine initialization error, or no appropriate license.
-2147171325Engine termination error.
-2147171323Application has aborted the current process.
-2147171322Application has terminated the current recognition process. Recognized text is kept.
-2147171321Module not present or not licensed.
-2147171320OS could not load a module.
-2147171319Missing entry in a module.
-2147171318Invalid module.
-2147171317Module initialization error.
-2147171316The requested function is unavailable, or there is no appropriate license.
-2147171315General error in the Engine.
-2147171314General Protection Fault in the Engine.
-2147171313Unsupported operating system.
-2147171312Syntax error in the specified Engine Settings file.
-2147171311Invalid setting.
-2147171310Hardlock not found or hardlock service has not been started.
-2147171309Invalid license or Engine Licence file not found.
-2147171308Invalid parameters.
-2147171307Engine is busy.
-2147171306Evaluation date of the Engine has expired.
-2147171305Recognition process soft TimeOut.
-2147171304Format error in the actual file.
-2147171303Current session is invalid.
-2147171302Non-implemented feature.
-2147171301Missing .NET 3.0 or later.
-2147171299Recognition process hard TimeOut.
-2147171298Missing .NET 4.0 or later.
-2147171297License Manager error.
-2147171295Unlicensed language setting found or it is not supported by the current CSDK configuration.
-2147171292Page count limit reached or expired
-2147171291Connection actively closed by License Manager Service
-2147171070Internal error.
-2147171069General RSD failure.
-2147171068Feature not available.
-2147171067Access violation.
-2147171066Internal data structures corrupted.
-2147171065No memory available.
-2147171064Failed to lock or free memory.
-2147171063File not found.
-2147171062File creation error.
-2147171061File open error.
-2147171060Read-only file attribute.
-2147171059File read error.
-2147171058File write error.
-2147171057File close error.
-2147171056File structure corrupted.
-2147171055Message text file not found.
-2147171054Message not found.
-2147171053DLL not found.
-2147171052Invalid DLL format.
-2147171051Cannot find function in DLL.
-2147171014Invalid compression setting.
-2147171013Invalid image file type setting.
-2147171011Invalid configuration ID setting.
-2147171010Invalid host ID setting.
-2147171009Invalid SCSI ID setting.
-2147171008Invalid parameter combination.
-2147171007Line too wide to handle.
-2147171006Image does not exist.
-2147171005Image width too small or too large.
-2147171004Image length too small or too large.
-2147171003Image too large for autorotate.
-2147171002User buffer too small.
-2147170815Image file read error.
-2147170814Image file write error.
-2147170813Image file I/O module initialization error
-2147170812Image file open error.
-2147170811Image file close error.
-2147170810Image file create error.
-2147170809Out of memory during image file I/O.
-2147170808Not supported image file format or image file type.
-2147170807Required TIFF basic tag is missing.
-2147170806Error in image compression.
-2147170805Unknown image format.
-2147170804Non-existent page number.
-2147170803File format error.
-2147170802Color PCX file is not supported.
-2147170801Temporary file handling error.
-2147170800Appending not allowed.
-2147170799Writing into a non-empty file without IMF append mode specified.
-2147170798Microsoft Fax viewer missing or not installed.
-2147170795In case of PDF saving the append flag must be true.
-2147170791Wrong password.
-2147170790Not supported encryption.
-2147170787No font for rendering the image.
-2147170559Internal use only
-2147170558Not enough memory during image processing.
-2147170557Invalid rectangle dimensions.
-2147170556Non-supported resolution.
-2147170555Image not found.
-2147170554Cannot process compressed image.
-2147170553Invalid bitmap address.
-2147170552Unsupported BitsPerPixel value.
-2147170551Internal use only
-2147170550Invalid image handle.
-2147170549Buffer overflow during processing the image.
-2147170548Image operation denied.
-2147170546Non-supported image size.
-2147170545Operation not supported on this image.
-2147170544Invalid zone operation (e.g. existing user zone at LZ_FORM).
-2147170541Too few anchors were found or none.
-2147170539Neither positional nor reference anchor has been defined.
-2147170538None of the templates were matched.
-2147170537Not supported anchor content.
-2147170536More than one anchor were found in the drift area.
-2147170535Zone transformation failed (zone is out of the image).
-2147170534The matched template has low confidence.
-2147170533The text in check anchor does not match.
-2147170532Reference anchor was not found.
-2147170531The position of the reference anchor is ambiguous (there is similar text near the anchor).
-2147170530Selector anchor not found.
-2147170529Could not recognize text or barcode in the given area.
-2147170303Invalid page handle (NULL).
-2147170302Invalid page handle.
-2147170301Page is not in PageStore.
-2147170047Engine manager module error.
-2147170044No zone in the zone list.
-2147170042Invalid zone index.
-2147170041Internal use only
-2147170040Internal use only
-2147170039Invalid zone coordinates.
-2147170038Invalid zone shape (not rectangular).
-2147170032Zone is out of the image.
-2147170031MTX engine fatal internal error.
-2147169791MOR recognition module initialization error.
-2147169790DOS error during recognition.
-2147169789Knowledge base file for MOR recognition module not found (RECOGN.BCT).
-2147169788Knowledge base file for MOR recognition module corrupted (RECOGN.BCT).
-2147169787Incorrect knowledge base file version (RECOGN.BCT).
-2147169786Image size too large.
-2147169785File corrupted.
-2147169784Internal error in the MOR recognition module.
-2147169783General Protection Fault in the MOR recognition module.
-2147169535Barcode module error.
-2147169534Not enough memory for barcode recognition.
-2147169533No barcode found in the zone.
-2147169532Non-supported barcode type found.
-2147169531Inconsistent type setting.
-2147169530Mutually exclusive type setting.
-2147169529Deprecated type setting.
-2147169527Code cannot be selected in combination with other symbologies.
-2147169526Not supported barcode type by actual bar recognition module.
-2147169524Box is too small for the barcode.
-2147169279Dot-matrix recognition error.
-2147169023Checkmark recognition error.
-2147168767Knowledge base file for HNR module corrupted.
-2147168511RER module internal error.
-2147168510Knowledge base file for RER module not found (*.REC).
-2147168509Character Set is empty for the RER module.
-2147168508The specified Character Set not fully supported by the RER recognition module.
-2147168507RER specfile not found.
-2147168255Not enough memory for the SPL module.
-2147168254Uninitialized spell object.
-2147168253Spell file open error.
-2147168252Spell file read error.
-2147168251User dictionary write error.
-2147168250Invalid file format (TEV.SZO).
-2147168249Module initialization error.
-2147168248User dictionary close error.
-2147168247Illegal language setting.
-2147168246Internal spell function call with a wrong handle.
-2147168244Internal checking error.
-2147168243Item already exists in the User dictionary.
-2147168242Item does not exist in the User dictionary.
-2147168241Item is incorrect (NULL pointer, empty word).
-2147168240Deprecated.
-2147168239Regexp: other syntax error.
-2147168236Regexp: item does not match.
-2147168234Regexp: exclusive predefined set within set definition.
-2147168233Regexp: a range in a set is not correct, e.g.: [z-a].
-2147168232Regexp: a range with a predefined set, e.g.: [\w-z].
-2147168231Regexp: not handled Unicode character.
-2147168230Regexp: unbalanced '(' or ')'.
-2147168229Regexp: unbalanced '['.
-2147168228Regexp: unbalanced '{'.
-2147168227Regexp: number(s) expected within {} pair.
-2147168226Regexp: invalid upper limit in {n,m} multiplicator.
-2147168225Regexp: illegal use of escape ('\') character.
-2147168224Regexp: illegal hexadecimal spec..
-2147168223Regexp: illegal use of *, +, ? or {}.
-2147168222Regexp: '?', '*', '+' or '{}' follows an empty atom.
-2147168221Regexp: unexpected character found (missing escape?).
-2147167999APIPlus initialization error.
-2147167998Parameter error.
-2147167996Internal error in RecAPIPlus.
-2147167743Module is no longer supported.
-2147167487Matrix matching recognition module initialization error.
-2147167231Unused recognition module.
-2147166975MTX recognition module initialization error.
-2147166719FRX recognition module initialization error.
-2147166463Asian recognition module initialization error.
-2147166207MNG recognition module initialization error.
-2147165951StsMan invalid node handle error.
-2147165950No settings in node.
-2147165949Improper setting type.
-2147165948Operation not allowed for setting or node.
-2147165947Invalid parameter.
-2147165946Settings file content invalid.
-2147165945Node not found.
-2147165943The reference of a symbolic link subtree is invalid or the referenced setting does not exist yet.
-2147165941Storage of settings collections does not exist or too many settings collections are created.
-2147165690General OmniPage Document (OPD) Error.
-2147165689No such Object ID.
-2147165688Wrong Object ID.
-2147165687Wrong object type.
-2147165686General file operation error.
-2147165685File cannot be opened.
-2147165684File cannot be closed.
-2147165683File seeking error
-2147165682File reading error.
-2147165681File writing error.
-2147165680Wrong file format.
-2147165679Invalid internal parameter.
-2147165678Invalid internal range.
-2147165677Invalid function call.
-2147165676Conversion error.
-2147165675Wrong Layout Analyser version.
-2147165674Image operation error.
-2147165673DTK function error.
-2147165672Layout Analyser opened as read only.
-2147165671Invalid output mode.
-2147165670Invalid appset.
-2147165669Prerendering error.
-2147165668Access error.
-2147165667Feature not implemented.
-2147165666Text converter filter error.
-2147165665The function was aborted.
-2147165664No document in Layout Analyser Storage.
-2147165663Layout Analyser command error.
-2147165662Too many Excel sheets.
-2147165661Internal use only
-2147165660Internal use only
-2147165659Error in Vocalizer Engine
-2147165658No voice available in Vocalizer Engine
-2147165657Error in RealSpeak Solo Engine
-2147165656No voice available in RealSpeak Engine
-2147165655Error in using Codec
-2147165439General OmniPage Document (OPD) Fatal error.
-2147165438OmniPage Document (OPD) memory problem.
-2147165437Internal OmniPage Document (OPD) error.
-2147165436Wrong file format or wrong reading or writing methods.
-2147165435Wrong index stream.
-2147165434Error in RecApi.
-2147165433Some attribute was not set.
-2147165432PDF modification restricted.
-2147165431Missing file (usually a DLL).
-2147165183Corrupt document.
-2147165182Document access error.
-2147165181Document is read-only.
-2147165180Document conversion error.
-2147165179Sharing violation.
-2147165178Document does not exist.
-2147165177Document Manager is not initialized.
-2147165176Document operation cancelled.
-2147165175Document version error.
-2147165174Zone operation error.
-2147165173Zone not found.
-2147165172Zone has invalid shape.
-2147165171OCR needed.
-2147164927The starting of the active workflow has failed.
-2147164926The workflow is already processed.
-2147164925The workflow step is not in interactive mode.
-2147164924The workflow doesn't need any input file.
-2147164923The workflow doesn't need any output file.
-2147164922Workflow creation error.
-2147164921The workflow is inactive but the method needs an active one.
-2147164920The workflow is active but the method needs an inactive one.
-2147164919The workflow definition is invalid or doesn't exist.
-2147164918The workflow definition doesn't belong to document.
-2147164917Item not found.
-2147164916Parameter not found.
-2147164915Parameter already exists.
-2147164907An incoming barcode cover page was detected, but its associated workflow was not found.
-2147164905Parent window is not defined.
-2147164904Failed to create window.
-2147164899Enhancement template contains unknown tool.
-2147164898Error loading enhancement template file.
-2147164891Invalid page range.
-2147164890Invalid form template file.
-2147164889Communication error with the PDF printer driver.
-2147164888Cannot save this file type to GoogleDocs.
-2147164887Cannot save this file type to Evernote.
-2147164671Need a bigger buffer.
-2147164669Not authorized to access the server.
-2147164668Couldn't find the path.
-2147164667The specified file already exists on the server.
-2147164666The format of the request data was incorrect.
-2147164665Not permitted to perform action.
-2147164664A required parameter/field was absent.
-2147164663Operation denied due to data size limit.
-2147164662Operation denied due to user storage limit.
-2147164661Username and/or password incorrect.
-2147164660Authentication token expired/revoked.
-2147164659Change denied due to data conflict.
-2147164658Content of submitted note was malformed.
-2147164657Service shard with account data is temporarily down.
-2147164656Operation denied due to data size limit.
-2147164655Operation denied because it is currently unsupported.
-2147164654Operation denied because access to the corresponding object is prohibited in response to a take-down notice.
-2147164653Operation denied because the calling application has reached the hourly API call limit of the user.
-2147164652Access to a business account has been denied because the user must complete additional steps in order to comply with business security requirements.
-2147164651Operation denied because the maximum allowed number of devices of the user has exceeded.
-2147164415Cannot create class: invalid name.
-2147164414Cannot create class: existing name.
-2147164413Cannot create class: existing folder.
-2147164412Invalid handle.
-2147164411Class is empty.
-2147164410Project is not saved.
-2147164409Project is not trained.
-2147164408No such attribute.
-2147164407Can not open this file: unknown extension.
-2147164406No such class.
-2147164405Document does not contain enough words to distinguish classes.
-2147164404There is only one class in the training set.
-2147164401Layout based classifiers can not process text documents.
-2147164400Parameter syntax error.
-2147164399There is no class in the training set.