Simple 'get' server. Responses are in either json or html
To use, simply 'get' with any of the following options:
The following commands handle user logins and will work with / without being logged in
| Command | Description |
|---|---|
| login | Logs in. Logs out if already logged in, then tries to login. Redirects to redirect_url if provided, otherwise the current project's main page. |
| logout | Logs out if logged in |
| smart_login Depricated | Logs out if logged in. Logs in if logged out. |
| get_user |
Returns json with {"username": "usn", "status": "success"}
if logged in or {"status": "Not logged in"}, if not.
|
The following commands deal with project-level tasks, and all require project_name to be set, with the exception of list_projects
| Command | Description |
|---|---|
| list_projects |
Lists projects the current user has admin or member access to.
Does not require project_name
|
| delete_all | Deletes all current pages in the project. Requires admin |
| list_users | Lists all users in the current project level, split by access level. |
| create_project | Creates a new project with the given name. Creator will be added to users list and given admin rights. |
| delete_projects | Deletes a project. Requires admin rights. |
| make_public | Makes a project public, i.e. anyone can access it. |
| make_private | Makes a project public, i.e. permission is needed to access it. |
These commands grant / revoke privilages to users
They all require a project_name and a user_name
| Command | Description |
|---|---|
| add_access | Grants 'view' access to the project. |
| remove_access | Revokes 'view' access to the project. |
| add_admin | Grants admin privelidges to the project. |
| remove_access | Revokes admin privelidges to the project. |
These deal with pages. They each require a project_name and url
| Command | Description |
|---|---|
| add_or_replace_page | Adds a page to the project. Alternatively, if the page already exists, it will be replaced with the latest live version, and all comments will be deleted. |
| update_page | Updates the page to the latest live version. Comments will be kept 'as-is'. This may cause some errrors. If the page is not in the project, it will be added. |
| page_details | Gives full details of the page, including url, and creator, as well as details of every version uploaded, all annotations for each version and versions of each annotation. Currently only works for JSON. |
| roll_back_page | Deletes the latest version of a page. Admin privelidges required. If only one version is stored, this will throw an error |
| view_page | Views the saved html for a page. |
| delete_page | Removes a page from the project |
| annotate |
Creates an annotation on the given page. Message, x position,
and y position are all saved, for access via Page Details.
|
| get_annotations | Gets a list of annotations only. |
| temp_view | Gets the url requested for temporary viewing only. |
| grab_temp_page | Gets the most recently 'temp view'ed page, and adds to the project. |
These are only required for the 'admin' pages:
project_name=x- View the api for a given project.project_name=x&command=Switch Project- Swtiches to the given project. Only needed for the API.