This method is for testing purposes only. Its parameters, functionality and availability are not guaranteed in future.

The method extracts data from a document using the selected template. The name of the template is specified as a parameter.

[POST] http(s)://cloud.ocrsdk.com/captureData

The image file is transmitted in the request body. See the list of supported input formats.

The result of recognition is returned in XML format.

Parameters

Parameter Is required Default value Description
template Yes  

Specifies the name of the template, which should be used for data extraction. It can be one of the following:

  • mrz
    The service will try to find a machine-readable zone from an image, read it, and extract data from it. MRZ can have 2 lines or 3 lines of machine readable data. The data fields which can be found in the machine-readable zone are described in detail on the processMRZ method page.

Status codes and response format

General status codes and response format of the method are described in HTTP Status Codes and Response Formats.

The following status codes can be returned when this method is called:

Code Description
200 Successful method call.
450 Incorrect parameters have been passed. One of the following errors occurred:
  • Incorrect template name has been specified.
  • Exceeded quota to add images. This error is returned if the number of images you have uploaded exceeds the number of images you can process with the credits available on your account plus some threshold. You can resolve this issue by topping up your account or by removing the tasks which have been submitted but have not been processed.

Output file format

The output XML file has the following format:

<?xml version="1.0" encoding="utf-8"?>
<document type="type1" xmlns="http://ocrsdk.com/schema/captureData-1.0.xsd">
  <field type="type1">
    <value>value1</value>
    <characters>
      <char suspicious="true">1</char>
      <char suspicious="false">2</char>
      <char suspicious="true">3</char>
    </characters>
  </field>
  <field type="type2">
    <value>value2</value>
    <characters>
      <char suspicious="false">4</char>
      <char suspicious="true">5</char>
      <char suspicious="false">6</char>
    </characters>
  </field>
  <field type="type3">
    <value>value3</value>
    <characters>
      <char suspicious="true">7</char>
      <char suspicious="false">8</char>
      <char suspicious="true">9</char>
    </characters>
  </field>
</document>

See the XSD scheme of an output file.