Pierre 10/30/2024 9:37:22 AM Slava proposed me a workaround which addresses the question efficiently. I quote the master for the benefit of us all: { For the webhook redirection, as a workaround, you can create an HTML page in the database resources with a script that: 1. Calls the webhook. 2. Redirects the user to the desired page or displays a custom message. }
I asked an AI to generate me the html code that would do it
Et voilà
<!DOCTYPE html> <html lang="fr"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Confirmation Dépense</title> </head> <body> <script> // Function to get URL parameters function getUrlParameter(name) { const urlParams = new URLSearchParams(window.location.search); return urlParams.get(name); }
// Retrieve parameters const type = getUrlParameter('type'); const mail = getUrlParameter('mail'); const record = getUrlParameter('record'); const confirm = getUrlParameter('confirm');
// Construct data for the POST request const data = { type: type, mail: mail, record: record, confirm: confirm };
// Send the POST request to the webhook fetch("https://WEBHOOKURL", { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(data) }) .then(response => { if (response.ok) { // Redirect to the confirmation page window.location.href = "https://REDIRECTIONURL/"; } else { console.error("Error calling the webhook"); } }) .catch(error => console.error("Network error:", error)); </script> </body> </html>
|