Access A Web Request-Triggered Workflow From The Frontend
This example showcases a workflow triggered by a web request that can be called from your site’s frontend using JavaScript. While it doesn’t perform any specific actions, it handles the request and outputs a JSON response: { "status": "ok" }
. This basic setup provides a foundation for more complex interactions, enabling you to build custom functionalities that seamlessly integrate with your site’s frontend.
Topics:
Watch the demo
Preview workflow steps
Free download
This free workflow template if yours to personalize. Simply import the ZIP file to MESA then connect the app steps to your credentials. Test, then, turn it on!
Sample code
And here’s an example fetch call to hit that web request:
Here’s the code for reference if you want to copy and paste it:
const url = 'https://webhooks.getmesa.com/v1/kalen-jordan-dev/webrequest/659eefddb45c7806d94b118b/659eefe081e0244a5705500d.json?apikey=pobbFlA9BN73tE4gkbUsb5DLnZnwfIKi8g8UtM7U';
// Use fetch to get the data
fetch(url)
.then(response => {
// Check if the response is OK (status code 200-299)
if (!response.ok) {
throw new Error('Network response was not ok ' + response.statusText);
}
return response.json(); // Parse JSON from the response
})
.then(data => {
console.log(data); // Output the JSON data
})
.catch(error => {
console.error('There was a problem with the fetch operation: ', error);
});
Questions about this workflow? Contact our partner:
Kalen Jordan
MESA Service Partner