> For the complete documentation index, see [llms.txt](https://edissyum.gitbook.io/open-capture/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://edissyum.gitbook.io/open-capture/technique/web-services/monitoring.md).

# Monitoring

## Récupération d'un processus via token généré depuis l'upload

<mark style="color:green;">`POST`</mark> `monitoring/getProcessByToken`

#### Headers

| Name                                            | Type            | Description |
| ----------------------------------------------- | --------------- | ----------- |
| Authorization<mark style="color:red;">\*</mark> | Bearer \<token> |             |

#### Request Body

| Name                                    | Type    | Description                                                                          |
| --------------------------------------- | ------- | ------------------------------------------------------------------------------------ |
| token<mark style="color:red;">\*</mark> | string  | Token généré lors de l'upload d'un fichier                                           |
| retrieveData                            | boolean | Si `true`, retourne les données liés au(x) document(s) (si le processus est terminé) |

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

{% endtab %}

{% tab title="400: Bad Request Token manquant" %}

{% endtab %}
{% endtabs %}

<details>

<summary>Retour du webservice</summary>

```json
{
    "document_data": {
        "1": {
            "address1": "19 RUE VACON",
            "city": "Marseille",
            "country": "France",
            "document_date": "15/12/2016",
            "document_due_date": "14/01/2017",
            "form_id": 3,
            "invoice_number": "INV-001510",
            "lines_count": 0,
            "name": "Calinda",
            "no_rate_amount": "2042.5",
            "postal_code": "13001",
            "quotation_number": "AM161941219-1607",
            "siren": "493811251",
            "siret": "49381125100047",
            "taxes_count": 1,
            "total_ht": "2042.5",
            "total_ttc": "2451",
            "total_vat": "408.50",
            "vat_amount": "408.50",
            "vat_number": "FR04493811251",
            "vat_rate": "20"
        }
    },
    "process": [
        {
            "creation_date": "Thu, 27 Apr 2023 10:28:31 GMT",
            "creation_date_formated": "Jeudi 27 Avril 2023 10:28:31",
            "document_ids": [1],
            "elapsed_time": "00:00:22.35",
            "end_date": "Thu, 27 Apr 2023 10:28:44 GMT",
            "end_date_formated": "Jeudi 27 Avril 2023 10:28:44",
            "error": false,
            "filename": "CALINDA_INV-001510_uctl.pdf",
            "id": 1,
            "module": "verifier",
            "source": "interface",
            "status": "done",
            "steps": {},
            "token": "XXXXXXXX-XXXXXXXXXXXXXx",
            "workflow_id": "default_workflow"
        }
    ]
}
```

</details>
