Need help with API call
# 🤝help
b
I am following along with the recipe botpress tutorial and trying to call the spoonacular api and not getting a response some one please help.

https://cdn.discordapp.com/attachments/1129267659079434280/1129267659234615366/image.png

f
Hi sorry didn’t see this before!
What issue do you see in the logs?
I am thinking it might be a type error
b
this is the error errorError executing action "inline-ins-bd1c160a61.js" in flow:Main:node:call-API [SyntaxError, Unexpected token 'const']
f
Can you copy your code here please
b
(async () => { const url = 'https://api.spoonacular.com/recipes/complexsearch', const params = { query: workflow.baseQuery, diet: workflow.dietType, apikey: env.apikey, number: '3', ignorepantry: 'false', sort: 'popularity', sortDirection: 'asc', addRecipeInformation: 'true', addNutritionInformation: 'false', } const response = await axios.get(url, {params}), if (response.status === 200) { workflow.recipeInfo = response.data.results, }
f
You have an extra comma after the link
(async () => { const url = 'https://api.spoonacular.com/recipes/complexsearch' const params = { query: workflow.baseQuery, diet: workflow.dietType, apikey: env.apikey, number: '3', ignorepantry: 'false', sort: 'popularity', sortDirection: 'asc', addRecipeInformation: 'true', addNutritionInformation: 'false', } const response = await axios.get(url, {params}), if (response.status === 200) { workflow.recipeInfo = response.data.results, }
Try this
b
OK
Still no response I even tried removing the commas in ignorepantry., addRecipeInformation: 'true', addNutritionInformation: 'false to make them boolean as the spoonacular doc suggest also when i hover over the env.apiKey it says the apiKey can't be found in the configVariables and it was in it befor I copy and paste the new code all so in the emulator section when i hover over the error meassage it says there is a syntax error unidentifiable token 'if'
Hey greatefull for your help could use your help just started a few days I am fast learner I get the basics but seem to be having trouble with the API call in all the tutorials I am getting along just fine except when its the manual integration part I have a little coding knowledge but it just don't seem to be working when you have time please just help me with that and i should be able to progress fast,Thanks.