uPste icon indicating copy to clipboard operation
uPste copied to clipboard

no API support for full CRUD

Open DanielFGray opened this issue 8 years ago • 6 comments

ideally, I'd hope the API would allow the user to

  • upload new files
  • get a list of all files
  • update files
  • delete files

currently only supports the first

DanielFGray avatar Feb 05 '17 11:02 DanielFGray

I think deleting is already supported with https://github.com/TheReverend403/uPste/issues/10

I haven't tested it though

EDIT: Nevermind, you mean fully deleting, not copying a deletion link

It would be a nice thing to have for say ShareX where you could have a context menu option for an upload with "Delete from Server and Locally" instead of having to go to the main site and delete it as well as remove the local file

camjac251 avatar Feb 05 '17 11:02 camjac251

That should be documented then.

DanielFGray avatar Feb 05 '17 11:02 DanielFGray

Example API usage:

# delete
curl -X DELETE -F key="$key" https://u.pste.pw/api

# list
curl -X GET -F key="$key" https://u.pste.pw/api

# edit
curl -X PUT -F key="$key" https://u.pste.pw/api

Although the REST verbs could be replaced with specific API endpoints. Probably needs more bike-shedding.

DanielFGray avatar Feb 05 '17 11:02 DanielFGray

tbh I'm considering doing a full rewrite with Django where the API will be a first class citizen. Maybe even a Vue SPA for the frontend.

lwatsondev avatar Feb 06 '17 12:02 lwatsondev

I love the first-class API and SPA ideas.

DanielFGray avatar Feb 06 '17 19:02 DanielFGray

If only I knew JavaScript.

lwatsondev avatar Feb 07 '17 23:02 lwatsondev