GET /extraction/{request_id}/results/text

Retrieves the extracted text and location results of an extraction after processing has completed. The result is the extracted text and an array of two integers which represent the start and end positions of text from within the document and represents the text of an extracted field result respectively.

Headers

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

Parameters

  • request_id Path Required

    the extraction to return result for. This is the extraction identifier returned from a successful POST /extraction 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/extraction/<request_id>/results/text
extraction_results, _ = zdai.extraction.get_result(request_id = 'request_id')
Response Codes
  • 200 OK
    The response successfully returned
  • 403 Forbidden
    Invalid or missing authentication token.
  • 404 Not Found
    The extraction does not exist, has been cleaned up, or not finished.
  • 409 Conflict
    When extraction status is not complete and still in progress
  • 500 Internal Server Error
    Something went wrong unrelated to the users request or the extraction failed and there is an error message.

Response Data

  • request_id

    the identifier for the extraction requested

  • file_id

    the document to which extractions has been performed

  • field_id

    the field that corresponds to the extraction

  • extractions

    the text and location spans for the fields extracted from the document. These extractions include the text that has been extracted DocAI, as well as where it was found within the document (start and end pages, and positional information).

  • error

    if an error occurs, you may get a standard error response

Response
{
 "request_id": "<request_id>",
 "file_id": "<file_id>",
 "results": [
   {
     "field_id": "<field_id>",
     "extractions": [
       {
         "text": "Subject to the release provision ...",
         "spans": [
           {
             "start": 48246,
             "end": 49501,
             "pages": {
               "start": 11,
               "end": 11
             },
             "bounds": {
               "top": 2563,
               "left": 227,
               "bottom": 3092,
               "right": 1946
             }
           }
         ]
       }
     ]
   }
 ]
}

Need Help?

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

Contact us at support@zuva.ai