KRYSTAL DMS - Premium Edition exposes a REST API which allows for remote execution of many of the system's capabilities. From creating documents to starting a workkflow case, to downloading a document, there are a large number of options which allow fine-grained control of a KRYSTAL DMS instance.
Once you have installed KRYSTAL DMS – Premium Edition Version 2022 or later, you will have access to the Web Services API.
Primeleaf team will provide you with the Web Services API URL needed to develop your custom built projects.
You will be able to access the WSDL file using following URL.
Where
Your_Server_IP is the IP Address or Fully Qualified Domain Name (FQDN) of server where KRYSTAL DMS is installed.
HTTP_Port is the port number on which KRYSTAL DMS is configured to be running.
The KRYSTAL DMS API supports a subset of the functionalities of the KRYSTAL DMS - Premium Edition user interface as outlined below.
# | Request Type | URL | Response Content Type | Description |
---|---|---|---|---|
1 | POST | /signon | application/json | Sign On |
2 | GET | /signout | application/json | Sign Out |
3 | GET | /documentclasses | application/json | Get Document Classes |
4 | GET | /documentclasses/{classid}/documents | application/json | Get Documents of a Class |
5 | GET | /documentclasses/{classid}/search | application/json | Search Documents of a Class |
6 | POST | /documentclasses/{classid}/indexsearch | application/json | Search Documents by Document Indexes |
7 | PUT | /documentclasses/{classid}/documents | application/json | Create Document |
8 | GET | /documents/{documentid} | application/json | Get Document Details |
9 | GET | /documents/{documentid}/{revisionid} | application/json | Get Document Revision Details |
10 | GET | /documents/download/{documentid} | application/json | Download Document |
11 | GET | /documents/download/{documentid}/{revisionid} | application/json | Download Document Revision |
12 | GET | /documents/checkout/{documentid} | application/json | Checkout Document |
13 | POST | /documents/checkin/{documentid} | application/json | Check In |
14 | GET | /documents/cancelcheckout/{documentid} | application/json | Cancel Checkout |
15 | GET | /documents/indexes/{documentid}/{revisionid} | application/json | Get Document Indexes |
16 | POST | /documents/indexes/{documentid}/{revisionid} | application/json | Update Document Indexes |
17 | GET | /documents/thumbnail/{documentid}/{revisionid} | application/json | Get Document Thumbnail |
18 | DELETE | /documents/{documentid} | application/json | Delete Document |
19 | GET | /documents/revisionhistory/{documentid} | application/json | Get Revision History |
20 | GET | /documents/accesshistory/{documentid} | application/json | Get Access History |
Parameter | Parameter Type | Data Type |
---|---|---|
username | formData | string |
password | formData | string |
curl -d username=username -d password=password https://localhost/rest/signon
https://localhost/rest/signon
{ "errorCode":0, "errorMessage":"", "authToken":"8E6A0B55-5FFA-4A0F-B485-9FEC70D7CA87" //Auth Token }
curl -H "Authorization:Auth Token" https://localhost/rest/signout
https://localhost/rest/signout
{ "errorCode":0, "loggedOut":true }
curl -H "Authorization:Auth Token" https://localhost/rest/documentclasses
https://localhost/rest/documentclasses
{ "errorCode":0, "availableClasses":[ { "accessType":"P", "activeDocuments":14, "allowedExtensions":"", "classDescription":"Demo Document Types", "classId":15, "className":"DEMO", "created":"2020-05-27 13:32:41.784775", "dataTableName":"Z0000015", "documentIndexes": [ { "id":15, "indexDescription":"Document Title", "indexName":"TITLE", "indexType":"S", "mandatory":false, "operator":0, "sequence":1, "unique":false }, ... ... ], "documentLimit":2147483647, "expiryNotificationPeriod":7, "expiryPeriod":0, "importLocation":"", "importType":"I", "indexCount":1, "indexId":15, "indexTableName":"I0000015", "maximumFileSize":26214400, "revisionControlEnabled":true, "storageLocation":"DEFAULT", "storageType":"RDBMS", "totalDocuments":15, "uniqueFileNamesOnly":false, "userName":"ADMINISTRATOR", "visible":true }, ... ... ] }
curl -H "Authorization:Auth Token" https://localhost/rest/documentclasses/{classid}/documents
https://localhost/rest/documentclasses/{classid}/documents
{ "errorCode":0, "documents":[ { "accessCount":0, "classId":15, "created":"2020-06-11 17:33:05.422958", "createdBy":"ADMINISTRATOR", "documentId":204, "documentType":"PDF", "extension":"PDF", "fileName":"Payment_Vouchers_114_1_0.PDF", "hasNote":0, "indexes":[ { "id":0, "indexDescription":"Document Title", "indexName":"TITLE", "indexType":"S", "mandatory":false, "operator":0, "sequence":0, "unique":false, "value1":"PDF Document" }, ... ... ], "lastAccessed":"2020-06-11 17:33:05.31", "length":930181, "modified":"2020-06-11 17:33:05.31", "modifiedBy":"ADMINISTRATOR", "revisionId":"1.0", "score":0.0, "status":"I" }, ... ... ] }
Parameter | Parameter Type | Data Type |
---|---|---|
searchText | queryString | string |
curl -H "Authorization:Auth Token" https://localhost/rest/documentclasses/{classid}/search?searchText=KRYSTAL
https://localhost/documentclasses/{classid}/search?searchText=[searchText]
{ "errorCode":0, "documents":[ { "accessCount":0, "classId":15, "created":"04-Jun-2020 11:59", "createdBy":"ADMINISTRATOR", "documentId":191, "documentType":"", "expiry":"", "extension":"", "fileName":"VeryBigImage.jpg", "hasNote":0, "indexes":[ { "id":0, "indexDescription":"Document Title", "indexName":"TITLE", "indexType":"S", "mandatory":false, "operator":0, "sequence":0, "unique":false, "value1":"DEMO for KRYSTAL DMS" }, ... ... ], "lastAccessed":"04-Jun-2020 11:59", "length":0, "modified":"04-Jun-2020 11:59", "modifiedBy":"ADMINISTRATOR", "revisionId":"1.0", "score":2.5261518955230713, "status":"" }, ... ... ] }
Parameter | Value | Parameter Type | Data Type |
---|---|---|---|
documentIndexes |
[ { "indexName":"INDEXNAME", "value1":"Search Text" "operator" : 1 }, ... ... ]Operator Values: 1 - Is 2 - Is Not 3 - Like 4 - Not Like 5 - Is Greater Than 6 - Is Lesser Than 7 - Between 8 - Is Empty 9 - Is Not Empty |
body | application/json |
curl -H "Authorization:Auth Token" -X "POST" -H "Content-Type: application/json" -d " {\"documentIndexes\" : [ { \"indexName\":\"INDEXNAME\", \"value1\":\"SEARCHTEXT\" , \"operator\":1 }, {...} ] } " https://localhost/rest/documentclasses/15/indexsearch
https://localhost/rest/documentclasses/{classid}/indexsearch
{ "errorCode":0, "documents":[ { "accessCount":0, "classId":15, "created":"2020-06-04 11:59:11.689377", "createdBy":"ADMINISTRATOR", "documentId":191, "documentType":"JPG", "extension":"JPG", "fileName":"VeryBigImage.jpg", "hasNote":0, "indexes":[ { "id":0, "indexDescription":"Document Title", "indexName":"TITLE", "indexType":"S", "mandatory":false, "operator":0, "sequence":0, "unique":false, "value1":"DEMO for KRYSTAL DMS" } ], "lastAccessed":"2020-06-25 11:23:11.618", "length":3906836, "modified":"2020-06-25 11:23:11.618", "modifiedBy":"ADMINISTRATOR", "revisionId":"1.0", "score":0.0, "status":"I" }, ... ... ] }
Parameter | Value | Parameter Type | Data Type |
---|---|---|---|
createDocumentRequest |
{ "documentIndexes" :[ { "indexName":"INDEXNAME", "value1":"Search Text" }, ... ... ], "fileName" : "actual file name", "fileBytes" : "BASE64EncodedFileContent", "expiryDate" : "31-Dec-2099", "comments" : "comments", "attachments" : [ { "fileName" : "attachement file name", "fileBytes" : "BASE64EncodedFileContent", "title" : "attachment title", "keywords" : "attachment keywords" }, ... ... ] } |
body | application/json |
curl -H "Authorization:Auth Token" -X "PUT" -H "Content-Type: application/json" -d " {\"documentIndexes\" : [ { \"indexName\":\"INDEXNAME\", \"value1\":\"INDEX VALUE\" },{...}], \"fileName\" : \"sample.txt\" , \"fileBytes\" : "VGhpcyBpcyBhIHNhbXBsZSB0ZXh0IGZpbGU=",\"expiryDate\" : \"31-Dec-2020\", \"comments\" : \"Document Create Comments\" } " https://localhost/rest/documentclasses/15/documents
https://localhost/rest/documentclasses/{classid}/documents
{ "errorCode":0, "documentId":NNNNNN, "documentCreated":true }
curl -H "Authorization:Auth Token" https://localhost/rest/documents/{documentid}
https://localhost/rest/documents/{documentid}
{ "errorCode":0, "documentDetails":{ "accessCount":2, "classId":15, "created":"2020-06-04 11:59:11.689377", "createdBy":"ADMINISTRATOR", "documentId":191, "documentType":"IMAGE", "expiry":"", "extension":"JPG", "fileName":"VeryBigImage.jpg", "hasNote":0, "indexes":[ { "id":15, "indexDescription":"Document Title", "indexName":"TITLE", "indexType":"S", "mandatory":false, "operator":0, "sequence":0, "unique":false, "value1":"DEMO for KRYSTAL DMS" }, ... ... ], "lastAccessed":"2020-06-23 14:33:23.89", "length":3906836, "modified":"2020-06-04 11:59:11.689", "modifiedBy":"ADMINISTRATOR", "revisionId":"1.0", "score":0.0, "status":"I" } }
curl -H "Authorization:Auth Token" https://localhost/rest/documents/{documentid}/{revisionid}
https://localhost/rest/documents/{documentid}/{revisionid}
{ "errorCode":0, "documentDetails":{ "accessCount":2, "classId":15, "created":"2020-06-04 11:59:11.689377", "createdBy":"ADMINISTRATOR", "documentId":191, "documentType":"IMAGE", "expiry":"", "extension":"JPG", "fileName":"VeryBigImage.jpg", "hasNote":0, "indexes":[ { "id":15, "indexDescription":"Document Title", "indexName":"TITLE", "indexType":"S", "mandatory":false, "operator":0, "sequence":0, "unique":false, "value1":"DEMO for KRYSTAL DMS" }, ... ... ], "lastAccessed":"2020-06-23 14:33:23.89", "length":3906836, "modified":"2020-06-04 11:59:11.689", "modifiedBy":"ADMINISTRATOR", "revisionId":"1.0", "score":0.0, "status":"I" } }
curl -H "Authorization:Auth Token" https://localhost/rest/documents/download/{documentid}
https://localhost/rest/documents/download/{documentid}
{ "errorCode":0, "documentFile": BASE64EncodedFileContent }
curl -H "Authorization:Auth Token" https://localhost/rest/documents/download/{documentid}/{revisionid}
https://localhost/rest/documents/download/{documentid}/{revisionid}
{ "errorCode":0, "documentFile":BASE64EncodedFileContent }
curl -H "Authorization:Auth Token" https://localhost/rest/documents/checkout/{documentid}
https://localhost/rest/documents/checkout/{documentid}
{ "errorCode":0, "documentFile": BASE64EncodedFileContent }
Parameter | Value | Parameter Type | Data Type |
---|---|---|---|
checkInDocumentRequest |
{ "documentIndexes" :[ { "indexName":"INDEXNAME", "value1":"INDEX VALUE" }, ... ... ], "fileName" : "actual file name", "fileBytes" : "BASE64EncodedFileContent", "expiryDate" : "31-Dec-2099", "comments" : "comments", "majorVersion" : true } |
body | application/json |
curl -H "Authorization:Auth Token" -X "POST" -H "Content-Type: application/json" -d " {\"documentIndexes\" : [ { \"indexName\":\"INDEXNAME\", \"value1\":\"INDEX VALUE\" }], \"fileName\" : \"sample.txt\" , \"fileBytes\" : "VGhpcyBpcyBhIHNhbXBsZSB0ZXh0IGZpbGU=",\"expiryDate\" : \"31-Dec-2022\", \"comments\" : \"Check In Comments \", \"majorVersion\": false } https://localhost/rest/documents/checkin/{documentid}
https://localhost/rest/documents/checkin/{documentid}
{ "errorCode":0, "checkIn":true }
curl -H "Authorization:Auth Token" https://localhost/rest/documents/cancelcheckout/{documentid}
https://localhost/rest/documents/cancelcheckout/{documentid}
{ "errorCode":0, "cancelCheckout":true }
curl -H "Authorization:Auth Token" https://localhost/rest/documents/indexes/{documentid}/{revisionid}
https://localhost/rest/documents/indexes/{documentid}/{revisionid}
{ "errorCode":0, "indexes":[ { "id":15, "indexDescription":"Document Title", "indexName":"TITLE", "indexType":"S", "mandatory":false, "operator":0, "sequence":0, "unique":false, "value1":"DEMO for KRYSTAL DMS" }, ... ... ] }
Parameter | Value | Parameter Type | Data Type |
---|---|---|---|
documentIndexes |
[ { "indexName":"INDEXNAME", "value1":"New Value" }, ... ... ] |
body | application/json |
curl -H "Authorization:Auth Token" -X POST -H "Content-Type: application/json" -d " {\"documentIndexes\" : [ { \"indexName\":\"INDEXNAME\", \"value1\":\"New Value\" },{...} ] } " https://localhost/rest/documents/indexes/{documentid}/{revisionid}
https://localhost/rest/documents/indexes/{documentid}/{revisionid}
{ "errorCode":0, "indexUpdated":true }
curl -H "Authorization:Auth Token" https://localhost/rest/documents/thumbnail/{documentid}/{revisionid}
https://localhost/rest/documents/thumbnail/{documentid}/{revisionid}
{ "errorCode":0, "documentThumbNailFile":[-119,80,78,71,13,10,26,10,0,0,0,13,73,72,68,8, ... , ...] }
curl -H "Authorization:Auth Token" -X "DELETE: https://localhost/rest/documents/{documentid}
https://localhost/rest/documents/{documentid}
{ "errorCode":0, "documentDeleted":true }
curl -H "Authorization:Auth Token" https://localhost/rest/documents/revisionhistory/{documentid}
https://localhost/rest/documents/revisionhistory/{documentid}
{ "errorCode":0, "documentRevisionHistory":[ { "comments":"Document checked-in successfully.", "dateTime":"2020-06-15 17:10:27.42569", "documentId":184, "revisionId":"2.0", "userAction":"CHECKED IN", "userName":"ADMINISTRATOR" }, { "comments":"Document checked out", "dateTime":"2020-06-15 17:09:42.517597", "documentId":184, "revisionId":"1.0", "userAction":"CHECKED OUT", "userName":"ADMINISTRATOR" }, ... ... ] }
curl -H "Authorization:Auth Token" https://localhost/rest/documents/accesshistory/{documentid}
https://localhost/rest/documents/accesshistory/{documentid}
{ "errorCode":0, "documentAccessHistory":[ { "action":"Deleted", "actionDate":"2020-06-24 17:07:51.245084", "comments":"REST WS API", "ipAddress":"127.0.0.1", "objectId":191, "objectType":"D", "parameters":"Document ID 191 deleted", "userName":"ADMINISTRATOR" }, { "action":"Accessed", "actionDate":"2020-06-09 12:04:41.887051", "comments":"Document : VeryBigImage.jpg accessed", "ipAddress":"127.0.0.1", "objectId":191, "objectType":"D", "parameters":"", "userName":"ADMINISTRATOR" }, ... ... ... ] }