mirror of
https://github.com/nostr-protocol/nips.git
synced 2024-11-13 23:39:08 -05:00
add query args to Listing Files
This commit is contained in:
parent
436f7ac2e9
commit
78ee7203af
14
96.md
14
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
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user