-
-
Notifications
You must be signed in to change notification settings - Fork 75
HTTP API
Asks for basic auth login. On success it returns {"token": ""}. It also attempts to set the cookie token. If no cookie token is already set a new one is created.
Returns status code 200 if the token is valid. Does not create new tokens. Tokens can also be retrieved from cookies.
When called as just /api/logout it deleted only the current login, if it exists. If a user is supplies such as /api/logout/brain then all tokens for that user will be removed. A standard user can call this for themselves, admins can call it for anyone.
Runs a query with a JSON response. Returns JSON on success. If no token cookie is detected, a login will be requested. New tokens are not created with this call.
If the user is an admin it allows viewing and setting global settings. New tokens are not created with this API. Key is optional. Eg. Get Port Number /api/settings/global_setting/port. Get all global settings /api/settings/global_setting/port?value=1234. All results are returned in a format compatible with JSON.parse().
The same as global settings but on a per skill basis. If name is not provided then it shows all settings for a skill, if neither name nor skill are provided it shows all settings for all skills.
The same as above except with an optional user parameter. Non-admins can view and set their own data. Admins can view/set all users.