Dec 18, 2024 06:15 AM - edited Dec 18, 2024 06:29 AM
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.
Thanks much.
Dec 18, 2024 06:37 PM
The 'uploadAttachment' API expects the actual file, not a URL to the file I'm afraid; the documentation mentions that it's done via the file bytes directly
As such, you're going to need to retrieve the image first, convert that, and then use that endpoint
As an alternative, you could also try retrieving the record first, append the new file, then do a PATCH?
Dec 18, 2024 09:12 PM - edited Dec 18, 2024 09:13 PM
You can use public URLs to upload attachments to a record, but you need to do it through the update record API call (or new record call).
Airtable’s new API documentation is extremely confusing, so I would recommend looking at Airtable’s old API documentation, which is PERSONALLY CUSTOMIZED FOR YOUR BASES!
Go to this page, scroll down, choose your base, and the API documentation’s CURL code will be customized for your bases & fields: https://airtable.com/developers/web/api/introduction
- ScottWorld, Expert Airtable Consultant
Dec 18, 2024 10:36 PM
@ScottWorld Hmm, you mentioned Airtable's 'new' API documentation being confusing and recommended the old ones. What's new about them?
Do you have a link or something specific I can check out? As far as I can tell, nothing's changed!
Dec 19, 2024 04:24 AM - edited Dec 19, 2024 04:25 AM
I just gave you the instructions above on how to access the old documentation.
And yes, the documentation went through a major overhaul a few years ago, which everybody has found incredibly confusing, particularly compared to the clarity and personalization of the old documentation.
- ScottWorld, Expert Airtable Consultant
Dec 19, 2024 05:40 AM
I was able to update the attachment field using the information that @ScottWorld provided. @TheTimeSavingCo I'd still like to try to use the UPLOADATTACHMENT option but I don't know what you mean by "via the FILE BYTES directly" reference? I'm hoping this option does not require putting my files on a publicly accessible URL site just to import them. Thanks for your help.