SAP / Webchat

The SAP Conversational AI webchat let you deploy a bot straight to a website
https://cai.tools.sap
MIT License
80 stars 199 forks source link

Error: Request failed with status code 500 #62

Closed gacortezia closed 4 years ago

gacortezia commented 4 years ago

Hello, I implemented a very simple Webchat with SAP CAI. After generate the connection informationg I just included into my SAPUI5 app with the following code:

` if (!document.getElementById("cai-webchat")) { var s = document.createElement("script"); s.setAttribute("id", "cai-webchat"); s.setAttribute("src", "https://cdn.cai.tools.sap/webchat/webchat.js"); s.setAttribute("channelId", "Channed Id Goes Here"); s.setAttribute("token", "Token Goes Here"); document.body.appendChild(s); }

` The icon appeared into my page but when I try to submit a message the chat shows "Couldn’t send this message" the error "Error: Request failed with status code 500" is displayed in the console.

TestChatBot - Google Chrome

Anyone has an idea of what is wrong?

Regards.

JWandrocke commented 4 years ago

Hi

This is not an easy answer. The 500 error is from the backend system. It could be the Token and the channel id is wrong. It could be a security issue. The code you have above show it is point to the production WebChat and not a local version. I have tried the script on product and it is working. Try using the script in the connect tab (using something like jsbin)

Hope this helps

gacortezia commented 4 years ago

Hi John,

Thanks you for your help. This week I tried to run the application again and It worked without any change. I believe that there were some issue in CAI server side.

Thank you.