cancel
Showing results for 
Search instead for 
Did you mean: 

Devtoberfest - Tutorial - Call SAP Conversational AI API Using OAuth

Mohamed_Yousuf
Participant
0 Kudos

Tutorials: https://developers.sap.com/tutorials/conversational-ai-api-oauth.html
--------------------------

Hi experts,

When doing the above tutorial, in Step 7, while trying to open the application in browser using the link htttp://localhost:5000/api?text=hi, I am getting the below response.

I already had created a chatbot with "Greetings" skill as explained in the tutorial Build Your First Chatbot with SAP Conversational AI | Tutorials for SAP Developers.

Below is the log which is displayed in the terminal window in VS Code.

Below is the content of file configproperties.py

The above values are taken from the chatbot application as below:

Below is the content of chatbot-api.py file.

Below is the folder structure of the project.

I even tried to open the application with the IP address that was shown in the terminal (instead of using localhost), still got the same error as shown below.

I think I am missing some step or doing something wrong.

Can you please help.

Kind regards

Yosuf

Accepted Solutions (1)

Accepted Solutions (1)

Dan_Wroblewski
Developer Advocate
Developer Advocate

You need to move the "if __name__ statement (the entire 5 lines) to the end of the file. Notice just above it says "other code will go here" -- that is where you put the rest of the code. Sorry I did not explain this better and I will rewrite to make clear.

Basically, when you get to these statements, you are starting to create the server but none of the routes and stuff is defined, so when you run the server, the "api" route is not available.

Thanks for not asking about the OAuth URL or the request URL, because I did not add instructions for these either. I will update.

Mohamed_Yousuf
Participant
0 Kudos

Thank you very much, daniel.wroblewski..!

Answers (0)