Downloading document information from the process
Path to servlet: api/documents/query
Method: GET
Parameters:
- processId - Id of the process for which we want to download documents
- activityId - (optional) Id of the task for which we want to download documents. If not specified, all documents from the process will be downloaded.
Answer:
- The answer contains a list of documents.
Downloading extended document information from the process
Path to servlet: api/documents/view/query
Method: GET
Parameters:
- processId - Id of the process for which we want to download documents
- activityId - (optional) Id of the task for which we want to download documents. If not specified, all documents from the process will be downloaded.
Answer:
- The answer contains a list of documents.
Download available document classes
Path to servlet: api/documents/classes
Method: GET
Parameters:
- rightType - type of rights to add documents to the system, one of:
- ALL - to process or archive,
- PROCESS - to process
- ARCHIVE - to archive
- The answer contains a list of document classes to which the logged-in user has permissions.
Downloading indexes for a class of documents
Path to servlet: api/documents/indexes/{documentClassId}
Metoda: GET
Parameters:
- documentClassId - Id of document class (parameter passed in servlet path)
Answer:
- The answer contains a list of indexes.
Add document
Path to servlet: api/documents/upload
Method: POST
enctype: multipart/form-data
Parameters
- indexesAsJson (from version 4.0.39) - (optional, true/false) indexes are transferred in JSON format (form indexesJson field)
Query Content:
HTML form containing the definition of the document. The definition should contain the following field:
- file - field type file
- activityId - task Id
- processId - process Id
- documentClassId - document class Id
- description - description
- newVersion - (true/false) Save as a new version
indexes - (optional) Index values of the document to be added. The values should be transferred according to the form-data request type, i.e. in the form of
An example of a valid value for the indexes fieldindexes[1]: "Index value with id 1" indexes[3]: "Index value with id3"
indexesJson (from version 4.0.39) - (optional, to be specified in combination with the query parameter indexesAsJson=true) Index values of the added document. The values should be passed in JSON format:
An example of a valid value for the indexesJson field{ "1": "Index value with id 1", "3": "Index value with id 3", "11": 234.62, /* Floating point index value with id 11*/ "15": false /*Boolean index value with id 15*/ }
The parameters activityId and processId are optional:
If we specify both parameters, the document will be added to the archive and connected to the indicated task.
If we specify only processId, the document will be added to the archive and connected to the indicated process.
If we specify neither parameter or specify only activityId, the document will be added to the archive only.
Answer:
- The answer contains the definition of the saved file
Internet Explorer support
In Internet Explorer, in order to perform a file upload, the server must respond with a Content-Type: text/html header. You should then call the request with an additional parameter:
responseAsHtml - true forces the Content-Type header to be set to text/html
Download document
Path to servlet: api/documents/download/{fileId}
Method: GET
Parameters:
- fileId - Id of the file you want to download (parameter passed in the servlet path)
Answer:
- Data stream with file
- HTTP status: OK or UNAUTHORIZED
Get document
Path to servlet: api/documents/get/{filename}
Method: GET
Parameters:
- filename - file name with extension (passed in servlet path)
- fileId - file Id
- processId - (optional) Id of the process for which we want to download documents
- activityId - (optional) Id of the task for which we want to download documents
Note, the system parameter 'AuthorizeUserForFile' determines whether user authorization is required for this servlet.
Answer: downloaded document file.
Download information about connected documents to a job
Path to servlet: api/documents/activity
Method: GET
Parameters:
- processId - Id of the process for which we want to download documents
- activityId - Id of the task for which we want to download documents
Answer: Information about the documents, i.e. besides the files, also additional information about the document, e.g. by whom it was connected to the archive and by whom it was connected to the process, etc.
Disconnecting a document from a process
Path to servlet: api/documents/{fileId}/{processId}
Method: DELETE
Parameters:
- fileId - Id of the file we want to download ( parameter passed in the servlet path)
- processId - Id of the process from which we are detaching the file
Answer:
- no answer
Delete document (from version 3.1.31)
The method removes the file from the system. If the file to be deleted is version ex: 2, and the whole document is version 5, then all versions upwards will be deleted, i.e. only version 1 file will be left, unless the parameter {@code deleteAllVersions=true}, then all versions will be deleted.
The user must have permission to delete this file.
Path to servlet: api/documents/{fileId}
Method: DELETE
Parameters:
- fileId - Id of the file you want to delete (parameter passed in the servlet path)
- deleteAllVersions (optional - default false) - Specifies whether all previous versions of this document are also to be deleted.
Answer:
- no answer
Change of document index values (from version 3.1.31)
The method changes the transferred index values in the specified document. The user must have permission to modify the document.
Path to servlet: api/documents/{fileId}/indexes
Method: PUT
Request Content-Type: application/json
Parameters:
fileId - Id of the file whose indexes we want to change (parameter passed in the servlet path)
- indexes - JSON object containing the indexes to be changed:
{ "2":"New index value with id 2", "7":New index value with id7", "11":234.62 /* New floating point index value with id 11 */ }
Answer:
- no answer
Search for documents based on filters (from version 3.1.31)
The method searches for documents based on the specified filters. User rights are taken into account. You can search by document class (the id of the document class must be specified in the documentClassId parameter) or document set (the id of the document set must be specified in the documentSetId parameter). You cannot search by document class and document set at the same time (only one parameter can be completed). Currently, the indexes of the document class/document set are still an additional filter. If you do not specify indexes, all documents from the specified document class/document set will be searched.
Path to servlet: api/documents/query
Method: POST
Request Content-Type: application/json
Parameters:
JSON object contains filters
Example of index transfer{ "documentClassId": 1, //document class id //lub "documentSetId": 3, //sets of documents id "indexes": { //document indexes "2":"Index value with id 2", "7":"Index value with id 7", "11":234.62 /* Floting point index value with id 11 */ "148": { //version 4.1.16: range search by index "from": 2023-12-01 17:10:00 "to" : 2023-12-05 } } "fromDate": "2023-09-07", // version 4.1.6: lower search bound by document addition "endDate": "2023-09-07 12:08" // version 4.1.6: upper search bound by document addition }
Answer:
- List of searched documents
Get all versions of the file
Path to servlet: api/documents/{fileId}/versions
Method: GET
Parameters:
- fileId - Id of the file for which we want to download all versions( parameter passed in servlet path)
Answer:
- List of searched documents
Changes the data in the database regarding the downloaded document
Changes the data in the database regarding the downloaded document to be changed. Sets the appropriate status, date of downloading the document, and downloading user.
Path to servlet: api/documents/{fileId}/checkOut
Method: PUT
Parameters:
- fileId- file id (parameter transferred in servlet path)
Answer:
- Relevant HTTPStatus: OK, CONFLICT or FORBIDDEN
Cancels making changes to a downloaded document
Cancels making changes to a document. Sets the appropriate status, resets the date the document was downloaded, and the downloading user.
Path to servlet: api/documents/{fileId}/undoCheckOut
Method: PUT
Parameters:
- fileId - file id (parameter transferred in servlet path)
Answer:
- Relevant HTTPStatus: OK or CONFLICT
Saves a new version of the file
Saves a new version of the file we previously downloaded to change.
Path to servlet: api/documents/checkIn
Method: POST
enctype: multipart/form-data
Query Content:
HTML form containing the definition of the document. The definition should contain the following field:
- file - File type f file
- description - Description
- parentFileId - id of the file we are updating
- comment - comment
Answer:
- The response contains the id of the saved file in case of a valid save or the content of the error depending on the returned response status.
Download the current status of a document
Path to servlet: api/documents/{fileId}/status
Method: GET
Parameters:
- fileId - file Id
Answer:
- Current document status.