[solved] Unable to deploy the REST API on rasa core

python -m rasa_core.run -d models/dialogue -u models/nlu/default 
    --port 5002 --credentials credentials.yml  --enable_api

credentials.yml:

rest:
  # you don't need to provide anything here - this channel doesn't
  # require any credentials

Browser: http://localhost:5002/webhooks/rest/webhook/conversations/aziz/say?message=hi

And I get this :

# Not Found
The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

on terminal output

127.0.0.1 - - [2018-10-25 13:46:48] "GET / HTTP/1.1" 200 146 0.000909
127.0.0.1 - - [2018-10-25 13:47:56] "GET /webhooks/rest/webhook/conversations/aziz/say?message=hi HTTP/1.1" 404 374 0.000967
127.0.0.1 - - [2018-10-25 13:47:57] "GET /webhooks/rest/webhook/conversations/aziz/say?message=hi HTTP/1.1" 404 374 0.001196

http://localhost:5002/

hello from Rasa Core: 0.12.0a2

Reference: Chat & Voice platforms

That’s not the URL, It is a POST request

http://localhost:5002/webhooks/rest/webhook

{
"sender":"12343",
"message":"Hello"
}

@souvikg10

http://localhost:5002/webhooks/rest/webhook

# Method Not Allowed

The method is not allowed for the requested URL. 

It is the output

it is HTTP POST method, Are you running it on the browser or something? By default browsers send a GET request

Use POSTMAN or Curl with -X POST

@souvikg10

 curl -XPOST http://localhost:5002/webhooks/rest/webhook \
   -d '{"sender": "aziz", "message": "hi"}'   -H "Content-type: application/json"
[]

it give me a blank response.

Then it is no more an API error. Run the server with --debug flag on to see what’s going wrong in the stories

1 Like

@souvikg10 thanks you, it is sovled.

I was facing the same issue and just for logging what was my solution here. Basically the rasa_nlu models was correctly classifying the intent but the rasa_core path was wrong so there were no action listed…

simply fix the path in the docker-compose.yml file and now it’s working :slight_smile: !