Switch from SocketIO to REST API

Hi

Disclaimer: I’m not an expert in the following topic!

Currently I am running my bot with SocketIO. To start the bot, I open the following terminals in pycharm and run this:

Terminal 1:

rasa train 

Terminal 2:

rasa run --endpoints endpoints.yml --credentials credentials.yml --cors "*"

Terminal 3:

rasa run actions --actions actions

Terminal 4:

livereload

Afterwards the bots starts to run in my browser with a nice user interface.

My question:

Now, I have to change to REST API. How can I do this?

What I know so far:

In the docu it says that I have to ensure my credentials.yml has the following content: (see link)

However, what else do I need to change? You can give me a step-by-step description please?

Hope you can help me!

You don’t need to configure anything differently in rasa (just mentioning in the credentials that you are using rest is fine).

For your frontend, you would need to change it to make post requests to the server of rasa. That seems to be about it.

Hi @Chatbot_Ra One way would be to create a custom action in which you can make requests to the rasa webhook server. For API calls, you can send requests to “http://localhost:5005/webhooks/rest/webhook” in that custom action.

I have used API in django and hence have just a little idea about the rasa http api.

@varunsapre10 I don’t get what you mean with this. He’s switching channels, the action server is irrelevant.

@Mappi @Chatbot_Ra

I misunderstood the issue. I thought you were just trying to interact with an API.

Thank you both to @Mappi and @varunsapre10.

I just learned, that all I have to do, is to change the logic. At the moment, when I sent “hello” to the bot, it says sth. like “sorry, I did not understand you”.

Apperantly, you can use this site to interact with the bot. However, it doens’t work! I need to change the logic that in order to make this work.

Do not realy know where to start

Hey @Chatbot_Ra if you are trying to switch from Socket.io to Rest API check out this widget:

https://github.com/JiteshGaikwad/Chatbot-Widget.git

Stupid question, but what is this? :sweat_smile: Is this a frontend which uses REST api?

At the moment I am using a frontend called index.hml Can I just replace it with the one from the link?

Sorry, I’m absolutly no expert in this!

I will close this chat in order to reprahse my question. Thinks have changed. Sorry for confusions!

@Chatbot_Ra this is frontend which uses REST api.

1 Like