Method
getDocumentSnippet POST
Copy POST

Get a snippet from documents in the document retriever.

Arguments:

REQUIRED KEY TYPE DESCRIPTION
Yes documentRetrieverId str A unique string identifier associated with the document retriever.
Yes documentId str The ID of the document to retrieve the snippet from.
No startWordIndex int If provided, will start the snippet at the index (of words in the document) specified.
No endWordIndex int If provided, will end the snippet at the index of (of words in the document) specified.
Note: The arguments for the API methods follow camelCase but for Python SDK underscore_case is followed.

Response:

KEY TYPE DESCRIPTION
success Boolean true if the call succeeded, false if there was an error
result DocumentRetrieverLookupResult
KEY TYPE Description
document str The document that was looked up.
score float Score of the document with respect to the query.
properties dict Properties of the retrieved documents.
pages list Pages of the retrieved text from the original document.
boundingBoxes list Bounding boxes of the retrieved text from the original document.
documentSource str Document source name.
imageIds list List of Image IDs for all the pages.

Exceptions:

TYPE WHEN
DataNotFoundError

documentRetrieverId is not found.

DataNotFoundError

documentId is not found.

Language: