"How to call an API (3/10)" video
# 🤝help
f
I don't get the recipe response at the end and wondering if there are any tips to follow to get it to work.. I believe I inserted the same prompt and put all the correct info in there and still can't get it right... hoping I can move forward with this
a
HI. You have an payload example to start a conversation to send with API ?
f
What do you mean by 'payload example'?
a
Yes
To start a conversation by API

https://cdn.discordapp.com/attachments/1130574982733369345/1130580343301357768/image.png

I try many combinations.... but not work
f
I wish i had a better understanding of coding... I literally did everything step by step in that video and didn't get the answer at the end.. I put the API key in the config settings.. named the API and had that included correctly in the prompt...
So I can say Hi to the Bot... it'll ask how many people to feed... i give it a number... then asked the diet.. i select the diet.. it asks for the recipe and I get this: numPeople: 3 the diet is: No restrictions recipe info: JSON.stringfy(workflow.recipeInfo)
a
Then. I managed to use the API. She answers straight. You didn't get any answers? In any method?
f
This is the answer I get: numPeople: 3 the diet is: No restrictions recipe info: JSON.stringfy(workflow.recipeInfo)
Something along those lines depending on the diet and amount of people I insert
a
Are you using BotPress for the right website? Or via API?
f
Using the spoonacular API key
make a GET request to https://api.spoonacular.com/recipes/complexSearch with the following URL parameters: query:workflow.baseQuery, diet: workflow.dietType, apiKey:myAPIkey, number: '3', ignorePantry: 'false', sort: 'popularity', sortDirection: 'asc', addRecipeInformation: 'true', addRecipeNutrition: 'false'. If response.status is 200, save the response.data.results to workflow.RecipeInfo <--- this was the prompt that was used in the video that I pasted in and it created code for it
a
I Use this instructions...https://botpress.com/docs/api-documentation/#introduction But not work for me... 😦
f
Ah doesnt work for you eh?
Appreciate all the help @acceptable-thailand-42606 hopefully someone else can shed some light on this for us
a

https://cdn.discordapp.com/attachments/1130574982733369345/1130587470279479346/image.png

https://cdn.discordapp.com/attachments/1130574982733369345/1130587908441636985/image.png

f
Did this work?
Any non technical advice would be great too
If anyone has any advice relating to this video please lmk, eager to go to the 4th video!

https://www.youtube.com/watch?v=cP9mWwC7rLE&list=PLlJHGGklthGnOzptoN_WV35UibNmZLMRE&index=4

h
So, I didn't use the spoonacular api, but a different one that used post rather than get. I spent the weeknd frustrated that my coding skills weren't good enough until I decided to go to chat gpt and ask it. I gave the api url in the prompt and explained I want to connect but the following code is failing and gave the reason why... it spit out code that got me past my first issue. I still had an issue so I did it again and explained the new issue and viola! It worked! Just thought I'd share that since you said something about your codeing skills (like mine) being sub par.
a
Yes. I'm new with APIs. But, I still can't start a new conversation through the API. The methods described in the HELPs, none of them work. I wanted a working example of how to start a conversation through the API. Create the BOT I understand and it's done. Accessing API with BOT is also working. But I just wanted to start the conversation via API. Via the Web, everything works fine. But via API, I'm not getting it.
15 Views