From 78ee7203af1836e99f54718c792d3060c17ca3e3 Mon Sep 17 00:00:00 2001 From: Quentin Date: Sat, 29 Jun 2024 10:11:15 +0200 Subject: [PATCH] add query args to Listing Files --- 96.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/96.md b/96.md index 8f7b6ce..8ce2531 100644 --- a/96.md +++ b/96.md @@ -282,9 +282,10 @@ The successful response is a 200 OK one with just basic JSON fields: ## Listing files -`GET $api_url?page=x&count=y&sort=z&search=w` +`GET $api_url?page=x&count=y&sort=z&order=w&search=term` AUTH **required** for pubkey file listing. + AUTH **NOT** required for public file listing. Returns a list of files. If auth event is present, the server should return only files uploaded by the pubkey in the auth event. @@ -304,7 +305,7 @@ Example Response: ["size", "123456"], ["alt", "a meme that makes you laugh"], ["expiration", "1715691139"], - ["file_tags", "cat, meme, funny, laugh"], + ["file_tags", "cat, meme, funny, laugh"], // ...other metadata ] "content": "haha funny meme", // caption @@ -319,8 +320,13 @@ Example Response: ### Query args -- `page` page number (`offset=page*count`) -- `count` number of items per page +- `page` **REQUIRED** Page number (`offset=page*count`) +- `count` **REQUIRED** Number of items per page +- `sort` **OPTIONAL** Can be 'created_at' or 'size'. Default is 'created_at'. +- `order` **OPTIONAL** Page order 'ASC' or 'DESC'. Default is 'DESC'. +- `search` **OPTIONAL** Search term. The server should search in the `alt` and `file_tags` fields. + +The server can or not support optional query args. ## Selecting a Server