Help

Re: Using fetch to add attachments

Solved
Jump to Solution
2263 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Collin_Schwante
5 - Automation Enthusiast
5 - Automation Enthusiast

Hey All,

I'm looking for a way to add files that are not hosted on a public site. The server hosting the files allows for basic auth so I should be able to pass credentials. I'm wondering if it's possible to use `fetch` in an extension to get the file and then add the file to an attachment field. 

Definitely open to better ideas. 

Cheers,

Collin

1 Solution

Accepted Solutions
marks
Airtable Employee
Airtable Employee

Hey Colin - good idea, but I don't think this will work for you. Attachments, whether uploaded via Web API, custom extension (Blocks SDK), Scripting Extension, or Automation Run Script Action must all come from endpoints without basic or header-based authentication. Authentication that happens via URL only (such as an AWS S3 presigned URL) will work though.

See Solution in Thread

3 Replies 3
marks
Airtable Employee
Airtable Employee

Hey Colin - good idea, but I don't think this will work for you. Attachments, whether uploaded via Web API, custom extension (Blocks SDK), Scripting Extension, or Automation Run Script Action must all come from endpoints without basic or header-based authentication. Authentication that happens via URL only (such as an AWS S3 presigned URL) will work though.

Thank you! I will try this out and let you know how it goes.  

ScottWorld
18 - Pluto
18 - Pluto

For those people reading this thread who do not know how to write Javascript code, I add attachments to Airtable in a no-code/low-code way using Make's Airtable automations & integrations.

I simply upload the attachment files to Google Drive and then get a share link to pass onto Airtable from there. (But you can do this with any cloud storage service — it doesn't need to be Google Drive.)

Also, I discuss how to send multiple attachments to Airtable on this episode of the BuiltOnAir podcast.