0
votes

I'm working with Watson Assistant (V2). I'm configuring WA itself through the IBM front-end interface they offer, and use NodeJS to deploy it to their cloud.

I want to do the following:

  1. User visits www.mysite.com/?productID=123 which contains the chatbot

  2. The bot, upon launch, queries the URL and recognizes the productID.

  3. The recognized productID is placed in my entity @productID so I can then use it as context variable $productID (or @productID.literal).

So far I haven't been able to find a way to put the productID in the @entity. I grab the productID by calling an onload function using a regex, and can display the productID in the chatbox. However what I cannot figure out is a way to somehow store this in the @entity.

I'm familiar with html/css/json/js, but not yet with the API that Watson offers.

Any pointers are greatly appreciated. Thanks!

1

1 Answers

1
votes

When you use the V2 API for IBM Watson Assistant, then you use message to send user input to the chatbot engine. The request body has a context element with system and skill-related section. You can augment it and set app-related context variables. Use it to pass in your productID. There is no need to try to set it as entity.