Skip to main content

The WFD.Abbyy.Api.Disti.Core library allows for interaction with the ABBYY Flexicapture 12 SOAP through a set of standard methods. This DLL is also consumed by the WFD.Abbyy.Api REST API that can be deployed using Azure Dev Ops. 

Any programmatic interactions with ABBYY Flexicapture 12 should run through this library

Usage

All methods to interact with ABBYY cloud take a DatasetContext as part of the parameters. Before running any interactions a new DatasetContext instance should first be initialized and the Connect() method ran.  using (var datasetContext = new DatasetContext()) { var connectionResponse = datasetContext.Connect(Settings.Default.Region, Settings.Default.AbbyyEndpointUrl, Settings.Default.AbbyyUsername, Settings.Default.AbbyyPassword, Settings.Default.ProjectName, Settings.Default.DocDefName);

if (connectionResponse.Status == ResponseStatus.OK){
//Your code here
}

}

Datasets​

Once a DatasetContext has been initialized a new DatasetWrapper object should be created. The DatasetWrapper object then has a set of methods to allow for all CRUD operations with the ABBYY cloud datasets. 

var wrapper = new DatasetWrapper();

var results = wrapper.Get(datasetContext, "BusinessUnits", new Dictionary(), 1000);

foreach (var result in results.Data) { foreach (var field in result.Fields) { System.Console.WriteLine($"{field.FieldName} - {field.FieldValue}"); } }

Create/Update​

When creating or updating records fields are passed in as a Dictionary where the key is the field name and the value is the field value. var records = new List>();

var record1 = new Dictionary(); record1.Add("Id", "1"); record1.Add("Name", "My Test Record");

records.Add(record1);

wrapper.Add(datasetContext, "BusinessUnits", records);

Recognition Tasks​

You can also send recognition tasks to ABBYY F,exicapture using a TaskWrapper object. Once a task has been sent the status of the task can then be returned using the Get method of a TaskWrapper. 

The returned 'taskId' is simple the id of the batch that that has been created to contain the upload documents.

var taskWrapper = new TaskWrapper();

var files = new Dictionary(); files.Add(@"C:\myfile.pdf", File.ReadAllBytes("C:\myfile.pdf")); files.Add(@"C:\mysecondfile.pdf", File.ReadAllBytes("C:\mysecondfile.pdf"));

var uploadResponse = taskWrapper.UploadDocumentsAndStartTask(datasetContext, files);

System.Console.WriteLine(uploadResponse.Data.TaskId);

var taskStatus = taskWrapper.Get(datasetContext, uploadResponse.Data.TaskId);

System.Console.WriteLine(taskStatus.Data.Status);