Retrieve the document
Requirements
Authentication token
Document ID
How to:
1. Retrieve the document
GET /documents/:documentID?token=:authenticationToken
This API call will retrieve information about the selected document.
In the request, you will need to specify the following information:
documentID: The ID of the document you want to retrieve.
authenticationToken: Your authentication token.
Example
Request
GET /documents/d148b19a-4fa9-442e-adfd-7aa68b8eb766?token=ADFFQBYXP2NVGR6PAP3KOR27FETP6
The response of the API call will be a JSON object containing information about the selected document, including the document's version, definition, title, fields, type, date, sign status, values, workflow history, attachments, tags, and folder information.
{
"results": [
{
"_version": 3,
"definition": "d_default",
"documentId": "d148b19a-4fa9-442e-adfd-7aa68b8eb766",
"documentTitle": "My Document",
"myField": "Custom value",
"type": "edoc",
"date": "2020-02-11T15:50:14.260Z",
"isSigned": false,
"isSignable": true,
"values": {
"pdfFile": {
"content": "asd8k1sd5la2sd7qerialne987y32s4dqwr8sd4qw24e22sdqw8762pmd5"
}
},
"workflow": {
"history": [ … ], //History of the document
…
},
"attachments": [ … ],
"tags": { … },
"folder": { … }
}
],
"users": {
"judy.corbett": { … }
}
}
Please note that the returned object also contains information about all users included in the document.
2. Download audit trail
GET /documents/:documentID/audit?token=:authenticationToken
This API call will return a pdf document with the audit trail information of the specified document.
In the request, you will need to specify the following information:
documentID: The ID of the document you want to retrieve the audit trail for.
authenticationToken: Your authentication token.
Example
Request
GET /documents/d148b19a-4fa9-442e-adfd-7aa68b8eb766/audit?token=ADFFQBYXP2NVGR6PAP3KOR27FETP6
The response of the API call will be a pdf document named "My Document (audit trail)”.
3. Download document file
GET /files/loadFile/hash/:hash?token=:authenticationToken
This API call will download the main file of the specified document. The file type may vary depending on the document creation process.
In the request, you will need to specify the following information:
hash: The file hash of the document you want to download - it can be found by calling GET /documents as specified in point 1. The hash can be found in
“pdfFile”
object, value“content”
:
"pdfFile": {
"_content_type": "application/pdf",
"additionalInfo": "{\"version\":1.5,\"xmp\":{\"Producer\":\"Skia/PDF m79\"}}",
"content": "dvab6ojbu0d4soh71ewo8kpxxeqlsa8odzbns5jwhwvd4c3nt44oudnnyyskek1d", // document hash you are looking for
"fileExtension": "pdf",
"fileType": "pdf",
"hasPassword": false,
"merge": [],
"name": "Company Memorandum Ver 1",
"pages": 2,
"size": 73404,
"unsealedContent": null
},
authenticationToken: Your authentication token.
Example
Request
GET /files/loadFile/hash/asd8k1sd5la2sd7qerialne987y32s4dqwr8sd4qw24e22sdqw8762pmd5?token=ADFFQBYXP2NVGR6PAP3KOR27FETP6
The response of the API call will be the main file of the specified document.