# Documents

## /`getDocuments`

## Get all the stored documents

<mark style="color:blue;">`GET`</mark> `/getDocuments`

Gets all the stored documents in the database in a JSON array

#### Headers

| Name                                             | Type   | Description |
| ------------------------------------------------ | ------ | ----------- |
| x-access-token<mark style="color:red;">\*</mark> | String | User token  |

{% tabs %}
{% tab title="200: OK Documents list in a JSON array" %}

```json
{
    [
        [document_cote, document_name, document_date],
        [...]
    ]
}
```

{% endtab %}

{% tab title="401: Unauthorized Token is missing or invalid" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## `/getDocument/<document_cote>`

## Get all the info about a document

<mark style="color:blue;">`GET`</mark> `/getDocument/<document_cote>`

Gets all the information about a specific document identified by it's cote. It returns in a JSON object the image\_id, stats and transcriptions of this document.&#x20;

#### Query Parameters

| Name                                                | Type   | Description          |
| --------------------------------------------------- | ------ | -------------------- |
| \<document\_cote><mark style="color:red;">\*</mark> | String | Cote of the document |

#### Headers

| Name                                             | Type   | Description |
| ------------------------------------------------ | ------ | ----------- |
| x-access-token<mark style="color:red;">\*</mark> | String | User token  |

{% tabs %}
{% tab title="200: OK JSON Object" %}

```json
{
    'images' : [
                    [],
               ]
     'stats': 
     'transcriptions': 
}
```

{% endtab %}

{% tab title="401: Unauthorized Token is missing or invalid" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}
