0
votes

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));
});
1
This looks like a duplicate of this question: stackoverflow.com/questions/37927516/…joe

1 Answers

0
votes

This is the same problem raised in IBM Watson visual recognition - invalid API key. The Visual Recognition service was experiencing problems recognizing keys; the development team has resolved the issues as of July 14. (There is additional discussion of this issue on the IBM developerWorks Answers forum, and for issues with specific keys, you can open a Bluemix support ticket.