I would like to “Update” existing Bank Transaction Explanations via the API and add attachments to them.
Unfortunately, although I can work out what the attachment data needs to look like, ie:
“file_name”: “2017-06-08 7.50.pdf”,
“data”: “JVBERi0xLjMKJcT —— (lots and lots more in here) —— IF0gPj4Kc3RhcnR4cmVmCjQwMjE2MwolJUVPRgo=”,
“description”: “(auto upload)”,
If I try and run an update on the bank_transaction_explanation object i get a 400 bad request response.
My current thinking is to take the JSON from the existing “bank_transaction_explanation” object and PUT the whole thing back to the API with the attachment object now in it. That didn’t work. So I then tried just doing a PUT with the transaction ID and the attachment object only (assuming it only wanted the fields that I wanted to update), but that didn’t work either (same response 400 error).
I stumbled across this topic - How to upload attachments for explanations? - #3 by Cberridge - but it’s akin to an old xKCD cartoon - “What did you see Cberridge?!?! What did you see?!”. He seems like he was trying to do the same thing as me, then somehow worked it out but didn’t explain how, what, why.
If someone could give me an example PUT request to update a bank_transaction_explanation which adds an attachment, that would be great - preferably with dummy data. Would be great if the documentation was then also updated with this info for anyone in the future.