I want to add images to an attachment field in an Airtable. I've read all of the documentation and Community comments but can't seem to find an answer to my problem.
- I have a publicly accessible link to the image
- I can call https://api.airtable.com/v0/{baseID}/{tableID}/{recordID} and add an image fine, however, I want to make multiple other calls adding new versions of the image and this call overwrites what is already there but I want to keep the previously uploaded files. (I understand this is an Update call and that logic makes sense.)
- Therefore, I believe I should call https://content.airtable.com/v0/{baseID}/{recordID}/{fieldID}/uploadAttachment passing in a similarly formatted JSON object, however, I cannot get that to work. I get something added to the attachment field, however, it is just 1K gibberish file.
- Here is a copy of what I'm calling:
curl --location 'https://content.airtable.com/v0/{baseID}/{recordID}/{fieldID}/uploadAttachment' \--header 'Authorization: Bearer {accessToken}' \--header 'Content-Type: application/json' \--header 'Cookie: {cookie stuff}' \--data '{"contentType": "image/png","file": "{publicly accessible URL to image}","filename": "Content_Hub_Portraitv2.png"}' - Any help would be appreciated.
Thanks much.