Querying Elements in KAPTO

A short guide to query elements in KAPTO

In KAPTO, you can query elements belonging to a specific process in a certain state within a specified date range. Here's a quick guide on how to do this:

Parameters

You will need to use the following parameters:

  • status: This is a string used to filter results based on the document status. Possible values include LOADED, EXTRACTED, PROCESSED, INVERIFICATION, FINALIZED, and DISCARDED.

  • ignoreExported: This is a boolean used to filter results by exporting status. If set to true, the query will ignore documents that have been already flagged as exported from the KAPTO platform.

  • notBefore and notAfter: These are date parameters. Use notBefore to filter documents loaded not before a certain date and notAfter to filter documents loaded not after a certain date.

  • communicationId: This string parameter is used to retrieve a specific batch of documents.

  • batchSize: This integer parameter determines the number of elements to return in a batch response. The default value is 1024 elements.

Process

  1. Initiate the Query: Start by initiating a query using the parameters above calling the Start Query API. The status parameter is mandatory while others are optional. If you don't specify the batchSize, the query will return the default 1024 elements.

  2. Receive the First Batch: Once the query is initiated, KAPTO will return the first batch of documents. The response will also include a token ID.

  3. Retrieve Further Elements: You can use the token ID received in the first batch to retrieve further elements in the next batch calling the Query Continuation API

Remember, you can fine-tune your query by using different combinations of parameters. For instance, you can specify a date range using notBefore and notAfter, or filter documents based on their export status using ignoreExported.