How do we make an API call to an external API in the script automation of airtable?

I am trying to call an external API endpoint using the script in the automation functionality of airtable but the following code gives me an error.
var xhr = new XMLHttpRequest();

Nvm I think fetch works perfectly fine.

1 Like