Problem with Rasa HTTP API

(Caio Villa Silva Tsubake) #1

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:{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:{sessionId}/tracker

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

(Julian Gerhard) #2

Hi @CaioTsubake

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


(Caio Villa Silva Tsubake) #3

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!

(Julian Gerhard) #4

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                  
/webhooks/rasa/webhook                             POST                           custom_webhook_RasaChatInput.receive
/webhooks/rest                                     GET                  
/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!

1 Like
(Caio Villa Silva Tsubake) #5

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!

(Julian Gerhard) #6

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: