JSON commands for internal setup and information.
This is used internally for the web server.
This API might change in the future.
Those commands can be used when directly interfacing to the process (see Client's JSon config interfacing). They are blocked web going through web server (http://.../json)
The Authentication is effective only through the web server. The direct JSON commands are not filtered.
Get process and modules information
answer:
{"_info":{"product":"SOUND4 x1.CLOUD","version": "1.3.7","title": "x1 .CLOUD","preset_extension":"clx1","use_presets":true,"use_undoredo":true,
"_modules_":["","wm"],
"_modules_infos_":{
"wm":{"product":"SOUND4 WM","version": "0.1.0","title":"SOUND4 WM","use_presets":false,"use_undoredo":false}
}}}
Authentication management
Some API are available only if there is a setup/admin account.
Secret stored is
MD5(username+":"+realm+":"+password)
Difference between setup and admin account
There are 2 modes:
- Setup mode: you define a setup account, which can then create an administrator account.
The setup account always keeps the access and can delete the administrator.
- Admin mode: you define the administrator, which will be the single administrator.
From JSON, changing setup_is_admin can change the mode.
Access encoding
Access is a combinaison of letters.
- 'S' Setup account : Allow Admin and delete admin
- 'A' Admin access : Access to all overrides any other except setup
- 'x' eXecute : change preset, list presets and preset infos and access settings.general fields
- 'v' View : read preset and settings values
- 'w' Write : change preset/settings (and undo/redo)
- 's' Save : create/save/delete/rename/import preset
- 'p' Password : change own password
- '-' inactive : account is inactive
Change setup account
Allows to setup a setup account (even when is was not configured) or to remove it
Set the setup/admin account
{"_auth":{"init":{"setup_account":{"user":"admin","secret":"be666f22c03f199e05d3805430d69599"},"setup_is_admin":true,"unlogged_access":"rx"}}}
answer:
{"OK":{"command":"_auth"}}
Set the setup/admin account with clear password
{"_auth":{"init":{"setup_account":{"user":"admin","secret_clear":"admin"},"setup_is_admin":true,"unlogged_access":"rx"}}}
answer:
{"OK":{"command":"_auth"}}
Remove the setup/admin account
{"_auth":{"init":{"setup_account":null}}}
answer:
{"OK":{"command":"_auth"}}
Get user info
{"_auth":{"get":{"user":"username"}}}
answer:
{"_auth":{"get":{"user":"username","secret":"secrethash","access":"rwx"}}}
Add or modify a user
{"_auth":{"add":{"user":"username","secret":"secrethash","access":"rwx"}}}
answer:
{"_auth":{"add":{"user":"username","secret":"secrethash","access":"rwx"}}}
Removes a user
{"_auth":{"remove":{"user":"username"}}
answer:
{"_auth":{"remove":{"user":"username"}}
List users
answer:
{"_auth":{"list":["user1","user2",...]}}
Get/set unlogged access
{"_auth":{"get":{"unlogged_access":null}}}
answer:
{"_auth":{"get":{"unlogged_access":"rwx"}}}
Get realm
{"_auth":{"get":{"realm":null}}}
answer:
{"_auth":{"get":{"realm":"Authentification is required"}}}
Get API version
{"_auth":{"get":{"api_version":null}}}
answer:
{"_auth":{"get":{"api_version":2}}}
Get setup is admin
{"_auth":{"get":{"setup_is_admin":null}}}
answer:
{"_auth":{"get":{"setup_is_admin":true}}}
Get/set setup account
{"_auth":{"get":{"setup_account":null}}}
answer:
{"_auth":{"get":{"setup_account":{"user":"setup","secret":"secrethash","access":"sarwx"}}}}
Get/set custom storage
Implementation defined extra storage, stored in auth.json
{"_auth":{"get":{"storage":null}}}
answer:
{"_auth":{"get":{"storage":whateverjson...}}}
Get process' interface description
Get XML decription
answer:
<?xml version="1.0"?>
<Process title="x1 .CLOUD" default_name="" preset_extension="clx1">
...
</Process>
- Attention
- The answer is XML, not JSON !
Get Process Image
answer:
{"_image":"iVBORw0KGgoAA..." }
The string is the base64 encoding of the image (png format)
Get Process Ico
answer:
{"_ico":"AAABAAUAEBAAAAEAIABo..." }
The string is the base64 encoding of the icon (ico format)