From 8d2a2fd918e52018b5ff5bc66bc3f67bb7c58d8d Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sun, 19 Feb 2023 16:17:17 +0100 Subject: api doc --- api.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 api.md (limited to 'api.md') diff --git a/api.md b/api.md new file mode 100644 index 0000000..a8a229e --- /dev/null +++ b/api.md @@ -0,0 +1,26 @@ +# Jellything API + +Routes marked with `*` require authentification. Any endpoint returning JSON, +will report errors with an object containing error string in the `error` key. + +The `jellycommon` crate provides useful structs for deserializing data. + +```toml +# Cargo.toml +[depedencies] +jellycommon = { git = "https://codeberg.org/metamuffin/jellything.git" } +``` + +## GET `/api/version` + +Returns API version number. + +## POST `/api/account/login` + +Request body contains JSON with keys `username` and `password`. The Response +contains the session cookie. + +## GET* `/api/library/` + +Request a library node (either a directory or item). See +[`common/src/api.rs`](./common/src/api.rs) -- cgit v1.2.3-70-g09d2