Watson视觉识别-未经授权 [英] Watson Visual Recognition - Unauthorized

查看:138
本文介绍了Watson视觉识别-未经授权的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将Watson Visual Recognition服务与watson-developer-cloud NPM模块一起使用.但是我总是收到以下错误.我在做什么错了?

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"
 }

我的Node.js代码创建VisualRecognizionV3对象:

My Node.js code to create the VisualRecognizionV3 object:

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

感谢您的帮助!

推荐答案

我相信您需要使用iam_apikey参数名称指定api_key,如下所示: let visualRecognition = new VisualRecognizionV3({ iam_apikey: "API_KEY", version: "2018-03-19" });

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" });

此处中查看文档>

这篇关于Watson视觉识别-未经授权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆