‚Äč

Cloud OCR SDK Documentation

HTTP Status Codes and Response Formats

The server can return the following HTTP status codes:

  • 200 – successful method call
  • 4xx – incorrect parameters of the method
  • 5xx – an error on the server side

The body of the response contains XML. The standard response formats are described below.

Response format for the status code 200

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <response xmlns="@link" xmlns:xsi="@link" xsi:schemaLocation="@link" version="1.0"> <task id=”22345200-abe8-4f60-90c8-0d43c5f6c0f6” registrationTime=”2001-01-01T13:18:22Z” statusChangeTime=”2001-01-01T13:18:22Z” status=”Completed” error=”{An error message.}” filesCount=”10” credits=”10” estimatedProcessingTime=”3600” resultUrl=”http://<domain>/<blob ID>” resultUrl2=”http://<domain>/<blob ID>” resultUrl3=”http://<domain>/<blob ID>”
description=”My first OCR task”/>

<task …/> </response>

resultUrl – this attribute is only available for completed tasks. It provides the URL of the result of processing. The hyperlink has limited lifetime. If you want to download the result after that time has passed, use the getTaskStatus or listTasks method to obtain the new hyperlink.

resultUrl2 – this attribute is only available for completed tasks which were processed with multiple export formats. It provides the URL of the result saved in the second specified format. Otherwise, it has the same properties as the resultUrl attribute.

resultUrl3 – this attribute is only available for completed tasks which were processed with three export formats. It provides the URL of the result saved in the third specified format. Otherwise, it has the same properties as the resultUrl attribute.

filesCount – specifies the number of files in the task.

credits – specifies the cost of processing: it contains the estimated cost before task processing, and the actual cost, after the task has been completed. The measurement unit is the price of processing of one field.

estimatedProcessingTime – estimated time until the task is completed (in seconds). This attribute is available for the tasks with Queued or InProgress status.

error – description of the error occurred during processing. This attribute is available for the tasks with ProcessingFailed status only.

Response format for the status codes 4xx and 5xx

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<error xmlns="@link" xmlns:xsi="@link" xsi:schemaLocation="@link" version="1.0">
	<message language=”English”>
		{An error message.}
	</message>
</error>