GET /ocr/{request_id}/layout

Retrieves the layout of a document as a protobuff (binary format) from OCR results after processing has completed. The layout can be used with the Fields endpoints for training, as well as to build a document viewer.

Headers

Authorization (required) - Requires the standard authentication header used in the system.

Parameters

There are no parameters needed for this endpoint.

  • request_id Path Required

    the OCR request to return the document text. This is the OCR identifier returned from a successful POST /ocr response (request_id)

Code Sample
curl -X GET -H "Accept: application/json"  
-H "Authorization: Bearer <token>" 
-H "Content-Type: application/json"  
-d "{}" 
https://<base_url>/api/v2/ocr/<request_id>/layout
layout = zdai.ocr.get_layout(request_id=’request_id’)
Response Codes
  • 200 OK
    The response successfully returned
  • 403 Forbidden
    Invalid or missing authentication token.
  • 404 Not Found
    The OCR request does not exist, has been cleaned up, or not finished.
  • 500 Internal Server Error
    Something went wrong unrelated to the users request or the OCR failed and there is an error message.

Response Data

  • protobuff

    (binary format)


Need Help?

Couldn’t find the information you were looking for or need more assistance?

Contact us at support@zuva.ai