旧的Watson Conversation API(2017年4月21日版本)似乎已停止工作.给我401未经授权的错误

问题描述:

我的应用程序使用了作为maven依赖项导入的Watson Conversation API(2017年4月21日版本):

My application was using the Watson Conversation API (21st Apr 2017 version) imported as a maven dependency:

<dependency>
    <groupId>com.ibm.watson.developer_cloud</groupId>
    <artifactId>conversation</artifactId>
    <version>3.9.1</version>
</dependency>

我已经检查了凭据(用户名和密码)的正确性.但是,它仍然给我以下错误(我已经用URL中的占位符ACTUAL_WORKSPACE_ID替换了实际的对话工作区ID)

I've checked the credentials (username and password) for correctness. However, it is still giving me the following error (I've replaced the actual conversation workspace id with the placeholder ACTUAL_WORKSPACE_ID in URLs):

2020年2月12日下午6:14:40 okhttp3.internal.platform.Platform log信息:<-401未经授权https://gateway.watsonplatform.net/conversation/api/v1/workspaces/ACTUAL_WORKSPACE_ID/message?version=2017-04-21 (342ms,37字节正文)2020年2月12日,下午6:14:40 com.ibm.watson.developer_cloud.service.WatsonService processServiceCall严重:POST https://gateway.watsonplatform.net/conversation/api/v1/workspaces/ACTUAL_WORKSPACE_ID/message?version = 2017-04-21 ,状态:401,错误:未经授权线程主"中的异常com.ibm.watson.developer_cloud.service.exception.UnauthorizedException:未经授权:由于凭证无效,访问被拒绝.提示:您是否设置了端点?在com.ibm.watson.developer_cloud.service.WatsonService.processServiceCall(WatsonService.java:410)

Feb 12, 2020 6:14:40 PM okhttp3.internal.platform.Platform log INFO: <-- 401 Unauthorized https://gateway.watsonplatform.net/conversation/api/v1/workspaces/ACTUAL_WORKSPACE_ID/message?version=2017-04-21 (342ms, 37-byte body) Feb 12, 2020 6:14:40 PM com.ibm.watson.developer_cloud.service.WatsonService processServiceCall SEVERE: POST https://gateway.watsonplatform.net/conversation/api/v1/workspaces/ACTUAL_WORKSPACE_ID/message?version=2017-04-21, status: 401, error: Unauthorized Exception in thread "main" com.ibm.watson.developer_cloud.service.exception.UnauthorizedException: Unauthorized: Access is denied due to invalid credentials. Tip: Did you set the Endpoint? at com.ibm.watson.developer_cloud.service.WatsonService.processServiceCall(WatsonService.java:410)

我观察到有较新版本的API,并且IAM&资源组已在IBM Cloud中引入.这些问题是这些变化的结果吗?我们不能再使用旧的API吗?

I observed that the newer version of APIs is available and the IAM & Resource groups have been introduced in the IBM Cloud. Is this issue a result of these changes? Can we not use the older API any more?

IBM Cloud正在关闭所有尚未迁移到资源组的服务.Watson服务是受影响的第一批服务的一部分.您将需要将实例迁移到IAM,然后使用生成的IAM密钥进行身份验证.

IBM Cloud is switching off any services that have not been migrated to a resource group. The Watson services were part of the first batch affected. You will need to migrate your instance to IAM, then use the generated IAM key for authentication.