How can I create an action that calls an API?

I am not even sure if this is the best way, but I ask the user a sequence of questions and then I save that to variables and want to submit it to an api. I have tried using fetch() or xmlhttprequest() but I always get: “ReferenceError: <fetch/xmlhttprequest> is not defined” so I assume I need to require it first? But I don’t know if it’s even there. I looked at: botpress/package.json at master · botpress/botpress · GitHub and seems to not be available? So I’m unsure what to do.

As to why I’m not just using the “API” node it’s because I want to send variables and I’m not sure it would work if I do:

"username": "{{session.username}}",
  "birthplace": "{{session.birthplace}}",

becuase, as a matter of fact, I get an error but no idea what it is since I don’t know how to debug that call.


By default, Botpress supports Axios. What version are you using?