Exectute cURL Webhook from Automation

If I have a webhook / cURL function (below) - how do I create a script that will run it through timed automation in Airtable?

  curl -X POST https://app.powerimporter.com/v1/api/workflows/XXXXXXXXXXXXXXXXX/XXXXXXXXX/sync

Welcome to the community, @Brian_Gotti! :smiley: Airtable’s scripting environment is based in JavaScript. To make API calls to other services requires use of the fetch command. The rough equivalent of your cURL call above would look something like this:

const options = {
  method: "POST",
  headers: {
    "Content-type": "application/json" // Omit if you're not passing JSON data in the body
  },
  body: JSON.stringify({ key: value }) // Omit if the endpoint doesn't require JSON data
}
const response = await fetch("https://app.powerimporter.com/v1/api/workflows/XXXXXXXXXXXXXXXXX/XXXXXXXXX/sync", options)
if (response.ok) {
  // The call was good. Retrieve returned JSON data like this:
  const data = await response.json()
} else {
  // Something went wrong with the API call. You can check the error like this:
  console.error(`Error ${response.status}: ${response.statusText}`)
}

Beyond that you’ll need to add code to process the returned data, along with setting up an automation to run on a schedule.