Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejson
{
  "identifier": "Custom PDF Page _Ingestor",
  "url": "https://customUrl.com/pdfPageIngestor",
  "apiKey": "myAPIKey"
}

...

To use this custom PDF page processing the ingestion config of the content needs to be adjusted. This is a similar workflow as using the Microsoft Document Intelligence. This ingestion config can be set either on scope level or on content directly. This is an example curl for that:

...

Code Block
curl --location --request POST 'http://https://gateway.<baseUrl>/ingestion/v1/folder/<scopeId>/properties' \
--header 'Authorization: Bearer <yourToken>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "properties": {
        "ingestionConfig": {
            "pdfReadMode": "CUSTOM_SINGLE_PAGE_API",
            "customApiIdentifiercustomApiOptions": [{
                "customisationType": "Custom PDF Page "CUSTOM_SINGLE_PAGE_API",
                "apiIdentifier": "Custom_Ingestor",
                "customApiPayloadapiPayload": {<Optional - anyString>}"{'stringified': 'JSON object or just a string'}"
            }]
        }
    },
    "applyToSubScopes": true
}'
Note

Attention! Make sure you do not override some previous customised ingestionConfig. In case of doubt fetch/inspect first the current properties of the scope.

API requirements

Unique will send a POST request for each PDF page to the specified API configuration (URL and ApiKey). The body contains the following structure:

...

To configure this custom chunking the ingestion config of the content needs to be adjusted. This is a similar workflow as using the Microsoft Document Intelligence. This ingestion config can be set either on scope level or on content directly. This is an example curl for that:

...

Code Block
curl --location --request POST 'http://https://gateway.<baseUrl>/ingestion/v1/folder/<scopeId>/properties' \
--header 'Authorization: Bearer <yourToken>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "properties": {
        "ingestionConfig": {
            "chunkStrategy": "CUSTOM_CHUNKING_API",
            "customApiIdentifier"customApiOptions": [{
                "customsationType": "Custom PDF Page "CUSTOM_CHUNKING_API",
                "apiIdentifier": "Custom_Ingestor",
                "customApiPayloadapiPayload": {<Optional - anyString>}"{'stringified': 'JSON object or just a string'}"
            }]
        }
    },
    "applyToSubScopes": true
}'
Note

Attention! Make sure you do not override some previous customised ingestionConfig. In case of doubt fetch/inspect first the current properties of the scope.

API requirements

Unique will send a POST request once the whole text of the document is ready to be chunked to the API configuration (URL and ApiKey). The body contains the following structure:

...