An API that provides replies to the message passed to the API.
Route: /api/chatbot/query/
Method: POST
Headers: Content-Type: application/json
Input: message
Input is taken in form of JSON object.
Output: solutions
Output provided as JSON object.
Status Code: 200
- Go to the API link: https://cureya-chatbot.herokuapp.com/api/chatbot/query/ or localhost:3000/api/chatbot/query
- Send a POST request with body layout as:
{
"message": "Some message here"
}
as a JSON object.
- The API will evaluate the correct response and send the reply as:
{
"solutions": ["All", "Solutions", "Are", "Sent"]
}
as a JSON object.
- Clone the Repo.
- Install
requirements.txt
. - Go to the
chatbot_api
folderand locateviews.py
. - Import required script at the top of the file that will generate the replies.
- The class
BotSolutions
contains the API code. data
variable contains the message sent instring
format. Thedata
variable can be sent to the script directly and stored insolutions
variable.- Pass the
solutions
variable to the JSONResponse.