Hey @leifika!
curl is a command-line tool, and cannot be used within the Airtable scripting environment to send HTTP requests.
To send an HTTP request from the Airtable scripting environment, the Fetch API is enabled, giving you access to the global fetch() method.
There are a couple ways to format and build the request. Here's an example of just one of the ways you could format the request you displayed in your screenshot:
let requestBody = {
notifications: "THE_WEBHOOK_URL",
specification: {
options: {
filters: {
dataTypes: [
"tableData"
],
recordChangeScope: "tbltp8DGLhqbUmjK1"
}
}
}
};
let endpoint = "https://api.airtable.com/v0/MY_AIRTABLE_BASE/webhooks";
let options = {
method: "POST",
headers: {
"Authorization": `Bearer MY_AIRTABLE_TOKEN`,
"Content-Type": "application/json"
},
body: JSON.stringify(requestBody)
};
await fetch(endpoint, options)
.then(response => {
console.log(`Response:`, response);
return response.json();
})
.then(data => console.log(`Response Data:`, data))
Naturally, if you copy and paste this request straight into Airtable and attempt to run the script, it will almost certainly fail because the requestBody.specification.options.filters.recordChangeScope value is probably not a table id that exists anymore.
Nonetheless, this is something along the lines of what a request could look like.