> For the complete documentation index, see [llms.txt](https://40factory.gitbook.io/wilson/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://40factory.gitbook.io/wilson/3.12/rest-api/knowledge-base/get-document-chunks.md).

# Get document chunks

Get document chunks

## Request <a href="#request" id="request"></a>

### Url

```
GET 
https://wilson.40mat.com/apif/v2/company/<company_id>/knowledge-base/<object_id>/chunks
```

### Headers

<pre><code><strong>AUTH
</strong>Bearer "eyJ0eXAiOiJKV1QiLCJub25jZSI6IndUZXphSTNjdTNVYj..."
</code></pre>

### Parameters

```
No parameters are required for this endpoint.
```

### Body

```
No body required for this endpoint.
```

***

## Response&#x20;

```json
{
    "documents": [
        "Manuale Utente Manutenzione ... Page 1 - 2",
        "description: The image provides user manual instructions for ... \nPage 2\nfilename: [image+e8c90899-1577-4c4a-bd90-c02f2ceaed35@683429f74d950053b85e67b0]"
    ],
    "ids": [
        "f124505c-1c6f-494c-a18f-6ddde9f5553b",
        "e44e4ab1-3835-4a56-b460-a62b0dc58849"
    ],
    "included": [
        "documents",
        "metadatas"
    ],
    "metadatas": [
        {
            "_40F_bot_id_67a48fae85e3601c43a45dd2": "67a48fae85e3601c43a45dd2",
            "_40F_document_id": "683429f74d950053b85e67b0",
            "category": "CompositeElement",
            "document_type": "text",
            "filename": "683429f74d950053b85e67b0.pdf",
            "filetype": "application/pdf",
            "idx": 0,
            "page_number": "1 - 2"
        },
        {
            "_40F_bot_id_67a48fae85e3601c43a45dd2": "67a48fae85e3601c43a45dd2",
            "_40F_document_id": "683429f74d950053b85e67b0",
            "academy_file": true,
            "document_type": "image",
            "image_id": "e8c90899-1577-4c4a-bd90-c02f2ceaed35",
            "page_number": "2",
            "row": 0,
            "source": "tmp/67a48fae85e3601c43a45dd3/683429f74d950053b85e67b0_images.csv"
        }
    ]
}
```

The response is in JSON format contain array of object with following properties:

* `documents` (string array): ...
* `ids` (string array): ...

***

## Code example

{% tabs %}
{% tab title="Python" %}

```python
import requests
import json

url = "https://wilson.40mat.com/apif/v2/company/<company_id>/knowledge-base/<object_id>/chunks"

headers = {
  'Authorization': '••••••'
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```powershell
curl --location 'https://wilson.40mat.com/apif/v2/company/<company_id>/knowledge-base/<object_id>/chunks' \
--header 'Authorization: ••••••' 
```

{% endtab %}
{% endtabs %}
