]> Untitled Git - lemmy.git/commitdiff
Adding image endpoints to docs. Fixes #1226 (#1232)
authorDessalines <dessalines@users.noreply.github.com>
Mon, 26 Oct 2020 11:07:23 +0000 (07:07 -0400)
committerGitHub <noreply@github.com>
Mon, 26 Oct 2020 11:07:23 +0000 (11:07 +0000)
docs/src/contributing_websocket_http_api.md

index 8a81b6c3514b51099cfd9a8189c54c1c3b72c5a5..04a89cb9b08dc356803c2f71e5a30115435035ec 100644 (file)
     + [All](#all)
     + [Community](#community-1)
     + [User](#user)
+  * [Images](#images)
+    + [Get](#get)
+    + [Create](#create)
+      - [Request](#request-58)
+      - [Response](#response-58)
+    + [Delete](#delete)
 
 <!-- tocstop -->
 
@@ -2032,3 +2038,39 @@ Only the recipient can do this.
 
 `/feeds/u/user-name.xml?sort=Hot`
 
+### Images
+
+Lemmy forwards image requests to a locally running Pictrs.
+
+#### Get
+
+*Format and thumbnail are optional.*
+
+`GET /pictrs/image/{filename}?format={webp, jpg, ...}&thumbnail={96}`
+
+#### Create
+
+##### Request
+
+Uploaded content must be valid multipart/form-data with an image array located within the images[] key.
+
+`POST /pictrs/image` 
+
+##### Response
+
+```
+{
+  "files": [
+    {
+      "delete_token": "{token}",
+      "file": "{file}.jpg"
+    }
+  ],
+  "msg": "ok"
+}
+```
+
+#### Delete
+
+`GET /pictrs/image/delete/{delete_token}/{file}`
+