In most likelihood you will be setting up the chat bot to work from your website or mobile app so that it looks and feels like part of your solution. The API endpoints are extremely easy to use and consume in your own app. It’s mostly two simple API calls that you need to use, as explained below.

NEW USER

The Chatbot framework needs to distinguish between users who are chatting with it, and for this purpose it lets you generate a unique ID which you can use to subsequently post chat messages. It does not do any user management whatsoever apart from simply generating a GUID which acts as a handle to remember the user and the conversation context.

GET http://localhost:8880/api/Conversation/new

This should generate a response similar to the following

{
“Code”: “SUCCESS”,
“State”: “NORMAL”,
“UserID”: “578eced6-490c-4e6d-a2c8-ac84a5bb8630”
}

POSTING A CHAT MESSAGE

To send a chat message to the bot, you simple post in the following format

POST http://localhost:8880/api/Conversation/578eced6-490c-4e6d-a2c8-ac84a5bb8630

Data that is posted (application/json)

{
Sentence: ‘Hello!’
}

This should generate a response similar to the one below

{
“ResponseText”: “Hi there!”,
“Code”: “SUCCESS”,
“State”: “NORMAL”,
“UserID”: “578eced6-490c-4e6d-a2c8-ac84a5bb8630”
}

Yes, that’s it! The ResponseText is what you will be most concerned about in your application.