aboutsummaryrefslogtreecommitdiff
path: root/api.md
blob: 8fac72c9c61d9aa88320c598ca7f78df320e9d94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# 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/node/<path...>`

Request a library node (either a directory or item). See
[`common/src/api.rs`](./common/src/api.rs)

## GET* `/api/assets/node/<path..>?<role>`

Where `role` is one of `Backdrop` or `Poster`. Returns assets for a node.

## GET* `/stream/<path..>?tracks=<track-ids>&webm=<bool>`

Responds with the stream.