How to add dynamic content to API Requests

Hello, I would like to know more about the use of the function API Request. This seems very powerful, and might be the perfect solution for a use case I cant solve.

Basically, some of my users wants to use the bot to make orders or to check prices. I thought I could use the “Google Sheet” content for structured data, but it often makes mistakes and mixes prices and information.

I would like to use the API function, to send an API request to a system that will programmatically retrieve the information and pass it to the agent. My questions are:

  1. How can I make the body of the API request to dynamically send information based on the conversation? For example, if the function triggers when the user asks prices, I would like to send the previous messages of the users in the body of the API request, as then I will process it to parse the product and request
  2. How can I then feed the agent with the response from the API request?
  3. Is there another way to achieve my use case, or would this work at all?

Thank you, Juan

Hi all, bumping this up

Hi Jotasang,

We’re currently working on this and want to ensure it’s done properly, as these features are becoming quite complex.

Our solution so far is to hook an AI form whose answers can be used as part of the API body.

However, this would require the agent to ask the necessary questions before making the API request.

Does this approach work for you?

I think it might work as long as the response from the user can be parsed (ideally with AI) or the form only allows specific values, like dropdowns.

hi @Fatos just wanted to know if this has been actualized. Thank you