RealObjects Nimbudocs Editor 3.1.4195_Beta6

Nimbudocs Editor REST API


Introduction

This document describes the REST APIs provided by Nimbudocs Editor.

The REST APIs of Nimbudocs Editor provide access to resources and management functionalities

Resources

/rest/assets

GET

Returns an XML containing a list of all available assets.
Expected Responses:
200 [text/xml]
A list of available assets.
/rest/assets/{asset}

GET

Retrieves assets like style sheets used by Nimbudocs Editor. This is useful to ensure that Nimbudocs Editor documents look the same outside of a Nimbudocs Editor instance. The following assets are currently available:
main.css
Common styles used by the editor. This is required to display documents correctly.
fonts.css
This contains all fonts currently available to the editor.

To ensure that your documents look identical outside of Nimbudocs Editor, all assets must be included.

Expected Responses:
404
If the asset was not found or does not exist.
200 [text/plain]
The asset content.
Examples:
  • /rest/assets/main.css
  • /rest/assets/fonts.css

Management API

To use the Management Service API the Management Service (management.war) has to be deployed in your application server. For the Virtual Appliance and the preconfigured Jetty package, the Management Service is already deployed by default and can be reached on the following (Base) URL

http://yournimbudocsserver:9424/management/${COMMANDPATH}?adminKey=${YOURADMINKEY}

To use the Management Service an Admin-Key has to be set. Please note that the Management Service runs on a different port than Nimbudocs Editor itself, so you can restrict access to it using e.g. a firewall.

By default the GET commands return data in XML format. If you want to retrieve the data in JSON format, append ".json" to the command path, e.g.:

http://yournimbudocsserver:9424/management/editor/data.json?adminKey=${YOURADMINKEY}

PUT requests expect payload in either XML or JSON format (see the corresponding GET methods for the structure of the payload)

Request type COMMANDPATH Additional query parameters Description
GET document/${DOCUMENTID}   Fetches the content of the editor with the corresponding document id.
GET editor/data/autosave/${DOCUMENTID}  

delete: whether to delete the autosave from disc after retrieving.

Fetches the binary autosave data for this editor instance.
GET editor/data

diagnostic: enable diagnostics mode (use true as argument value to enable)

noLock: enable diagnostics mode (use true as argument value to enable)

This returns information (documentId, documentName, ...) about all editor sessions and their associated users.

Using the diagnostic mode will return information about the amount of objects used by the document, as well as information about the undo/redo stack for each editor. Please note that it can take up to 1-2 minutes to gather this information, furthermore we recommend not to call this method too often (e.g. every minute).

This noLock variation of the diagnostic mode will try to retrieve the information in a "brute-force" way which could lead to data loss/corruption (for those particular editors) and should only be used with caution (e.g. in situations where the server has to be restarted anyway).

GET licenseinfo   Returns information about the installed license key.
GET server/settings   Returns information about the server settings (log level, state).
GET server/info   Returns information about the server environment and configuration.
GET server/log   Fetches the server log in chunks.
GET healthcheck   Checks if the server is running correctly. Returns with HTTP 200 and "OK" if the server is running.
GET server/customfonts   Returns a list of custom fonts installed on the server.
GET server/shutdown   Returns the remaining time (in seconds) until the server is shut down.
GET server/dictionarymanager/words/${LANGUAGEID}   Returns list of the words stored in the application dictionary for the specified language code.
GET server/dictionarymanager/lang   Returns a list of language codes for which an application dictionary exists on this server.
PUT server/settings  

Set the log level and/or state of the server.

logLevel can be one of SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST

state can be one of OK, SHUTDOWN, MAINT.

 

PUT server/licensekey   Sets the license key, while the server is running. Expects the license key as string (application/octet-stream).
PUT editor/data/autosave/${DOCUMENTID} Saves autosave data for an editor instance. Data is expected as string (application/octet-stream).
PUT server/apikeys   Adds API keys. Expects an array of strings.
PUT server/customfonts   Adds a custom font to the server. Data has to be sent as form multi-part data consisting of at least the following parts:
  • A string value with the key "fontFamily" containing the name of the font family.
  • One or more font files (only ttf, otf, woff, woff2 are allowed).
Optional form data:
  • A boolean string value with the key "italic", if the font files uploaded are for the italic (and/or bold) variant of the font family.
  • A boolean string value with the key "bold", if the font files uploaded are for the bold (and/or italic) variant of the font family.
  • A integer string value with the key "weight", if you want to use a numeric font weight for the added font variant. Using weight overrides the "bold" flag.
PUT server/dictionarymanager/words/${LANGUAGEID}   Adds add list of words to the application dictionary specified by the language ID. Use a language code (e.g. en-US) as the language ID.

wordList needs to be a JSON array consisting of one or more words to add.

DELETE editor/close/${DOCUMENTID}   Closes the editor with the specified document id.
DELETE server/kill   Immediately kills the server by stopping the process. Use with caution, may cause data loss.
DELETE server/shutdown time

If the time parameter is specified and a positive integer, the server state will be set to MAINT until the time has expired. In this state no new editor requests are accepted and the client side "onprepareservershutdown" callback is triggered. If the time has passed or if no time was specified, the server is set to state SHUTDOWN. In this state no new editor sessions are accepted and all existing sessions are closed.

 

DELETE server/cancel-shutdown   Cancels the timer set with "server/shutdown". Works only as long as the time has not yet expired.
DELETE server/restart   This works only in specific situations. The flag supportsRestart in "server/info" must be true.
DELETE server/customfonts/${FONTHASH}   Removes the custom font with the specified font hash.
DELETE server/dictionarymanager/words/${LANGUAGEID}   Removes the words in the indicated list of words from the application dictionary specified by the language ID. Use a language code (e.g. en-US) as the language ID.

wordList needs to be a JSON array consisting of one or more words to remove.

DELETE server/dictionarymanager/lang/${LANGUAGEID}   Deletes the entire application dictionary for the specified by the language ID. Use a language code (e.g. en-US) as the language ID.