I was wondering if it was possible to attach a PDF file to an invoice through the API. I see that there is a documents POST request in the API documentation but I cannot seem to get it working. Every time I try I get an error 500 (Internal Server Error). My goal is for this PDF to be attached to the email sent from invoice ninja. If it is possible, any examples would be greatly appreciated.
That example helps for v5 but as you said this is not supported in a non-self-hosted environment. Can you provide a curl example for a hosted environment? I tried running the following curl command using the documentation for the hosted environment and got the internal server error:
So how do you know that this functionality is supported in v4? The curl command I just posted above is based on the only documentation you have for this for v4. I copied exactly what to send in from the documentation and it is failing with an internal server error.
Can you tell me what needs to be sent into the request exactly for v4? The curl request I am sending that is returning the error is based exactly on the documentation. Something is missing from the request. What fields need to be sent in the request to get the file to attach to the invoice?
I am sending JSON data because that is what the documentation says to send in (screenshot below). Can you please tell me what format the API is expecting the file to come in?