Comments (8)
it really was, thank you so much! I'll close the issue!
from node-sdk-core.
You need to allow for 2 requests.
- First goes to https://iam.cloud.ibm.com/identity/token and retrieves an access_token (this is where you app is failing)
- Second goes to https://gateway.watsonplatform.net/conversation/api
Both are https
. In your error, I see https://https://...
which should not be there.
Can you paste the code you are using to construct the service instance?
from node-sdk-core.
sure! Here it is :
const { WatsonMiddleware } = require('botkit-middleware-watson');
const watsonMiddleware = new WatsonMiddleware({
iam_apikey: process.env.WATSON_APIKEY,
url: process.env.WATSON_URL,
workspace_id: process.env.WATSON_WORKSPACE_ID,
version: '2018-07-10',
minimum_confidence: 0.5, // (Optional) Default is 0.75
});
watsonMiddleware.before = async (message, payload) => {
if (typeof(payload.context) === 'undefined') {
var context = {
context: {
user_id: userId.user_id,
name:userId.name,
prev_interview: '',
prev_interview_detail: '',
age: '',
place: '',
civil_state: '',
prev_studies: '',
time_availability: '',
}
};
Object.assign(payload, context);
}
return payload;
};
contents of the .env file
WATSON_APIKEY=apikey goes gere
WATSON_URL=https://gateway-lon.watsonplatform.net/assistant/api
WATSON_WORKSPACE_ID=workspace id goes here
from node-sdk-core.
Update: I changed it so now the https part is not repeated, but still get the same error. I am guessing it's because it can't be reached from the server, but I'm not sure. I can ping from my computer just fine.
from node-sdk-core.
based on your images, the error is in the token request to IAM, not in the call to Watson. Try following the tutorial here https://cloud.ibm.com/docs/iam?topic=iam-iamtoken_from_apikey and see if you can do a curl
command and get a token back
from node-sdk-core.
Hello there! I followed the tutorial and got the exact same results as the expected answers:
{"access_token":"long string",
"refresh_token":"long string",
"token_type":"Bearer",
expires_in":3600,
"expiration":1574269358,
"scope":"ibm...
but it is still not working. Never once with botkit I had to send a curl btw. It just works once I execute the command npm start on my local machine
.
from node-sdk-core.
I tried changing the proxy settings of watsonmiddleware, but I get this as currenturl
_currentUrl: 'https://host:port/https://iam.cloud.ibm.com/identity/token'
is this okay? how should I change it?
from node-sdk-core.
@juanpablo64 Have you tried this method described in the docs? It seems like your issue is with the proxy, this may be what you need to fix it
from node-sdk-core.
Related Issues (20)
- Bug in DEBUG ? HOT 5
- Latest version creates runtime error when bundled: `Class constructor BaseService cannot be invoked without 'new'` HOT 10
- Update axios version to 0.25.0 HOT 2
- Typescript Compilation: Cannot find name 'File' HOT 1
- hit UnhandledPromiseRejectionWarning when using this module with `https://github.com/IBM/cloudant-node-sdk` HOT 10
- Error: EISDIR: illegal operation on a directory HOT 2
- CVE-2022-36313 found in file-type HOT 3
- upgrade axios-cookiejar-support to support axios 1.0 HOT 11
- high severity in jsonwebtoken <=8.5.1 HOT 4
- ibm-cloud-sdk-core is now 4.0.0 which includes major upgrade of axios HOT 2
- Error after 4.0.1 release -JsonWebTokenError: secret or public key must be provided HOT 5
- VpcInstanceAuthenticator uses wrong version, no option to change it HOT 5
- Vulnerability: ibm-cloud-sdk-core is using a vulnerable version of jsonwebtoken HOT 1
- CVE-2022-25883 on the semver module used in the package HOT 3
- CVE-2023-45857 on the axios module used in the package HOT 6
- CIEBot applications failed to start with 'ERR_PACKAGE_PATH_NOT_EXPORTED' after upgrade to node-sdk-core to v4.1.4 HOT 2
- Missing @types/debug into package.json (devDependencies) HOT 2
- Package Vulnerability: axios HOT 10
- Fix CVE-2023-26159 updating to axios v1.6.4 HOT 2
- move some dependencies to devdependencies HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-sdk-core.