Chapter 3. JSON-RPC API

Table of Contents

1. Common principles
1.1. Naming
1.2. Lists
2. User Management
2.1. Change password (documentserver.users.changeMyPassword)
2.2. Get user list (documentserver.users.list)
3. Document
3.1. List of actions (documentserver.document.actionList)

This API is used to call remote functions over DEP2 protocol.

1. Common principles

There are several common principles for mostly all API calls.

1.1. Naming

Functions are grouped to packages which are similiar to Java packages. Function have to be called with fully qualified name including package name. Use camelCase naming for function names. Package names should be lowercase.

1.2. Lists

Several functions return list of object. All returned objects are expected to have same structure. General format of returned list:

{
  "position": 0,  /* Position of the first returned object 
                     in the same collection on the server. 
                     Position is zero based index */
  "count": 10,    /* Total number of objects on the server */
  "records": [
    /* Array of returned objects */
  ]
}

2. User Management

There are several functions for user managment.

2.1. Change password (documentserver.users.changeMyPassword)

Function name: documentserver.users.changeMyPassword

Parameter: array with one string: ["new-password"].

Returns array with one bool. True if succeeded, false if failed.

2.2. Get user list (documentserver.users.list)

Function name: documentserver.users.list

Parameter: no parameters

Return list of users in standard format (Section 1.2, “Lists”). Format of user object:

{
  /* username of the user */
  "username":"donald",
   /* first name */
  "firstname":"Donald",
  /* last name */
  "lastname":"Douglas"
}

3. Document

Document specific functions.

3.1. List of actions (documentserver.document.actionList)

Function name: documentserver.document.actionList

This function returns list of available actions for the selected document.

Parameters:

documentId

ID of the selected document

version

Version of the document. Can be empty string.

serverVersion

Server specific identifier of current version. Can be empty string.

Returns list of available actions in standard format (Section 1.2, “Lists”). Format of one action:

{
  /* Name of the action */
  "name":"Add Task to Person",
  /* URL of the form to start action */
  "formUrl":"chrome://documentserver/content/addDocumentTask.xml",
  /* Description of the action, optional */
  "description":"Assign task connected with the document to the specific person"
}