Reputation: 45
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.
Upvotes: 1
Views: 1310
Reputation: 1
Watson-developer-cloud is deprecated as of September 2020. Hence we must install ibm-watson instead and then use this code. It displays some details including the Workspace ID.
const AssistantV1 = require('ibm-watson/assistant/v1');
const { IamAuthenticator } = require('ibm-watson/auth');
const assistant = new AssistantV1({
version: '2020-04-01',
authenticator: new IamAuthenticator({
apikey: '{api_key}',
}),
serviceUrl: '{your_service_URL}',
disableSslVerification: true,
});
assistant.listWorkspaces().then(res => {
console.log(JSON.stringify(res.result, null, 2));
})
.catch(err => {
console.log(err)
});
Upvotes: 0
Reputation: 2865
Here's a link to the answer you are looking for IBm Cloud Watson Assistant: How to get the ID of a workspace
As you are using V1 of Watson Assistant service, it is Workspace ID. Effective V2 of Watson Assistant, you will be using Skills and require Skill ID.
Upvotes: 3
Reputation: 17156
There are two options on how to retrieve the workspace ID for IBM Watson Assistant.
Upvotes: 4