Ozone API is is provided to all applications running over Ozone. The API is the global object named api.
Ozone API is can be used following this syntax:api . namespace . action
For example, the settings API can be used to set a global settings by using the following command:
JavaScript
api.settings.set("key", "value", "general.json")
Namespaces act like categories of functionality, and are used primarily by the system for grouping application permissions. Learn More about permissions.
API parameters description get key / "all", file_name read settings values from a settings file set key, value, file_name set settings values in a settings file remove key, file_name remove a settings key from a settings file
API parameters description read file_path read a file, returns a file node stream file_path read a file, returns a stream-able file node
API parameters description write file_path, data update or create a file mkdir path make a directory mkdirp path make nested directories remove path remove a file or directory at path
API parameters description list path list all contents of a directory exists path returns a boolean about existence of a path open path automatically open a file in the right app via Ozone
API parameters description getMime path get mime type from a file path norm path normalize a file system path getNamespaces none get all permission namespaces
API parameters description ensureRoot path ensure a path is rooted correctly parentOf path get the parent directory of a given path
API parameters description open path, params[], mode open an application with params
API parameters description installFromURL app_url install an app directly from a URL install base, files, metadata install an app from local resources
API parameters description register definedKey returns a channel key your window can broadcast events to broadcast channelKey, data broadcast events with data to your channel key listen channelKey returns a handler that listens to channel with its key
API parameters description create appTag returns a URL and an event channelKey for embedding other apps
API parameters description get key / "all", file_name read stored values from the app storage file set key, value, file_name set values for keys in the app storage file remove key, file_name remove a storage key from the app storage file
api.params returns a list of all parameters passed when opening the current application.