I’m having issues uploading documents to be attached to an invoice since migrating to v5 self-hosted. I followed the format from Build, Collaborate & Integrate APIs | SwaggerHub so the request looks like this:
/usr/bin/curl -v -X 'PUT' \
'https://domain.net/inv/public/api/v1/invoices/QK9b6NlbEv/upload?include=clients%2Cinvoices' \
-H 'X-Api-Secret: MY_API_SECRET' \
-H 'X-Api-Token: MY_API_TOKEN' \
-H 'X-Requested-With: XMLHttpRequest' \
-F 'file=./Summary-2022-3157.pdf'
The server responds with code 200 and outputs the correct invoice, but the file does not attach to the invoice.
I have tried changing “file=” to “document=” and “documents=” to no avail. What am I missing?
I have also tried swapping -F for -d like this:
/usr/bin/curl -v -X 'PUT' \
'https://domain.net/inv/public/api/v1/invoices/QK9b6NlbEv/upload?include=clients%2Cinvoices' \
-H 'X-Api-Secret: MY_API_SECRET' \
-H 'X-Api-Token: MY_API_TOKEN' \
-H 'X-Requested-With: XMLHttpRequest' \
-d ./Summary-2022-3157.pdf