API Reference
AttributeTypeDescription
hostProviderstringThe host of the external search, possible values: zendesk
userIdstring or undefinedAn optional anonymized user ID, the user ID will be attached to the user actions and will allow improved metrics and traceability
langCodestring or undefinedAn optional language code, will allow Ask-AI to return answers in the specified language.
The value should follow ISO format (without region).
Allowed values: en / de / fr / es / it / nl
customStylesIdstring or undefinedThe ID of the stylesheet import to be included on the style effecting the extenal search bar. List of all the class names can be found here: CSS Customization
submitRequestobject or undefinedAn object that details the submit request action config. If not defined, the user will not see submit request.
submitRequest.urlstring or undefinedThe URL to redirect the user when they're clicking on "Submit request"
submitRequest.questionQueryParamNamestring or undefinedOptional, will add the question the user asked as a query param in the provided key

Example

<!-- Import custom styles -->
<style id="ask-ai-custom">.ask-ai-external-search-search-bar { background: green; }</style>

<!-- Import external search artifacts -->
<script type="text/javascript" src="https://external-search.ask-ai.co/ask_ai_sb.js"></script>

<!-- Render external search -->
<script type="text/javascript">
    window.renderAskAISearchBar("SELECTOR", "TOKEN", {
      hostProvider: "zendesk",
      langCode: "en",
      customStylesId: "ask-ai-custom",
      submitRequest: {
          // Will redirect to the URL with the question as a query parameter, for example, for question: "What is Ask-AI?" the user will be redirected to "https://www.ask-ai.com/request-demo?question=What%20is%20Ask-AI%3F"
          url: "https://www.ask-ai.com/request-demo",
          questionQueryParamName: "question",
      },
    });
</script>