mirror of
https://github.com/plankanban/planka.git
synced 2026-02-25 11:21:03 +03:00
[Feature] Add a fileUpload endpoint to the REST API
#641
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @hwelch-fle on GitHub (Jan 28, 2025).
As it stands, one of the only missing pieces of the REST API is an endpoint to uploading files and getting a valid
Attachmentresponse back. If we had this, we could easily script full imports of other systems into Planka. Currently we can only exfil, but being able to migrate would be huge.Reference to Plankapy discussion that started this: https://github.com/plankanban/planka/discussions/1000#discussioncomment-11984028_
@meltyshev commented on GitHub (Jan 29, 2025):
Hi! You can upload attachment files using
POST /api/cards/:cardId/attachments.The parameters are:
If the upload is successful, the result will be:
@hwelch-fle commented on GitHub (Jan 29, 2025):
Turns out when you're using
urllibonly, doing multipart/form-data requests is a pain haha. Managed to get it working with this:So
plankapynow supports posting attachments and backgrounds!@meltyshev commented on GitHub (Jan 29, 2025):
Wow, that was fast!
@hwelch-fle commented on GitHub (Jan 29, 2025):
I'm still learning
urllib, definitely used some resources and tried to copy the structure of the request I was seeing in the browser when I did it normally. It was upset when I fed it a byte array, but using aBytesIOobject and writing one line at a time made it work@hwelch-fle commented on GitHub (Jan 29, 2025):
I think that might have been the last back-end piece for Plankapy, Now I just need to work on implementing some interface stuff and maybe a CLI. Have you had a chance to test out the latest version yet?
@meltyshev commented on GitHub (Feb 2, 2025):
I'm very busy migrating changes from v1 to v2, but I'll definitely test it afterward!