API should allow file upload/download

Steve Shipway 3 years ago updated 3 years ago 2

The API does not appear to allow attached files to be uploaded or downloaded; nor can you access or update custom fields.  This is a big problem when it comes to storing things like Certificate files when you want to have them automatically downloaded and installed by configuration management software.

The GET /read/item or /find/item API calls should return an optional additional field per item, "attachments", with an array of hashes holding file IDs and names (and maybe sizes too).

Then a separate call, GET /read/attachment/<itemid>/<fileid> could return the attached file, with the correct MIME type etc.

For writing attachments, use POST /add/attachment/<item>/<name> and include the MIME type and encoded file as the post body.

For deleting, just GET /delete/attachment/<itemid>/<fileid>

It appears this has now been done (at least, its in the documentation).  However there is no way to *delete* an attachment via the API, so if you want to update one (eg, remove the old private key and add a new one) then it seems it is not possible?