Help

Re: The attachment link fetched using Airtable REST API doesn't work

2440 2
cancel
Showing results for 
Search instead for 
Did you mean: 
RSk
6 - Interface Innovator
6 - Interface Innovator

Hi, I am developing an MS Teams bot using Node.js and Airtable REST API, the bot fetches the information from Airtable and sends it to the MS team’s bot.
I’m facing a problem when sending the video attachments.

This is the code that I use to fetch the attachment record:

const records = await base(table_name).select({
      
        view: "Grid view",

    }).all(
    );
    
   records.forEach(async function (record) {
            files= record.get("Attachments") //Attachments is the field name
            console.log(files) 

            const reply = { type: ActivityTypes.Message };
            reply.attachments = [await getInternetAttachment(files.url)];
            turnContext.sendActivity(reply)
 })
[
  {
    id: 'attAm7ezFldMnS7uC',
    url: file_url,
    filename: 'SampleVideo_1280x720_10mb.mp4',
    size: 10498677,
    type: 'video/mp4'
  }
]

image

When I redirect to the output URL, the video doesn’t load which causes issues in sending the video files to the bot.

Is this how the attachment links work when fetched using Airtable REST API? I need to extract a working URL in order to send video attachments to the bot.

3 Replies 3

I think the bot may be expecting the video to be served as a stream, not just a file. Airtable’s CDN is a file server not a streaming video server.

Is your solution designed to just run for a few months?

Oh, I see. Thank you for explaining this.
So first need to upload the attachment to a server like AWS bucket and then extract it from that server and send it to the bot, right?

and no the bot will be running for a long time.

Uncertain. I have no idea what the target app is expecting. S3 buckets are not streaming video servers. Youtube and Vimeo are streaming video servers, and it’s very likely bot has a source expectation for videos to be served from a media server, not a file system or an object store.

Then your strategy – if you get it running – will almost certainly not be sustainable. Read this.