Problem with Rasa HTTP API

I am trying to execute an action at the beginning of my conversation with the user. To do that, I am using the http api method to run an action. This was working fine before I migrated to Rasa 1.0.1

Now when I try it, get the folling message: Error: Requested URL /conversations/default/execute not found

Here is my request url and the body:
http://192.168.99.100:5005/conversations/{sessionId}/execute
body :{“name”:“utter_welcome_message”}

I don’t know if it related but I also cannot retrieve the tracker of the conversation anymore by calling: http://192.168.99.100:5005/conversations/{sessionId}/tracker

I’ve checked the API documentation but couldn’t find anything different from what I am doing. What I am doing wrong?

1 Like

Hi @CaioTsubake

did you start the server with the --enable-api flag?

Regards

Hi @JulianGerhard.

No I didn’t. I was running the server with a docker compose file, in which I am basically just doing rasa run.

So, I need to run my command with --enable-api flag to be able to call the API over HTTP, correct?

I will try it and let you know what happened. Thanks!

Exactly! If you do:

rasa run -vv <other flags> --enable-api

you should be able to see something like:

rasa.core.utils  - Available web server routes:
/conversations/<conversation_id>/messages          POST                           add_message
/conversations/<conversation_id>/tracker/events    POST                           append_event
/webhooks/rasa                                     GET                            custom_webhook_RasaChatInput.health
/webhooks/rasa/webhook                             POST                           custom_webhook_RasaChatInput.receive
/webhooks/rest                                     GET                            custom_webhook_RestInput.health
/webhooks/rest/webhook                             POST                           custom_webhook_RestInput.receive
/model/test/intents                                POST                           evaluate_intents
/model/test/stories                                POST                           evaluate_stories
/conversations/<conversation_id>/execute           POST                           execute_action
/domain                                            GET                            get_domain
/                                                  GET                            hello
/model                                             PUT                            load_model
/model/parse                                       POST                           parse
/conversations/<conversation_id>/predict           POST                           predict
/conversations/<conversation_id>/tracker/events    PUT                            replace_events
/conversations/<conversation_id>/story             GET                            retrieve_story
/conversations/<conversation_id>/tracker           GET                            retrieve_tracker
/status                                            GET                            status
/model/predict                                     POST                           tracker_predict
/model/train                                       POST                           train
/model                                             DELETE                         unload_model
/version                                           GET                            version

then you should be able to use the API!

5 Likes

Thanks Julian, it worked like a charm.
I also had to change the old body parameters in my code but after that it began working like before. Thanks for the help!

Oh, one last thing, is using the API the best way to trigger a specific action on the bot, or is there a more correct way?

Thanks again for the help!

Glad that I could help!

That depends on what “triggering an action” means exactly. I’d say that it is absolutely okay to trigger an action via API but it seems to me that it is more natural to trigger it during conversation by uttering things.

So - no exact answer here! :slight_smile:

Regards

@JulianGerhard I got below issue when using chatroom UI with Rasa. It faild with below eoor when i try to send message from Chatroom UI.

Hi @Navjan,

such an issue can e.g. be observed when a request is SSL secured meaning that Rasa needs to be started with SSL encryption - at least this would be my first assumption.

Did you try following this documentation to see if it works then?

I am not familiar with Chatroom UI but let’s try SSL first.

Kind regards
Julian

Hi @JulianGerhard do you know if these endpoints HTTP API have been deprecated and these Rasa X HTTP API are the only ones that work? I’m trying to add events to the tracker via one of the endpoints but I get a “Not Found” error, which means it doesn’t exist.

EDIT: It’s weird because I did rasa run actions with the -vv option and in my logs it says the /conversations/{conversation_id}/tracker/events POST endpoint exists but I still get a “Not Found” 404 error from the api