Second method I tried using 'axios' ---start of code---- const axios = require("axios"); // Function to generate a unique userID function generateUserID() { return 'user-' + Math.random().toString(36).substr(2, 9); } // Replace 'Your-Voiceflow-API-Key' with your actual Voiceflow API key const voiceflowAPIKey = 'YOUR_API_KEY_HERE'; // it should look like this: VF.DM.XXXXXXX.XXXXXX... keep this a secret! // Replace 'Your-Voiceflow-Version-ID' with your actual Voiceflow version ID const versionID = 'YOUR_VERSION_ID_HERE'; // e.g., 'production' // Function to start the survey async function startSurvey() { const userID = generateUserID(); const voiceflowAPIEndpoint = `https://general-runtime.voiceflow.com/state/user/${userID}/interact`; const body = { "request": { "type": "text", "payload": "Welcome to My AI Beauty Advisor's Survey!" }, "versionID": versionID }; const options = { method: 'POST', url: voiceflowAPIEndpoint, headers: { 'Authorization': `Bearer ${voiceflowAPIKey}`, 'Content-Type': 'application/json' }, data: body }; try { const response = await axios(options); const data = response.data; if (response.status === 200) { return JSON.stringify(data); // If the call was successful } else { console.error('Voiceflow API Error:', data); // Log detailed error return JSON.stringify({ error: data, userID: userID }); } } catch (error) { console.error('Error connecting to Voiceflow:', error); return JSON.stringify({ error: 'Failed to connect to Voiceflow.', userID: userID }); } } startSurvey().then(console.log).catch(console.error); ------end of code---------