Integrate Chat Bot with ServiceNow Chat

david_hreben
Giga Expert

Hello,

I am trying to connect a chat bot with ServiceNow chat. Actually "botkit", and I want to know how customizable is the chat plugin from SN? The idea is to connect to Watson and based on the criteria, create tickets in SN. Any info would be appreciated.

1 ACCEPTED SOLUTION

anthony_arobone
ServiceNow Employee
ServiceNow Employee

Hi David,



ServiceNow released a technical whitepaper explaining how to integrate with IBM Watson's Conversation Service here: ServiceNow Integration with IBM Watson Conversation Service Whitepaper



Please have a look at that to start.   The doc applies to pre-Kingston for those that want to get started now. That should answer all of your questions, but if you do have follow up questions I'd be happy to address them.



Also, with the launch of the Kingston release we will also be sharing some code on the Share site (share.servicenow.com) to jump start a Watson chatbot as well, but that will only work with Kingston as some changes to Connect are needed. Check that site periodically, it should be coming soon.


View solution in original post

12 REPLIES 12

anthony_arobone
ServiceNow Employee
ServiceNow Employee

Hi David,



ServiceNow released a technical whitepaper explaining how to integrate with IBM Watson's Conversation Service here: ServiceNow Integration with IBM Watson Conversation Service Whitepaper



Please have a look at that to start.   The doc applies to pre-Kingston for those that want to get started now. That should answer all of your questions, but if you do have follow up questions I'd be happy to address them.



Also, with the launch of the Kingston release we will also be sharing some code on the Share site (share.servicenow.com) to jump start a Watson chatbot as well, but that will only work with Kingston as some changes to Connect are needed. Check that site periodically, it should be coming soon.


Thanks! This was really helpful. We have the Helsinki release and started to do the chat connection to Watson. Following the documentation, when the team and I makes a test chat. We obtain the following error:



ECC Logs:



Imput:


<?xml version="1.0" encoding="UTF-8"?><results error="Method failed: (/conversation/api/v1/workspaces/93d51adf-754b-4abc-8a7d-f5d7929d9f8e/message) with code: 400"><result><output>{"error":"Unexpected token u in JSON at position 43","code":400}</output></result><httpHeaders><httpHeader name="Transfer-Encoding" value="chunked"/><httpHeader name="Strict-Transport-Security" value="max-age=31536000;"/><httpHeader name="Server" value="-"/><httpHeader name="X-Backside-Transport" value="FAIL FAIL"/><httpHeader name="Connection" value="close"/><httpHeader name="Vary" value="Accept-Encoding"/><httpHe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%3D; path=/conversation/api; secure; HttpOnly"/><httpHeader name="X-DP-Watson-Tran-ID" value="gateway02-136774845"/><httpHeader name="X-Global-Transaction-ID" value="ffea405d5a560a30082704bd"/><httpHeader name="Date" value="Wed, 10 Jan 2018 12:42:24 GMT"/><httpHeader name="X-Powered-By" value="Express"/><httpHeader name="Content-Type" value="application/json;charset=utf-8"/></httpHeaders><parameters><parameter name="http_status_code" value="400"/></parameters></results>



Output:


<?xml version="1.0" encoding="UTF-8"?><parameters><parameter name="rest_user" value="****************"/><parameter name="rest_password" value="****************/><parameter name="message_headers" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;fields&gt;&lt;field name=&quot;Content-Type&quot; value=&quot;application/json&quot;/&gt;&lt;/fields&gt;"/><parameter name="message_parameters" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;fields/&gt;"/><parameter name="source" value="https://gateway.watsonplatform.net/conversation/api/v1/workspaces/93d51adf-754b-4abc-8a7d-f5d7929d9f..."/><parameter name="name" value="post"/><parameter name="content" value="{&#13;&#10;&quot;input&quot;:{ &quot;text&quot;:&quot;test&quot;&#13;&#10; },&#13;&#10;&quot;context&quot;:undefined&#13;&#10;}"/></parameters>



Also, what is "getContext()" supposed to do. Always returns "null".




Thought you might know what could be the issue, am suspecting the error is actually from Bluemix but amd still researching with the team. If you know anything, please let me know.


One of my team memebers found that the Async call was not working hence the errors, we switch to the other option and it works now. We have a working chat bot with SN connect but still a lot of work to do for the future. The important thing is that we have a connection with Watson and the architecture is stable. The documentation works but is not complete, there needs to be done some implementation to have it working.


Update, the IBM Watson Conversation Service update set is published on Share at the following link.



ServiceNow Share - Watson Conversation Integration



Note: IT requires Kingston and the Connect client works in Service Portal.



But if you are eager to launch pre-Kingston then stick to the whitepaper. They are very similar so a lot of the code is the same, which should make upgrading to Kingston at a later point in time easy.



Hope that helps everyone.