0

I am trying to use the Watson Visual Recognition service with the watson-developer-cloud NPM module. But I always get the following error. What am I doing wrong?

 Unauthorized: Access denied due to invalid credentials.

I already searched for hours and found many people with the same problem, but none of the answers resolved the issue.

My service authentication informations (just test data):

 {
   "apikey": "API_KEY",
   "iam_apikey_description": "...",
   "iam_apikey_name": "...",
   "iam_role_crn": "...",
   "iam_serviceid_crn": "...",
   "url": "https://gateway.watsonplatform.net/visual-recognition/api"
 }

My Node.js code to create the VisualRecognizionV3 object:

 let visualRecognition = new VisualRecognizionV3({
     api_key: "API_KEY",
     version: "2018-03-19"
 });

I will appreciate your help!

Simon O'Doherty
  • 9,259
  • 3
  • 26
  • 54
Fabian
  • 1
  • 2

1 Answers1

3

I believe you need to specify the api_key with the iam_apikey parameter name, like this: let visualRecognition = new VisualRecognizionV3({ iam_apikey: "API_KEY", version: "2018-03-19" });

See the doc here

Mike Kistler
  • 437
  • 2
  • 10
  • I thought I tried that already... But it worked when I tried "again" now. Must have made a mistake at the first time. Thank you anyway! – Fabian Aug 09 '18 at 09:27