node.jsibm-cloudibm-watsonwatson-conversation

Where can I get "workspace_id" parameter for Watson-Assistant?


I am currently new to IBM Watson (Watson Assistant) and I can't figure it out. Where can it be found?

code:

var watson = require('watson-developer-cloud');

var assistant = new watson.AssistantV1({
  iam_apikey: '{apikey}',
  version: '2018-09-20',
  url: '{url}'
});

assistant.message({   
  workspace_id: '{workspace_id}', //  <-- THIS, where can i get the right parameter.   
  input: {'text': 'Hello'}
},  function(err, response) {
  if (err)
    console.log('error:', err);
  else
    console.log(JSON.stringify(response, null, 2));

Thanks.


Solution

  • There are two options on how to retrieve the workspace ID for IBM Watson Assistant.

    1. In the browser-based tool click on Skills, then on the three dot menu. There, click on API details. It will list the Skill name and ID, the Workspace ID and some more information.
    2. In your program which uses the Assistant V1 API, there is a listWorkspaces function. It retrieves information about the workspaces in your instance of Watson Assistant.