Retrieve the document
Requirements
- Authentication token
- Document ID
How to:
1. Retrieve the document
GET /documents/:documentType/:documentID?token=:authenticationToken
- Retrieves information about selected document.
Example
Request
GET /documents/d_integration/d148b19a-4fa9-442e-adfd-7aa68b8eb766?token=ADFFQBYXP2NVGR6PAP3KOR27FETP6
Response
{
"results": [
{
"_version": 3,
"definition": "d_integration",
"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": { … }
}
}
- Returned object contains information about given document and all users interested in the document.
- Note the Document version: 3
- Also note, as definition type is edoc, there is an automatically created pdf file: asd8k1sd5la2sd7qerialne987y32s4dqwr8sd4qw24e22sdqw8762pmd5
2. Download audit trail
GET /documents/:documentType/:documentID/audit?token=:authenticationToken
- Returns pdf document with document audit trail.
Example
Request
GET /documents/d_integration/d148b19a-4fa9-442e-adfd-7aa68b8eb766/audit?token=ADFFQBYXP2NVGR6PAP3KOR27FETP6
Response
- Document named “My Document (audit trail).pdf“ with audit trail information.
3. Download document file
GET /files/loadFile/hash/:hash?token=:authenticationToken
- Downloads document main file. File type may vary.
Example
Request
GET /files/loadFile/hash/asd8k1sd5la2sd7qerialne987y32s4dqwr8sd4qw24e22sdqw8762pmd5?token=ADFFQBYXP2NVGR6PAP3KOR27FETP6
Response
- Document main file.
- Document file type depends on document creation process. If document type is edoc it will be pdf file.
4. Export to pdf
POST /export?token=:authenticationToken
- Exports document main file to pdf, in case it is not.
Example
Request
POST /export?token=ADFFQBYXP2NVGR6PAP3KOR27FETP6
{
"exporterName": "pdf",
"query": {
"fields": [
{
"field": "_id",
"value": "d148b19a-4fa9-442e-adfd-7aa68b8eb766",
"type": "term"
}
]
}
}
Response
- Main file converted to pdf format.