Search code examples
node.jsibm-cloudwatson-assistantwatson-assistant-solutions

How to passg customer token into IBM Watson Assistant


I want to use various fields such as customer token, customer id etc. in each session created in watson assistant v2 using nodejs.

Can I pass it directly in the createSession function or do I need to create an entitiy or intent for it to pass in Watson Assistant?


Solution

  • You need to pass it with the message where you want to use it. See the context parameter in that message API function. This could be the first message. The context usually stays unchanged until you overwrite the values or delete the context variable.