How to call api by passing chat text in 10.2 versions

Hi, I’m using botpress 10.2. and trying to call api by passing chat text from user to api .please help me how to call api in botpress 10. + version

i recommended to user new version
there i are new skill call api easy to use

i didn’t find doc for version 10.2
but i think you can do
u get the var from user memory.var
like {{}}

const axios = require(‘axios’)
URL = “http://api.xxxxxxxxxxxxxxx/”

.then(({data}) => {
data = JSON.parse(JSON.stringify(data).replace(“place name” , “placename”));
user.placename = data.places[0].placename;

to return ui {{user.placename}}

Hi @ABHI_INIT, here’s a sample action to send the user’s message to an api:

async function action(bp: typeof sdk, event: sdk.IO.IncomingEvent, args: any, { user, temp, session } = event.state) {
  /** Your code starts below */

  const axios = require('axios')
   * Small description of your action
   * @title The title displayed in the flow editor
   * @category Custom
  const myAction = async (name, value) => {
    // List all event fields so you can see the variable you need

    // The user message is available here:
    const userMessage = event.preview

    // Then a post request to your API with the user's message
    const { data } = await'http://someurl/message', { userMessage })
    console.log('API Result', data)

  return myAction(, args.value)

  /** Your code ends here */