Other operations



Introduction

In addition to the operations for creating evidence, other operations can also be performed, such as: embedding a company seal in a PDF, etc.


Operations

Embed company seal to pdf

HTTP Request

POST /api/v1/private/sign-file

With the following information provided as JSON:

{
                "fileId": "UUID",
                "filename": "string",
                "custodyType": "string",
                "hash": "SHA256 hash",
                "signName": "string"

      }

Request body parameters

Parameter Mandatory Datatype Description
fileId yes UUID The UUID of the document to seal.
filename no String The filename with extension of the document to seal. Defaults to {fileId}.pdf when not provided
custodyType yes String If the status is marked as "INTERNAL", the resulting document will remain permanently sealed. If marked as "EXTERNAL", the document will remain sealed for a duration of 24 hours only.
hash no String The sha256 hash of the file to be sealed.
signName yes String The name of the provider responsible for sealing the document. Must be one of the provider names configured for your tenant (e.g. "EADTrust"). If the value is not one of the configured provider names, you will get a 400 Bad Request response.

As response, you will get the following JSON object with a pre-signed upload URL to facilitate the document upload process:

{
        "fileId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "link": {
          "url": "http://example.io",
          "expiration": "2023-10-24T21:36:26.092Z"
        }
      }

To upload the document, follow these steps:

1.- Include the file hash encoded in base64.

2.- Specify the file name along with its extension.

As shown in the example, the x-amz-checksum-sha256 field should contain the base64-encoded file hash, followed by the file name with its extension.


  curl -v -H "x-amz-checksum-sha256: 3EMnNvppVhJqpPMcZPTtglG+3aNS4cWMrLzNEsToNUY=" -T "example.png" "https://<bucket>.s3.eu-west-1.amazonaws.com/<tenant>/evidences/29ef49f1-9259-41d8-b6d3-876f53e9f681/resource/example.png?X-Amz-Security-Token=<token>..."

Get sealed PDF

HTTP Request

GET /api/v1/private/sign-file/{fileId}/download-url

In this request, there is one primary resource fileId.

As response, you will get the following JSON object with the temporary download URL:

{
        "url": "http://example.io",
        "expiration": "2023-10-24T21:36:26.092Z"
      }

If the sign file does not exist, you will get a 404 Not found response.