Retreive Attachments via API
Problem reported by Nick _ 2 weeks ago
Hello,
We're using the API to add attachments to purchase and invoice documents. This works fine. We can also list existing attached files back.
We're struggling to download a previously attached file.
https://api.clearbooks.co.uk/v1/accounting/purchases/{purchaseType}/{purchaseId}/attachments will return a JSON array of attachments for a particular purchaseID.
https://api.clearbooks.co.uk/v1/accounting/purchases/{purchaseType}/{purchaseId}/attachments/{attachmentId} returns a single element of that same array. It feels like this end point should return the binary file instead?
OR: Is there a standard URI we can plumb the filename in to to get the file back? The CDN URI looks formulaic: https://files.clearbookscdn.uk/{businessID}/attachments/scans/{randomFilename.ext} So it would just be the {randomFilename.ext} key that's needed to be returned via one of the end points to connect this up.
many thanks,

