Hi...
I'm wondering if there is a way to fetch a remote API using script but passing "Header" parameters accoding to the suggested documentation:
https://docs.typebot.io/editor/blocks/logic/script ->
// β
This works
const response = await fetch('
https://jsonplaceholder.typicode.com/todos/1')
const data = JSON.parse(response)
...
I'm trying this approach but it fails at some point:
myHeaders.append("api_access_token", "ASDADSADADSASDASDASDASD");
let requestOptions = {
method: "GET",
headers: myHeaders,
redirect: "follow"
};
let response = await fetch("https://url", requestOptions);
let data = JSON.parse(response)
return (data);
Any sugestion?