Distribute Your Chatbot.

This the link to the chatbot you can share with your customers.
https://bot.ritsbot.com/bot/{your-chatbot-botid}
Copy this code snippet to your website Header Section.
<script src="https://bot.ritsbot.com/rbjs/{your-chatbot-botid}" async></script>

Use APIs in Chatbots.

Create an API.
APIs allow you to manage chatbot flows from within your own premises. By the use of APIs you can connect your channels with chatbot and add more functionality to the chatbot.
  1. Go to your Chatbot tab goto Bot APIs.
  2. Open + New API.
  3. Use Appropriate Methods, Headers and Content Body for the APIs.
Sample Request From Ritsbot to Remote Server
    {
        "botid": "7TbK4eLpQsN9zF8W",
        "sessionid": "K4eQsEszF7TbsN9W",
        // Your default request body will be added here
        "previousNodeResponse": {
            "customerName": "AbdulRahman K",
            "address": "No 17/415 KK Villa..."
        }  
    }

    <botid>7TbK4eLpQsN9zF8W</botid>
    <sessionid>K4eQsEszF7TbsN9W</sessionid>
    <-- Your default request body will be added here -->
    <previousNodeResponse>
        <customerName>AbdulRahman K</customerName>
        <address>No 17/415 KK Villa...</address>
    </previousNodeResponse>

    botid=7TbK4eLpQsN9zF8W&sessionid=K4eQsEszF7TbsN9W&[[Your default request body will be added here]]&previousNodeResponse[customerName]=AbdulRahman+K&previousNodeResponse[address]=No+17%2F415+KK+Villa...


    botid:7TbK4eLpQsN9zF8W;
    sessionid:K4eQsEszF7TbsN9W;
    Your default request body will be added here
    previousNodeResponse_START;
        customerName:AbdulRahman K;
        address:No 17/415 KK Villa...;
    previousNodeResponse_END;

How You can use APIs on a Ritsbot?

Response from your API end-point(s) must be in application/json.
1. To Generate Message bubbles.
Open(double-click) the Node for edit. Check Use API and select an API from the List. Use response JSON fields in this format ##{a.aa.aab} in your message bubbles, Even you can put the variables in images/iframes URLs.
application/json 200, Ok
    {
        "user": {
            "name": "Surya AJ",
            "email": "[email protected]" 
        }
    }
Hello, ##{user.name}
Please Confirm your mail address, ##{user.email}
2. To Load Response Options List.
In the response section in edit Node. Select Auto-suggestion, Go to List Options select Load List From API. Select API from the List. Your API end-point response must be Key-Value object array.
application/json 200, Ok
    [
        {
            "key":"January",
            "value":"1"
        },
        {
            "key":"February",
            "value":"1"
        }
        ...
    ]
3. Validate User Response with API.
In the response section in edit Node. Check Validate Node Response with API. Select an API from the List. Ritsbot will Send the end-user response of this message Node to your Selected API.The validation checked based on HTTP Status Code received from your API endpoint.
If HTTP Status Code is 200, Ok then Ritsbot consider the end-user response as valid. Otherwise Ritsbot will check for default Recurring Message If it is empty. Response body(application/json) from your API endpoint stacked as error message if it is responds a in the given format.
Request payload(sample)
    {
        "botid": "7TbK4eLpQsN9zF8W",
        "sessionid": "K4eQsEszF7TbsN9W",
        "inputValue": "9WST41475497722"  
    }
application/json 200, Ok
    [
        {
            "message":"Invalid Identification Number.",
            "delay":"1"
        },
        {
            "message":"Please Try Again",
            "delay":"3"
        }
        ...
    ]

Use Webhooks Chatbots.

Send a GET request to the URL after your backend process is done. We will pass the botid and sessionid on all API requests. So you can trigger webhooks for chat sessions with these unique key fields.
https://bot.ritsbot.com/hookwait/{botid}/{sessionid}