How to get and store output from a script block?
Hi, I have this botpress listenConversation script entered into a script block.
How do I store and view the output of it please?
============
const url = 'https://chat.botpress.cloud/xxxxx/conversations/{id}/listen';
const options = {method: 'GET', headers: {'x-user-key': '<x-user-key>'}, body: undefined};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
============
1 Reply
Won't work like this
see: https://docs.typebot.io/editor/blocks/logic/script#limitations-on-scripts-executed-on-server
There's a block specifically for HTTP requests, use this instead 🙂
https://docs.typebot.io/editor/blocks/integrations/http-request#http-request