ibm-cloud - url for getintent in watson assistance returns Resource not found
问题描述
Please help I am unable to consume this API service for getting Intent using the source code below,
var assistant = new watson.AssistantV1({
username: '********',
password: '******',
url:'https://gateway.watsonplatform.net/assistant/api/v1 /workspaces/{workspaceid} /message?version=2018-09-20',
version: '2018-02-16'});
assistant.getIntent({
intent: "Hello",
workspace_id: '******'}, function(err, response){
if(err){
console.error(err);
}else {
console.log(JSON.stringify(response, null, 2));
}
});
The return error message is
Error: Resource not found
code: 404,
error: 'Resource not found',
'x-global-transaction-id': 'ffea405d5c4ef5012b3fd98b'
解决方案
如果您使用的是 SDK,那么您的url
值应仅指向 API 版本。
例如:
url:'https://gateway.watsonplatform.net/assistant/api/v1'
如果仍然是相同的错误,那么您需要确保您使用的是托管 Watson Assistant 的正确端点。
此处的最新详细信息:https ://console.bluemix.net/apidocs/assistant#service-endpoint
概括:
- 达拉斯:https ://gateway.watsonplatform.net/assistant/api
- 华盛顿特区:https ://gateway-wdc.watsonplatform.net/assistant/api
- 法兰克福:https ://gateway-fra.watsonplatform.net/assistant/api
- 悉尼:https ://gateway-syd.watsonplatform.net/assistant/api
- 东京:https ://gateway-tok.watsonplatform.net/assistant/api
- 伦敦:https ://gateway-lon.watsonplatform.net/assistant/api
推荐阅读
- memory - 100 字节的内存分配失败
- python - 如何在每一行上做 value_counts 并制作一些其值是每个值的计数的列
- python - eBPF:读取 getaddrinfo 的结果
- python - 如何解决错误,“模块 umap 没有属性 UMAP”.. 我尝试安装和重新安装 umap 但对我不起作用
- python - plotly-dash 显示空白网页
- javascript - 使用 sigmajs 绘制大图
- python - mysql.connector.errors.InterfaceError: 2003: Can't connect to MySQL server on '127.0.0.1:3306' on Scrapinghub
- r - 在一个观察者中更新多个单选按钮仅适用于第一个单选按钮
- java - 水平扩展的类和数据库设计
- c++ - 读取嵌套缓冲区的可能 ComputeCPP SYCL 错误