Preservation process

The preservation process of a document is divided into 2 main steps:

  1. Sending the document to be preserved
  2. Start the preservation process of the document by sending the metadata

For the sake of simplicity, we will use the following path prefix, which indicates "Italy" as the country and "registro-volontari" as the document type we want to preserve.

Copy
Copied
/preserved-documents/it/registro-volontari

1. Sending the document to be preserved

  1. Upload the document you want to preserve by sending an POST request to /preserved-documents/it/registro-volontari . This request must have a multipart/form-data body.
  2. Make sure your request Accept header is set to application/json
  3. As a response, you will receive a json containing the unique identifier of the document you have sent.
Copy
Copied
{
  "uuid": "<uuid>"
}

We will use your document filename and the content hash to check if the document has already been sent to us. If so, you will receive a 409 Conflict response.

2. Start the preservation process

Send a POST request to /preserved-documents/it/registro-volontari/{uuid}/send where {uuid} is the unique identifier that you received in the first step.

Content of the request must have a Content-Type header set to application/json and a body containing the metadata you want to preserve. Each document type has its own metadata structure. For example, the metadata structure for the registro-volontari document type is as follows:

Copy
Copied
{
  "data_registrazione_documento": "2023-05-02",
  "numero_registrazione_documento": "2094984098398349",
  "codice_identificativo_registro": "209492alkydef_22",
  "soggetto_che_effettua_la_registrazione": {
    "denominazione_organizzazione": "IT tech",
    "codice_fiscale_partita_iva": "86334519757"
  },
  "volontari": [
    {
      "cognome": "Rossi",
      "nome": "Mario",
      "codice_fiscale": "RSSMRA80A01H501T",
      "indirizzi_digitali_di_riferimento": [
        "mariorossi@example.com"
      ]
    }
  ],
  "riservato": false,
  "verifica": {
    "firmato_digitalmente": false,
    "sigillato_elettronicamente": false,
    "marcatura_temporale": false,
    "conformita_copie_immagine_su_supporto_informatico": false
  },
  "versione_del_documento": "1.0"
}

In case of success, the document will be sent to the pipeline for preservation and you will receive a response with the following structure:

Copy
Copied
{
  "uuid": "string",
  "created_at": "string",
  "updated_at": "string",
  "preserved_object_id": "string",
  "status": "string",
  "status_history": {
    "string": "string"
  },
  "error_message": "string"
}

The status field indicates the status of the document preservation process. You can query the status of the document by sending a GET request to /preserved-documents/it/registro-volontari/{uuid}.

The status_history field contains the history of the status of the document in a form of key-value pairs. The key is the status and the value is the timestamp when the status was set.

Available statuses are:

  • to_be_stored : the document has been created
  • sent : the document has been sent to the preservation system
  • sent_metadata : the metadata of the document has been sent to the preservation system
  • stored : the document has been successfully stored in the preservation system

The error_message field contains the error message in case of failure.

In case of repeated requests on the same preserved document resource, you will receive a 409 Conflict response.