-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
External API Not Working for v11 #556
Comments
@clarence-d I went ahead and tried it out successfully using hooks & a quote of the day api. const axios = require('axios')
axios.get("https://quotes.rest/qod").then(res => {
console.log("hello after incoming quote ***** \n", res.data.contents.quotes[0].quote, "\n ********")
}) here's my debugging output
Please can you point out what misled you in the docs so we can fix it. |
@EFF I started out by doing the same thing as 'incrementNumberOfConversations' (it works) and modified it using the code from this doc https://botpress.io/docs/recipes/apis/#docsNav. I just modified it to return e.message from catch and after running this, I got the "axios is not defined" error. Then I tried referring to this doc https://botpress.io/docs/modules/api-endpoint/. This time, I got "Cannot read property 'get' of undefined". I have the same issue as these posts where I tried all of the solutions in the replies but still no luck. Right now, my code is simply like this (I get "Cannot read property 'get' of undefined")/**
const testEndpointCall = async output => { //const axiosConfig = bp.http.getAxiosConfigForBot('welcome') } catch (e) { return testEndpointCall(args.output); I tried using the code you provided. (I get Module "axios" not found. Tried these locations: "C:\Users\clarence\Downloads\botpress-ce-v1130-win-x64\modules.cache\moduledcfd05cb591d813753b1acb3746659b8dfedb8da3e4d934ad476e28886e07e06, C:\Users\clarence\Downloads\botpress-ce-v1130-win-x64\data\global\actions\builtin")/**
const testEndpointCall = async output => { try {
} catch (e) { }; return testEndpointCall(args.output); Thanks for the reply |
Will wait for the nightly build and check this. As of now, there is only the build until Dec. 24th 2018. |
@clarence-d fixed with our next release 11.4. Another step towards 11.x stability. |
Make sure these checkboxes are checked before raising an issue, thank you!
8.9
Please also fill in these fields:
Botpress version: 11
Channels: <>
I have installed botpress using the installer for v11, calling an external api did not work when the sample codes from documentation is used.
The error I got is 'axios is not defined'. I tried the import and the require() methods but it does not solve the issue. Does anyone have a simple example code because I can't find one. The one in the documentation seems incomplete.
My target is to simply call an api from a webservice (it is a simple GET, no parameters needed) and push that value out as a reply from the chatbot.
The text was updated successfully, but these errors were encountered: