Table of contents
Validate the documents
Once you have prepared the document, you can check that it was prepared correctly!
To do so, simply make a request HTTP POST with Content-Type multipart/form-data to the endpoint /api/v1/sign/validate-document entering the following in the body of the request:
- the PDF document to be validated
- a JSON document containing the previously identified signature fields, if present
Example
1POST /api/v1/sign/validate-document
2Content-Type: multipart/form-data; boundary=----exampleBoundary
3
4-----exampleBoundary
5Content-Disposition: form-data; name="document"; filename="document.pdf";
6Content-Type: application/pdf
7
8DOCUMENT-DATA-HERE
9
10-----exampleBoundary
11Content-Disposition: form-data; name="fields"; filename="fields.json";
12Content-Type: application/json
13
14[
15 {
16 "clause": {
17 "title": "clause 1",
18 "type": "REQUIRED"
19 },
20 "attrs":{
21 "coordinates":{
22 "x":85,
23 "y":676
24 },
25 "size":{
26 "w":177,
27 "h":77
28 },
29 "page":3
30 }
31 }
32]
33-----exampleBoundary--
34Response
1{
2 "is_valid": "false",
3 "violations": [
4 "(clause 1) incompatible coordinates: unable to find page 3 in the uploaded document"
5 ]
6}
7Ongoing support
For problems or questions after integration, write to us at the address enti-firmaconio@assistenza.pagopa.it