aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-02-06 17:12:11 +0100
committermetamuffin <metamuffin@disroot.org>2025-02-06 17:12:11 +0100
commit96bdc57c67d6e6864b7a4c7c57bfb8b37cb205d4 (patch)
tree04876b490d0ae9189b97d48cc4fe19a84f8a0b98 /doc
parent95a05fbbe4c8b0e04fcd7d5f4c20a3b0d29147b0 (diff)
downloadjellything-96bdc57c67d6e6864b7a4c7c57bfb8b37cb205d4.tar
jellything-96bdc57c67d6e6864b7a4c7c57bfb8b37cb205d4.tar.bz2
jellything-96bdc57c67d6e6864b7a4c7c57bfb8b37cb205d4.tar.zst
doc: asset endpoint
Diffstat (limited to 'doc')
-rw-r--r--doc/api.md14
1 files changed, 11 insertions, 3 deletions
diff --git a/doc/api.md b/doc/api.md
index 63ed274..bfa49c6 100644
--- a/doc/api.md
+++ b/doc/api.md
@@ -70,13 +70,21 @@ Returns `ApiHomeResponse`.
## Assets
-All asset endpoints redirect to the asset that you need. Returned images are
-coded with AVIF. The `width` parameter is the width of the resolution you want
-to image to be.
+Endpoints like `.../poster` redirect to the asset that you need and
+automatically choose fallbacks. Alternatively you can directly request assets
+with `/asset/<token>`, but there you need to implement the fallback behaviour
+yourself. Returned images are coded with AVIF. The `width` parameter is the
+width of the resolution you want to image to be.
> [!WARNING] The actual returned resolution must not be exactly what you
> requested. Currently it is rounded up to the next power of two.
+### GET* `/asset/<token>?<width>`
+
+This is the final asset endpoint where images are returned from. Other endpoints
+redirect here. The `token` part is an opaque string that you obtain from
+somewhere else like a redirect or from within the `Node` struct.
+
### GET* `/n/<id>/poster?<width>`
### GET* `/n/<id>/backdrop?<width>`