on 11-16-2021 3:44 PM
Hello Experts,
UI5 Application is deployed and running fine in all environments with Chatbot integrated in it. Even the chat bot is working fine. Application is running in NEO environment.
All of a sudden, we noticed CORS issue in the Application and I am not sure what needs to be done. UI5 Application is working fine even now but CORS issue is coming for Chat Bot .
Do we need to add any setting at CAI Layer or at the UI5 Application or at the Neo environment layer?
We have used an Ajax call to connect to Chat bot. Please let us know how can we over come this issue?
Hi
Use destination in neo environment and consume that, rather than direct ajax call
regards
Anmol
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
URL can be hard coded to - 'https://api.cai.tools.sap/train/v2/request' but some times we connect to one bot and
some times we connect to different bot by changing the Requesting TOKEN Key... (Kind of Dynamic). But I will be
happy at least if I understand the way to do it. Not sure if we create destination what should be authentication mechanism
Do we need to create oAuth tokens in chatbot and use them?
<img alt="" style="font-family: Arial, Helvetica, Verdana, Tahoma, sans-serif; font-size: 15px; white-space: normal; color: inherit;">
I believe you would be having multiple, but limited number of different urls, where the hostname would be fixed like xxxxx.xxxx.com
Try creating destination as of basic host url and consume it.
I am not sure about authentication method. You need to give it a try. I haven't worked on chat bots yet. 🙂
Hi Pawan,
you can check the UI5 documentation to see how to create a destination in your neo-app.json file.
Additionally you will have to create a destination in the cockpit.
Please note that the "name" in the cockpit has to match the name in the neo-app.json. The "path" in the neo-app.json is what you then call in your AJAX call and what you attach the rest of your URL to. The actual call to the complete URL will then be made server side on your behalf (avoiding CORS).
An example:
neo-app.json:
...
{
"path": "/routeMeToCAIDest/",
"target": {
"type": "destination",
"name": "myCAIDest"
},
"description": "My destination to CAI"
}
...
Destination in the cockpit:
Configure it so that the URL is "https://api.cai.tools.sap" and the name is "myCAIDest"
AJAX call:
...
url: "routeMeToCAIDest/train/v2/request"
...
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.