Skip to main content

Generic HTTP(S)/JSON Connector

Lots of chatbots connect to a simple HTTP/JSON based API in the backend to handle user requests and prepare the responses. This Botium connector mode enables Botium to connect to such an API.

Features

  • Sync API supported. (API is sync if the API messages are coming as HTTP response)

  • Async API is supported (API is async if the API messages are coming via a webhook) - see How to Develop your own Botium Connector for more information.

  • Polling API is supported (Botium will continue polling an endpoint for chatbot responses) - see here

  • All HTTP methods are supported, JSON and Non-JSON content (only JSON content can be processed further)

  • Session tracking is supported (“Context”). The context can be initialized and will be updated after each request/response and can be used for example to track a session-id (often called “conversation id”) or additional conversation state information.

  • Using Mustache templates to dynamically construct HTTP Headers, Body, URL, ConversationId, and StepId.

  • You can use the context ("context" scope) and message content ("msg" scope) in Mustache templates. You can also access scripting memory variables ("msg.scripting") and all the functions available in scripting memory.

  • The mustache templates are fed with a unique “conversationId” (by conversation) and a unique “stepId” (for each sent message) in the “botium” scope

Tip:

In case you don’t want Mustache to do URL/HTML encoding with your texts (which you typically don’t want for HTTP POST endpoints), use triple braces {{{ … }}} as placeholders instead of double.

For more information on Mustache Variables read Supported Capabilities for HTTP(S)/JSON Based APIs

Was this article helpful?

0 out of 0 found this helpful