Accessing API data
Hi community!
I would like to ask question related to handling API data. How to target and use data coming from API call?
const url =
https://rinki-api.vercel.app/api/points?municipality=Enontekiö;
const data = await fetch(url, { parse: true });
const firstWhatever = data[0];
const type = typeof firstWhatever;
return {
trace: [
{
type: "text",
payload: {
message: Testing API for "${data}" and "${firstWhatever}"
}
}
]
};
Result is:
"Testing API for "[object Object]" and "undefined""1 Reply
Is this in a function?
Parse: true does nothing. do: