Introduction

ChatBot is a natural language understanding framework that allows you to create intelligent chatbots for any service. You can easily integrate your bots with favorite messaging apps and let them serve your customers continuously.

Basic API usage

All the requests referenced in the documentation start with https://api.chatbot.com.

Authentication

Each API request requires authentication to identify the license that is responsible for making the request. Authentication is provided by access tokens.

Where are my access tokens?

To get your Developer Access Token, please visit this page.

Each license has two tokens:

  • Developer access token - allows you to manage your stories, interactions, entities, webhooks and more. This is a private usage token and should never be shared as it gives full access to your account.
  • Client access token - allows only /query endpoint requests. It can be kept as part of an application which code may be read by the third person. It can be regenerated any time in ChatBot settings if necessary.

Authentication example

Include this HTTP header for each API request:

Authorization: Bearer ${ACCESS_TOKEN}

To get your Developer Access Token, please visit this page.

Example request

curl --request GET \
	--url https://api.chatbot.com/v2/stories \
	--header 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}'

Data format

ChatBot returns data in JSON format. See the following example.

{
    "timestamp": "2017-04-12T13:30:07.445Z",
    "status": {
        "code": 200,
        "type": "success"
    }
}

Error handling

Errors are returned using standard HTTP error code syntax. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error (wrong or missing parameters, insufficient authentication etc.), and codes in the 5xx range indicate an error with ChatBot servers. Any additional info is included in the status of the return call, JSON-formatted.

HTTP status codes summary

  • 400The request was incorrect. Please make sure that the passed arguments are matching format provided in the method documentation.
  • 401Unauthorized. Authorization failed. Please check if you’re using a correct authorization type (bearer token) and a valid developer access token.
  • 404Not Found. You attempt to request a resource that doesn’t exist.
  • 500Internal Server Error. Something unexpected happened on our end. Please try again or contact support.

Troubleshooting

There are multiple issues that may cause your webhook work incorrectly. Below you can find the most common reasons for these errors:

  • Response status is different than 200 or 30X (redirect).
  • More than one redirect (redirect loop)
  • Incorrect request URL, or redirect to not existing URL
  • Incorrect request body (for example, not in JSON format or invalid body structure)
  • Timeout. If request takes more than 10s to process, it will be automatically rejected. This also includes situation when your server is behind proxy/loadbalancer and it takes more than 10s to get through it.

Start a free ChatBot trial
and build your first chatbot today!

Free 14-day trial No credit card required

Discover our text| products