I'm trying npm module watson-developer-cloud for visual recognition.
I'm getting { error: 'invalid-api-key', code: 401 }
when trying to run following code:
var watson = require('watson-developer-cloud');
var fs = require('fs');
var visualRecognition = watson.visual_recognition({
version: 'v3',
api_key: process.env.API_KEY || 'e2493f2bacdbea8becedcc7aafecdfb4133XXXXX',
version_date: '2015-05-19'
});
var params = {
images_file: fs.createReadStream('./resources/gopher.png')
};
visualRecognition.classify(params, function(err, res) {
if (err)
console.log(err);
else
console.log(JSON.stringify(res, null, 2));
});