const WebflowClient = require('webflow-api'); // Import Webflow API client async function createWebhook(req) { const accessToken = req.accessToken; // Get access token from the request const siteId = "6516ebaba028669cf36f6848"; // Replace with your actual Site ID const webflow = new WebflowClient({ accessToken }); // Initialize Webflow client try { const webhook = await webflow.webhooks.create(siteId, { triggerType: 'form_submission', // Trigger type for the webhook url: "https://n8n.srv897513.hstgr.cloud/webhook/a07ab151-3c09-4c7b-8ce6-13cbf5fdc445" // Replace with your webhook URL }); console.log('Webhook created successfully:', webhook); return webhook; } catch (error) { console.error('Error creating webhook:', error.message); } } createWebhook(req); // Moved function call outside the function definition
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vitae sed ut fringilla et nulla her molestie. Nunc, morbi ut arcu diam.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vitae sed ut fringilla et nulla her molestie. Nunc, morbi ut arcu diam.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vitae sed ut fringilla et nulla her molestie. Nunc, morbi ut arcu diam.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vitae sed ut fringilla et nulla her molestie. Nunc, morbi ut arcu diam.