api/v1/docForm
DocForm represents documents in the elDoc system. This REST API Reference describes available methods for the DocForm objects.
API overview
Method | API endpoint |
---|---|
Get document data | GET api/v1/docForm/{id} |
Get document attachment | GET api/v1/docForm/file/{fileId} |
Get documents in the view | GET api/v1/docForm/view/{viewId} |
Process & update document | PUT api/v1/docForm/{id}/docResponse/{respId} |
Move document to the new phase | POST api/v1/docForm/{id}/docResponse |
Create new document | POST api/v1/docForm/form/{formName} |
Get document data
GET api/v1/docForm/{id}
Retrieves document data.
Request:
GET https://eldoc.domain.com/api/v1/docForm/{id}
Param | Type | Description | Sample values (comma separated) |
---|---|---|---|
{id} | Path param | Short id (webId) or full id (24 hex-character) of the DocForm | F12, 59d4582e42a6273b107abcb0 |
{fields} | Query param | Fields to be included in response. This parameter also supports the following computed properties:
| _id, _id_web, filesList |
{embed} | Query param | Additional entities to be included in response as embedded objects. Currently supported:
| docResponse, recoResult |
Response:
Content-Type: application/json
{ "_id": "5e0afc59819e6b69485aeed5", "_id_web": "A4", "_meta": { "_created": "2019-12-31T07:44:25Z", "_lastmodified": "2019-12-31T07:45:05Z", "_rev": 5 }, "author": "usr-bf7ad850-8708-493d-96a5-7c064f9b8528", "state": 100, "step": 0, "iteration": 1, "status": 1, "formsystype": 0, "recoResult": { "recoFormConf": 96.54, "recoForm": { "_id": "5e7c02c805a0ac7d686d7f45", "name": "Invoice_AR_form_v1" } } "...": "..." }
Get document attachment
GET api/v1/docForm/file/{fileId}
Retrieves document attachment file.
Request:
GET https://eldoc.domain.com/api/v1/docForm/file/{fileId}
Param | Type | Description | Sample values (comma separated) |
---|---|---|---|
{fileId} | Path param | Full id (24 hex-character) of the file. Retrieved using query with param: | 5e60c3e47b827239691c6dea |
Response:
Content-Type: application/octet-stream Content-Disposition: attachment; filename*=UTF-8''attachment_file_name.ext Content-Length: 0
// Binary file content
Get documents in the view
GET api/v1/docForm/view/{viewId}
Retrieves documents available for the user in the specified view (documents folder / documents category).
Request:
GET https://eldoc.domain.com/api/v1/docForm/view/{viewId}
Param | Type | Description | Sample values (comma separated) |
---|---|---|---|
{viewId} | Path param | Name of the view. Currently supported views:
| inbox, repository, archive |
{first} | Query param | First document index to be retrieved. First request usually starts from index 0. Default value is 0. | 0, 15, 50 |
{pageSize} | Query param | Number of documents to be retrieved per request. Default value is 10. Maximum value is 99. | 1, 5, 10, 20 |
{fields} | Query param | Fields to be included in response. This parameter also supports the following computed properties:
| _id, _id_web, filesList |
{embed} | Query param | Additional entities to be included in response as embedded objects. Currently supported:
| docResponse, recoResult |
Response:
Content-Type: application/json X-Total-Count: 0
[ { "_id": "59b803ba60e9ab2c6e7b7564", "_id_web": "C0A", "filesList": [ { "id": "59b803ba60e9ab2c6e7b7560", "fileName": "DMS Solutions Overview 1.pptx" } ] }, { "_id": "59b803ba60e9ab2c6e7b7569", "_id_web": "C1A", "filesList": [ { "id": "59b803ba60e9ab2c6e7b7565", "fileName": "DMS Solutions Overview 2.pptx" } ] } ]
Process & update document
PUT api/v1/docForm/{id}/docResponse/{respId}
Processes the document by adding DocResponse to the document with specific status.
Request:
PUT https://eldoc.domain.com/api/v1/docForm/{id}/docResponse/{respId}
Content-Type: application/json
Param | Type | Description | Sample values (comma separated) |
---|---|---|---|
{id} | Path param | Short id (webId) or full id (24 hex-character) of the DocForm | F12, 59d4582e42a6273b107abcb0 |
{respId} | Path param | Full id (24 hex-character) of the DocResponse | _id, _id_web, filesList |
{ "docForm" : { "valuesByTags": { "{TAG}": "{VALUE}" } }, "docResponse" : { "taskstatus" : {taskStatus} } }
Request body keys: | Description | Sample values (comma separated) |
---|---|---|
| { "valuesByTags": { "{TAG}": "{VALUE}" }, "_tags": ["tag1", "tag2"] }
| { "valuesByTags": { "TAG1": "Value 1", "TAG2_DATE": "2020-03-05T08:06:09Z" }, "_tags": ["ReportingQ3"] } |
docResponse | { "taskstatus": {taskStatus} }
Available task statuses: 5 - Response action: Execution Done 4 - Response action: Decline | { "taskstatus": 5 } |
Response:
Response Codes | Description |
---|---|
200 - OK | Document was successfully updated & processed |
422 - UNPORCESSABLE ENTITY | Request was successfully executed but no data was updated |
Move document to the new phase
POST api/v1/docForm/{id}/docResponse
Moves document to the new process phase.
Access rights requirement
Method requires [elAdminDocsRW] role
Request:
POST https://eldoc.domain.com/api/v1/docForm/{id}/docResponse
Content-Type: application/json
Param | Type | Description | Sample values (comma separated) |
---|---|---|---|
{id} | Path param | Short id (webId) or full id (24 hex-character) of the DocForm | F12, 59d4582e42a6273b107abcb0 |
{ "docResponse" : { "taskstatus" : {taskStatus} } }
Request body keys: | Description | Sample values (comma separated) |
---|---|---|
docResponse | { "taskstatus": {taskStatus} }
Available task statuses: 107 - Response action: To Archive | { "taskstatus": 107 } |
Response:
Response Codes | Description |
---|---|
200 - OK | Document was successfully updated & processed |
422 - UNPORCESSABLE ENTITY | Request was successfully executed but no data was updated |
Create new document
POST api/v1/docForm/form/{formName}
Creates new document in the system.
Request:
POST https://eldoc.domain.com/api/v1/docForm/form/{formName}
Content-Type: multipart/form-data
Param | Type | Description | Sample values (comma separated) |
---|---|---|---|
{formName} | Path param | Short id of the document form to be used for creating a new document in the system | frd1, fd1, fd5 |
{fields} | Query param | Fields to be included in response | _id, _id_web, filesList |
{allowDupl} | Query param | Flag defines whether check for file duplication to be done (based on SHA-256 file attachments hash-sum) | true|false (default: true - duplicates are allowed in the system) |
| Query param | IDP: parameter for selecting languages for indexing file content with OCR | eng, eng+chi_tra, eng%2Bchi_tra (default: eng) |
{idpFrpr} | Query param | IDP: flag for forcing elDoc to pre-process file-attachment (not recommended to enable for PDF-text based files, as text content will be replaced by performing OCR) | true|false (default: false) |
Form-data body parts: | Description | Sample values (comma separated) |
---|---|---|
| { "valuesByTags": { "{TAG}": "{VALUE}" }, "author": "{systemId}", "_tags": ["tag1", "tag2"] }
| { "valuesByTags": { "DOC_TOPIC": "Doc topic content", "DATE_CREATED": "2020-03-05T08:06:09Z" }, "author": "usr-bf7ad850-8708-493d-96a5-7c064f9b8528", "_tags": ["Report-2021"] } |
docResponse | { "taskstatus": {taskStatus} }
Available task statuses: 106 - Send document to Execution phase | { "taskstatus": 106 } |
files | Files to be attached to the created document |
Response:
Response Codes | Description |
---|---|
201 - Created | Document was successfully created |
Content-Type: application/json
{ "_id": "5e60c0fed1de2b6966aebcee", "_id_web": "1570", "_meta": { "_created": "2020-03-05T09:06:06Z", "_lastmodified": "2020-03-05T09:06:11Z", "_rev": 5 }, "author": "usr-bf7ad850-8708-493d-96a5-7c064f9b8528", "state": 3, "step": 1, "iteration": 1, "status": 1, "formsystype": 0, "datecreated": "2020-03-05T08:06:09Z", "datedue": "", "...": "..." }
Last modified: April 28, 2023