# Document Methods

### Sign hash

{% openapi src="<https://3506709286-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLcKVZXOrBb4jDUyxEWMc%2Fuploads%2Fhjpyez99IbtowAQFhxrR%2Fswagger.json?alt=media&token=a12a6e62-f9fe-4329-b2ef-f659f7de3c93>" path="/api/Document/Sign/{processId}" method="post" %}
[swagger.json](https://3506709286-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLcKVZXOrBb4jDUyxEWMc%2Fuploads%2Fhjpyez99IbtowAQFhxrR%2Fswagger.json?alt=media\&token=a12a6e62-f9fe-4329-b2ef-f659f7de3c93)
{% endopenapi %}

### &#x20;Sign hash (JSON request)

{% openapi src="<https://3506709286-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLcKVZXOrBb4jDUyxEWMc%2Fuploads%2Fhjpyez99IbtowAQFhxrR%2Fswagger.json?alt=media&token=a12a6e62-f9fe-4329-b2ef-f659f7de3c93>" path="/api/Document/Sign/{processId}/json" method="post" %}
[swagger.json](https://3506709286-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLcKVZXOrBb4jDUyxEWMc%2Fuploads%2Fhjpyez99IbtowAQFhxrR%2Fswagger.json?alt=media\&token=a12a6e62-f9fe-4329-b2ef-f659f7de3c93)
{% endopenapi %}

### Validate document (PDF report)

## Validate document (PDF report)

<mark style="color:green;">`POST`</mark> `/api/Document/Validate/Pdf/{processId}`

This method verifies the uploaded file in accordance with EIDAS guidelines. Verifies certification path and the signature. Generates a PDF report. The contents of file should be sent as a binary octet stream (<https://www.iana.org/assignments/media-types/application/octet-stream>)

#### Path Parameters

| Name                                        | Type    | Description |
| ------------------------------------------- | ------- | ----------- |
| processId<mark style="color:red;">\*</mark> | Integer |             |

#### Request Body

| Name                   | Type                   | Description |
| ---------------------- | ---------------------- | ----------- |
| \<binary-octet-stream> | \<binary-octet-stream> |             |

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

\<Base64 report pdf data>
{% endtab %}

{% tab title="404: Not Found Process not found" %}

{% endtab %}
{% endtabs %}

### Validate document (XML report)

## Validate document (XML report)

<mark style="color:green;">`POST`</mark> `/api/Document/Validate/Pdf/{processId}`

This method verifies the uploaded file in accordance with EIDAS guidelines. Verifies certification path and the signature. Generates a XML report. The contents of file should be sent as a binary octet stream (<https://www.iana.org/assignments/media-types/application/octet-stream>)

#### Path Parameters

| Name                                        | Type    | Description |
| ------------------------------------------- | ------- | ----------- |
| processId<mark style="color:red;">\*</mark> | Integer |             |

#### Request Body

| Name                   | Type                   | Description |
| ---------------------- | ---------------------- | ----------- |
| \<binary-octet-stream> | \<binary-octet-stream> |             |

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

\<XMLreport>
{% endtab %}

{% tab title="404: Not Found Process not found" %}

{% endtab %}
{% endtabs %}
