Help

Re: Is it possible to upload attachments?

Solved
Jump to Solution
5721 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Bryan_McBride
4 - Data Explorer
4 - Data Explorer

Looking over the API documentation, it appears that attachments require a url key, so they must already be available on a web server. Is it possible to upload local files to Airtable via the API? I’d like to build my own form that POSTs to Airtable and uploads an image as an attachment, but it doesn’t look like this is currently possible. Am I missing something?

Thanks!

38 Replies 38

I’ve done a ton of work with cloudinary API and used their widget. It’s very well done and works well. I’ve also pushed attachments to Airtable using the API (as a url). So I have no doubt its possible on both sides. You would just need to build it into your application. If you provide more details on your specific scenario I can give more specifics on how to approach it. Feel free to ping me at dan@openside.com

Thanks, I will shoot you an email.

I want to thank you so much Dan for suggesting cloudinary. I have got this up and running beautifully and the images are uploading to Airtable. I will be writing up a blog post with the code to help others and will post the link here for anyone who needs help.

Chinara_James
6 - Interface Innovator
6 - Interface Innovator

As promised, my write up of my solution.

Getting Started with the Airtable API | Chinara James

Airtable is an easy way to get a database up and running for a side project or to quickly prototype an idea for app. I have used it to manage track projects, expenses, client contacts and more.

Looks great Chinara, good job! You should post this to the Show & Tell forum as well.

Dan @ Openside

Ok will do. Hope they don’t mind the duplication.

Andrew_Smith
4 - Data Explorer
4 - Data Explorer

Thank you Chinara and +1 for adding this functionality to the API!!

I use Cloudinary which comes with its own set of image processing APIs. Free tier is great.

Erik_Jung
4 - Data Explorer
4 - Data Explorer

Is it possible to use a data URI for the attachment.url value when updating attachment fields? I am was hoping for something like this to work as a compromise to not being able to send the file directly:

PATCH https://api.airtable.com/v0/.../rec00000001
{
  "fields": {
    "myAttachmentField": [{
      "id": "xxxxxxxxx",
      "filename": "file.json",
      "url": "data:application/json;charset=utf-8;base64,..."
    }]
  }
}

But this yields the INVALID_ATTACHMENT_OBJECT error.

I’d like to secure this process.

Is there a specific range of server IPs from which the image will be retrieved? Are there any guarantees on timing between when I make the create record POST request to Airtable and when the image will be fetched (e.g. no more than 5 minutes)?

I’m thinking of generating S3/Cloudfront Signed URLs with a short expiration just for Airtable to fetch it.

Ideally, if you could provide us with your AWS account number, we could set up a bucket policy that only allows your AWS services to access our buckets. It shouldn’t take much work to support this on your end. Cloudinary has an example of this workflow.
https://cloudinary.com/documentation/upload_images#how_to_set_read_access_on_a_private_amazon_s3_buc...