Hi there,
I am attempting to retreive some JSON data from an API so I can parse out information to a gsheet.
The aim is to get raw JSON from the GET request in “code by Zapier”.
I’ve been successful in getting the JSON via the webhooks by zapier GET zap but I need raw JSON out so I can properly parse out the sections I need.
This is the API call from a swagger page.
const options = {
method: 'GET',
headers: {
Accept: 'application/json',
Authorization: 'Bearer 059c02e83998cdeddXXXXXXXXXX'
}
};
fetch('https://api.fsomeurl.co/api/v1.0/menus/75966', options)
.then(response => console.log(response))
.catch(err => console.error(err));
Obvioulsy when I try to use this code in code by zapier I get an error
If you are doing async (with fetch library) you need to use a callback!
I am not proficcent in Javascript but I do have a template that I can apply to the raw JSON to parse the information that I require in the next code by zapier step.
Any help in forming the GET request would be greatly appreciated.
Thanks in advance