I try to upload an attachment to a deck card after creating the card via API and curl.
The creation of the card works fine, but then adding the attachment does not work properly. I already found out, that the Content-Type-Header should not be set (according to the manual every call should be set to Content-Type: application/json but that seems wrong here). When I tried to put the file content and the type into a json, also the file is not handled at all.
My curl task:
/usr/bin/curl -u ‘user:pass’ -X POST -H “OCS-APIRequest: true” -H “Accept: application/json” -d ‘type=audio/mpeg’ -d ‘file=@/Users/heiko/Desktop/Interim/nickmsg_257114_f4310d25-ea53-45e6-84b9-52e4fff2826c.mp3’ ‘https://nc.xyz.de/index.php/apps/deck/api/v1.0/boards/3/stacks/7/cards/13/attachments’
The result:
{“id”:null,“cardId”:13,“type”:“audio\/mpeg”,“data”:null,“lastModified”:1701065755,“createdAt”:1701065755,“createdBy”:“admin”,“deletedAt”:0,“extendedData”:}
So as it seems the server accepts the call but does not handle the file?!
Can anybody see what is wrong in the curl task and teach me how to do it right?
Or is something wrong with any setting, since the attachments are nc-files now and not dock files anymore?
Appreciate your help, thank you!