https://discord.gg/botpress logo
Please help me with this task using your expertise...
# 🤝help
m
I have a WhatsApp bot that handles order bookings from stores and restaurants. Therefore, I have an API link containing restaurant information in JSON format. Each object contains some information; for example, a restaurant has things like its name and a link to its menu. The challenge is that the entire restaurant list is contained within a single link, and each restaurant has its own data, such as the menu link. What I want is to create a bot that, if a customer requests a burger from a specific restaurant and specifies their order, will retrieve that information with its details according to my desired format. I've tried many methods to implement this, but I haven't been able to. (Note: I have an API key. I want the bot to retrieve the menu link when the restaurant is called, then retrieve that link to access the menu and answer the customer's queries.) The most difficult aspect I encountered was the input and output commands. I couldn't understand them and tried to have them written by an AI, but sometimes I get results, though the output is often in the form of code like
div a href
. I watched a YouTube video explaining the action, but it wasn't very detailed. i spend more than three days i was working in this. @loud-crowd-60573
w
Input and output are a variable describe by a schema. [Schema](https://www.botpress.com/docs/learn/reference/schemas) has its own variables. So instead of many input / output variables action ha one input and one output variable.
Does the menu link point to an HTML page or a JSON file?
m
json file
@white-nest-40686
w
Map json fields with your output schema's fields and then return it
m
Can you see this cod if its syntax correctlly @white-nest-40686 it working in the emulator but in other chanels not working like whatsapp < web chat etc @loud-crowd-60573 Told me that the problem id from the code https://cdn.discordapp.com/attachments/1438514257770578062/1439225958350454937/Action_card_code.txt?ex=692796df&is=6926455f&hm=0ad87ec676a0464fa038f27b46351fc6beb513f7b0447970052a240ebf18ffeb&
w
if it works in emulator it'd work on webchat, llo the log to see if tehre are errors
m
There is no any error!
l
I was seeing errors in the emulator too @mammoth-lifeguard-63559 It's AI code right? Only asking because I see emojis and it's often an indicator of chat gpt code. Those work sometimes but are often missing things to make it 100%
I wish I could help solve it but it's not my strong point! @mammoth-lifeguard-63559 hopefully during the week the community can come to the rescue!
m
I am not usimg cat gpt. I am using gemeni 2.5 i copied and paste it in chat gpt the result was while its working there appear anather problem and not knowed!
w
If there are no errors, we need to know what is not working: - The API call - The result - How the Autonomous Node uses the action result
m
The api call work when i use it with excute card even it works in action card but sometimes display errors with results and witout results. the problem it works in emulator but in kother chanels not work..
w
I'm confused. Previously, you mentioned there were no errors, but now you're indicating there are. Could you please share the error messages?