首页 > 解决方案 > 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'

标签: ibm-cloudibm-watsonwatson-conversation

解决方案


如果您使用的是 SDK,那么您的url值应仅指向 API 版本。

例如:

url:'https://gateway.watsonplatform.net/assistant/api/v1'

如果仍然是相同的错误,那么您需要确保您使用的是托管 Watson Assistant 的正确端点。

此处的最新详细信息:https ://console.bluemix.net/apidocs/assistant#service-endpoint

概括:


推荐阅读