/api/user/files
Info
Requires authentication
GET Get all files
Query
Field Name | Type | Description |
---|---|---|
favorite | boolean? | Only get favorite files |
filter | string? | Filter by file type, defaults to all , but the other accepted value is media which checks for video/audio/image/text /* |
200 Ok (JSON)
Returns a array of files
[...,{"createdAt": "2022-12-01T17:41:48.887Z","expiresAt": null,"file": "jO2DMR.png","mimetype": "image/png","id": 529,"views": 0,"maxViews": null,"url": "/u/jO2DMR.png"},{"createdAt": "2022-12-01T17:41:19.582Z","expiresAt": "2022-12-02T17:41:19.578Z","file": "w48LRo.png","mimetype": "image/png","id": 528,"views": 0,"maxViews": null,"url": "/u/w48LRo.png"},{"createdAt": "2022-11-28T04:44:14.703Z","expiresAt": null,"file": "2RCTta.txt","mimetype": "text/plain","id": 520,"views": 0,"maxViews": null,"url": "/u/2RCTta.txt"},{"createdAt": "2022-11-28T04:42:34.821Z","expiresAt": null,"file": "17qFqL.zip","mimetype": "application/zip","id": 519,"views": 1,"maxViews": null,"url": "/u/17qFqL.zip"},...]
400 Bad Request (JSON)
take can't be more than 50
- Thetake
query parameter can't be more than50
.
DELETE Delete a file
Body (JSON)
Field Name | Type | Description |
---|---|---|
id | number? | The id of the file to delete |
all | boolean? | Whether to delete all files or not |
200 Ok (JSON)
Returns a file when all
is false.
{"createdAt": "2022-12-01T17:41:48.887Z","expiresAt": null,"file": "jO2DMR.png","mimetype": "image/png","id": 529,"views": 0,"maxViews": null,"url": "/u/jO2DMR.png"}
or when all
is true:
Field Name | Type | Description |
---|---|---|
count | number? | The number of files deleted |
{"count": 2}
PATCH Edit a file
Body (JSON)
Field Name | Type | Description |
---|---|---|
id | number? | The id of the file to edit |
favorite | boolean? | Whether to favorite or unfavorite the file |
200 Ok (JSON)
Returns a file
{"createdAt": "2022-12-01T17:41:48.887Z","expiresAt": null,"file": "jO2DMR.png","mimetype": "image/png","id": 529,"views": 0,"maxViews": null,"url": "/u/jO2DMR.png"}
Last updated: 8/5/2023
Edit this page on GitHub