# Versions

## certificate/versions

<mark style="color:blue;">`GET`</mark> `https://public-api.timesafe.io/certificate/{ID}/versions`

Un certificato può essere una successiva versione di un certificato "parent".\
Un "parent" può avere N "figli" che sono le versioni successive del documento, che avranno come "parent" il primo documento della serie; la cardinalità è garantita dall'ordinamento su base temporale "creation\_date".\
Questo servizio restituisce tutti i certificati relativi a un certificato padre.\
\
ESEMPIO:\
se ho un certificato ID:1, che ha 3 versioni successive ( ID: 2,3,4), ognuna di queste versioni succesive avrà come *parent* ID:1\
Se chiamo questo servizio con uno qualsiasi degli ID "figli" (2,3,4) o con ID "parent" (1)\
Otterrò la lista di certificati 1,2,3,4 ( tutte le versioni figlie + parent)

#### Path Parameters

| Name | Type    | Description                                               |
| ---- | ------- | --------------------------------------------------------- |
| id   | integer | ID del certificato di cui si voglioono tutte le versioni. |

#### Headers

| Name  | Type   | Description                             |
| ----- | ------ | --------------------------------------- |
| token | string | token JWT ottenuto da endpoint di login |

{% tabs %}
{% tab title="200 Cake successfully retrieved." %}

```
{
    "status": "OK",
    "data": {
        "items": [
            {
                "id": 93847,
                "parent_certificate": 93843,
                "original_file_name": "Once again Put a new.PDF ",
                "original_file_size": 1223447,
                "hash_file_and_cf": 1,
                "hash": "cea79eade58eab4a11a65b2b79705fe0746e067a",
                "file_hash": "999912345678966f8dd41e00c5a7ac36a32a9950d271",
                "hash_eth": null,
                "block_eth": null,
                "status": 0,
                "creation_date": "2020-05-14 10:47:33",
                "note": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. "
            },
            {
                "id": 93846,
                "parent_certificate": 93843,
                "original_file_name": "Put a new.PDF ",
                "original_file_size": 1223447,
                "hash_file_and_cf": 1,
                "url": "https://www.abcde.fgh/XYZXXXXXXX_v2.ABC",
                "hash": "cea79eade58eab4a11a65b2b79705fe0746e067a",
                "file_hash": "999912345678966f8dd41e00c5a7ac36a32a9950d271",
                "hash_eth": null,
                "block_eth": null,
                "status": 0,
                "creation_date": "2020-05-14 10:31:47",
                "note": ""
            },
            {
                "id": 93845,
                "parent_certificate": 93843,
                "original_file_name": "New Test File Name VERSION 2.PDF ",
                "original_file_size": 12347,
                "hash_file_and_cf": 1,
                "url": "https://www.abcde.fgh/XYZ_v2.ABC",
                "hash": "cea79eade58eab4a11a65b2b79705fe0746e067a",
                "file_hash": "999912345678966f8dd41e00c5a7ac36a32a9950d271",
                "hash_eth": null,
                "block_eth": null,
                "status": 0,
                "creation_date": "2020-05-13 15:33:36",
                "note": ""
            },
            {
                "id": 93844,
                "parent_certificate": 93843,
                "original_file_name": "New Test File Name VERSION 2.PDF ",
                "original_file_size": 12347,
                "hash_file_and_cf": 1,
                "url": "https://www.abcde.fgh/XYZ_v2.ABC",
                "hash": "cea79eade58eab4a11a65b2b79705fe0746e067a",
                "file_hash": "",
                "hash_eth": null,
                "block_eth": null,
                "status": 0,
                "creation_date": "2020-05-13 15:19:53",
                "note": ""
            },
            {
                "id": 93843,
                "parent_certificate": 0,
                "original_file_name": "New Test File Name.PDF ",
                "original_file_size": 12345,
                "hash_file_and_cf": 0,
                "url": "https://www.abcde.fgh/XYZ.ABC",
                "hash": "d40c7d3b55c0ea817f54daace4a50d95503b3746",
                "file_hash": "",
                "hash_eth": null,
                "block_eth": null,
                "status": 0,
                "creation_date": "2020-05-13 15:16:37",
                "note": ""
            }
        ],
        "total_item_count": 5
    }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.public-api.timesafe.io/api/certificate/version.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
