RestApi is not working - Rasa Open Source - Rasa Community Forum

👋 Introducing the Rasa Playground

RestApi is not working

You have selected 0 posts.

3.3k views 2 links

post by vigneshgig on Jan 14, 2019

hi, i used rest to talk with rasa.core server

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

credentials.yml
rest:

{
  "sender": "Rasa",
  "message": "Hi there!"
}

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

but iam getting

Internal Server Error

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

2019-01-14 16:28:05 ERROR flask.app - Exception on /webhooks/rest/webhook [POST]
Traceback (most recent call last):
  File "C:\Users\vigne\Anaconda3\lib\site-packages\flask\app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "C:\Users\vigne\Anaconda3\lib\site-packages\flask\app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "C:\Users\vigne\Anaconda3\lib\site-packages\flask_cors\extension.py", line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "C:\Users\vigne\Anaconda3\lib\site-packages\flask\app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "C:\Users\vigne\Anaconda3\lib\site-packages\flask_compat.py", line 35, in reraise
    raise value
  File "C:\Users\vigne\Anaconda3\lib\site-packages\flask\app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "C:\Users\vigne\Anaconda3\lib\site-packages\flask\app.py", line 1799, in dispatch_request
    return self.view_functionsrule.endpoint
  File "C:\Users\vigne\Anaconda3\lib\site-packages\rasa_core\channels\channel.py", line 358, in receive
    sender_id = self._extract_sender(request)
  File "C:\Users\vigne\Anaconda3\lib\site-packages\rasa_core\channels\channel.py", line 326, in _extract_sender
    return req.json.get("sender", None)
AttributeError: 'NoneType' object has no attribute 'get'

127.0.0.1 - - [2019-01-14 16:28:05] "POST /webhooks/rest/webhook HTTP/1.1" 500 444 0.022005

can anyone please help me out thanks

post by NikhilBansal21 on Jan 14, 2019

for getting a response from your bot follow this

post by vigneshgig on Jan 14, 2019

in future get /conversations/{sender_id}/respond is going to be Deprecated that’s why i am using rest api thanks for you reply, can anyone please help me to resolve this problem

post by JiteshGaikwad on Jan 14, 2019

hey @vigneshgig how are you sending the body parameters, can you share the screenshot, while you test it in the postman

post by vigneshgig on Jan 15, 2019

thanks for the reply

post by JiteshGaikwad on Jan 15, 2019

hey @vigneshgig the issue is in your body the format should be json whereas it is in text

post by vigneshgig on Jan 15, 2019

Thank you so much man , I will check it