Fetch calls work in Automations & Postman, but not in Scripting apps

Title says the root of the problem. I’m thinking this is because CORS, but I’ve had no luck with fetch or the newly introduced remoteFetchAsync.

Finding the same thing with two different APIs:

  • Creating a customer in Stripe (this one works in automation)
  • Creating clients in Toggl

The more frustrating issue I’m running into is that there’s no error message or anything I can find in the stack using debugger; - the script exists and there’s simply no output.

Could this be because Airtable scripts don’t support “redirect: follow”?
If so, is the best workaround to dump all the logic into a cloud function like Google Apps Scripts, Netlify Functions, Code by Zapier, etc?

Yes, this is probably the issue you are hitting.

That’s what I typically do, but Autocode is a good route as well.

1 Like

@Bill.French thank you! You led me to the solution:

  1. The Stripe API does work within an Airtable Script - I was missing an await before my remoteFetchAsync call, which was causing the empty output.

  2. The Toggl API does not work within an Airtable Script, probably because of the redirect: follow method. When I added the await, the fetch returned a 400: Bad Request, which I’ll assume is because of the redirect:follow because:

  3. The Toggl API call worked perfectly from within an Autocode endpoint that took me about 15 minutes to set-up. Thanks for the referral :crown:

2 Likes

Excellent - this [Autocode] integration platform is firing on most of the cylinders and checking almost all of the boxes now. And they have a pretty nice free tier, so that’s especially helpful for prototyping solutions.

1 Like