Retrieving the document status

You can get the document status by the Editor Application API.

Table 1. Editor Application API

This table provides reference information for the Editor Application API to get the document status

Method URI Description Parameters or variables
GET /docs/api/docsvr/{repositoryType}/{file_id}/draft Gets the status of a HCL Docs document.

{repositoryType}: The value can be lcfiles, external.cmis or external.rest

{file_id}: The ID of the document

Example

  • GET /docs/api/docsvr/external.cmis/test.odt/draft
    
    GET /docs/api/docsvr/external.rest/test.odt/draft
    Output:
    {
       "base_version": "pwc",
       "created": "2015-08-05T02:11:42.944Z",
       "dirty": false,
       "editors": [
          {
             "displayName": "docs09",
             "email": "docs_test@mail.com",
             "id": "5c11a0c0-7f6f-1033-982d-eba7a40afa7a"
          }
       ],
       "lasteditor": {
          "displayName": "anonymous",
          "email": null,
          "id": "5c11a0c0-7f6f-1033-982d-eba7a40afa7a"
       },
       "latest_version": "pwc",
       "latest_version_modified": 1438676855408,
       "latest_version_modifier": "docs09",
       "modified": "2015-08-05T02:11:42.944Z",
       "size": 7852,
       "valid": true,
       "visited": "2015-08-05T02:36:10.993Z"
    }
Note: Make sure your repository specifies the same date format as the Output Example above. HCL Docs uses AtomDate to implement date format:
<dependency>
   <groupId>org.apache.abdera</groupId>
   <artifactId>abdera</artifactId>
   <version>0.4.0-incubating</version>
 </dependency>
Example code is like the following:
String date = AtomDate.valueOf(Calendar.getInstance()).getValue()