Oct 14, 2021 04:54 PM
Fetch request is built like this, including these headers:
But it returns a CORS error — the webhook isn’t returning Access Control Allow Headers…
Oddly enough I can get it to work from Postman:
And if I follow the proxy outlined here it works as well.
Is there a way to make the webhook return that header? Or another solution? Thanks!
Solved! Go to Solution.
Oct 21, 2021 09:16 AM
Thanks for the details.
Erin from the community team reached out to confirm that the incoming webhook trigger doesn’t currently support CORS. The reason it works on Zapier / Postman is because they execute the requests from their servers, rather than the browser.
For now I’m just going to keep it simple and use Zapier rather than abandoning CORS, and hope Airtable Webhooks support CORS at some point in the near future.
Oct 19, 2021 07:29 AM
For more context, I tested it out with Zapier Webhook and it passed when I removed all the headers from the fetch options:
const fetchOptions = {
method: 'POST',
body: formDataJsonString,
};
but this same header-less payload still returns a CORS error with Airtable’s Webhook.
Oct 19, 2021 01:42 PM
Users don’t currently have any control over how Airtable’s webhook automation trigger responds to requests (and I doubt that we ever will). I recommend reaching out to Airtable support directly (in the app: Help → Contact support). While Airtable staffers do frequent the forum, they prefer to be approached directly with support requests, and this leans pretty heavily in that direction IMO.
That aside, have you tried the “no-cors” mode that was recommended in the error message you received (seen in your screenshot)? I’ve only called Airtable webhooks from within other Airtable scripts, so I haven’t needed to test this workaround and therefore don’t know how exactly it should be applied, but it’s probably worth investigating.
Oct 21, 2021 09:16 AM
Thanks for the details.
Erin from the community team reached out to confirm that the incoming webhook trigger doesn’t currently support CORS. The reason it works on Zapier / Postman is because they execute the requests from their servers, rather than the browser.
For now I’m just going to keep it simple and use Zapier rather than abandoning CORS, and hope Airtable Webhooks support CORS at some point in the near future.