POST /attachments¶
Create a new attachment.
Example request:
The provided Content-Type and Content-Disposition headers are stored with the attachment and returned when the attachment is retrieved.
POST /attachments HTTP/1.1
Content-Type: application/pdf
Content-Length: 5000000
Content-Disposition: attachment; filename="attachment.pdf"
Host: api.ereceipts.co.uk
... data ...
Example response:
The response contains a URL for retrieving the attachment, and the unique attachment identifier which may be used to link the attachment with a posted receipt.
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 157
Location: https://api.ereceipts.co.uk/attachments/yocuda.eabb4076-1503-4c8d-b41d-a33ccf95fcd4
{
"id": "yocuda.eabb4076-1503-4c8d-b41d-a33ccf95fcd4",
"url": "https://api.ereceipts.co.uk/attachments/yocuda.eabb4076-1503-4c8d-b41d-a33ccf95fcd4"
}
It’s also possible to link the attachment with a receipt by providing the optional ereceipts-transaction-id and ereceipts-attachment-label headers.