RestApi is not working

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:

postman post http://localhost:5002/webhooks/rest/webhook body { “sender”: “Rasa”, “message”: “Hi there!” }

but iam getting

500 Internal Server Error

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.

in rasa.core server

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

for getting a response from your bot follow this

1 Like

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

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

1 Like

thanks for the reply

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

1 Like

Thank you so much man , I will check it