I'm trying to use IBM Watson Visual Recognition tool with nodejs (express). I followed the instruction from the guide, but I can't connect with the tool.
var fs = require('fs');
var VisualRecognitionV3 = require('watson-developer-cloud/visual-recognition/v3');
var visualRecognition = new VisualRecognitionV3({
version: '2018-03-19',
api_key: 'api key',
});
var images_file = fs.createReadStream('public/images/fruitbowl.jpg');
var classifier_ids = ["food"];
var params = {
images_file: images_file,
classifier_ids: classifier_ids
};
visualRecognition.classify(params, function(err, response) {
if (err)
console.log(err);
else
var resp = JSON.stringify(response, null, 2)
console.log(JSON.stringify(response, null, 2))
});
When I run my nodejs app, I got this message
Error: Unauthorized: Access is denied due to invalid credentials.
Does someone know the solution to this authentification problem?