API Reference

Get the chunks to the provided webhook

If you set up a webhook in the chunking request, Preprocess will call the URL provided in the webhook parameter when the ingestion of your document has finished. The webhook request will be a POST in JSON format

The POST request to the provided webhook in case of success.

{
  "status": "OK",
  "success": true,
  "message": "The file has been chunked successfully.",
  "info": {
    "file":{
      "name": string 
    }
  },
  "data": {
    "process":{
      "id": string
    },
    "detected_language": string ,
    "chunks": [
      "first chunk …",
      "second chunk …",
      "…",
      "…"
    ]
  }
}

The POST request to the provided webhook in case of error.

{
  "status": "ERROR",
  "success": false,
  "error": …object_with_additional_data…,
  "message": "An error happened during the chunking of your document, please try again later"
}

About the received data:

success: false if the process is not yet finished, true otherwise.
data > process > id: the process ID you received in the response of the ingestion request.
data > detected_language: the language you provided in the ingestion request, or the one automatically detected.
data > chunks: the list of chunks the document has been divided into.
info > file > name: the name of the file you uploaded.