From 96bdc57c67d6e6864b7a4c7c57bfb8b37cb205d4 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Thu, 6 Feb 2025 17:12:11 +0100 Subject: doc: asset endpoint --- doc/api.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'doc/api.md') 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/`, 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/?` + +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//poster?` ### GET* `/n//backdrop?` -- cgit v1.2.3-70-g09d2