Help

GET request - Error might be related to Cross-Origin Resource Sharing (CORS)

Topic Labels: Scripting extentions
2831 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Jonathan_Gaunt
4 - Data Explorer
4 - Data Explorer

I’ve been trying to query an API, it works using POSTMAN but when I try and replicate in Airtable I get an error message.

image

let response = await fetch('https://api.xavier-analytics.com/clients', {
    headers: {
        'Authorization': 'Bearer XXXXXXXXXXXXXXXXXXXXXXXXXX',
        'Content-Type': 'application/json',
        'Access-Control-Allow-Origin': '*',
    }});

console.log(await response.json);
1 Reply 1

Hi @Jonathan_Gaunt and welcome to the Community !

I recently got a lot of help by @Bill.French about CORS cases from Airtable Scripting App here:

You could search CORS in Scripting App Forum to get more.

I will end this short message by telling you that in practice, even if experimental case-by-case interventions are still possible, the best solution seems to me, still experimentally, to use a CORS-Proxy (some examples can be found on GitHub) or to rent a proxy service specially designed for Airtable such as on2air.

Best,

olπ