Embed Widget Filtered Results

With this part of the API for the Embed widget, you can filter the results you want to display on your embed for your purpose.

Embeddable HTML Snippet

Overview template:

<script src="https://web.chatfortress.com/embed-widget.js?t=1234567890"></script><script type="text/javascript" id="cf-widget-<CompanyID>">   (function(){     var widget = new CFWidget('<CompanyID>','<APIKey>', {size: '<size>', filter: ['<categoryID>', '<categoryID>', ...]});     widget.init();   })()</script>

You can embed multiple widgets of different or same types in the same page.The snippet contain 2 main parts:

1. The script itself:

2. The initialization script snippet:

The script itself:

This just includes the widget codebase into the page, not rendering anything at all.
<script src="https://web.chatfortress.com/embed-widget.js?t=1234567890"></script>

The initialization script snippet:

This one can be placed anywhere inside the <BODY></BODY> tag in the page. Also this code can be used multiple times and it will always render the widget right in the place you put the snippet in.

<script type="text/javascript" id="cf-widget-<CompanyID>">   (function(){     var widget = new CFWidget('<CompanyID>','<APIKey>', {size: '<size>', filter: ['<categoryID>', '<categoryID>', ...]});     widget.init();   })()</script>

Note: 

  • The filter is only applicable to 'factors' or 'vulnerabilities' sizes it can be empty or can has any list of categories 
  • Sizes: small, small-horizontal, medium, factors, vulnerabilities
  • categories for filter: 'dnsHealth', 'emailSecurity', 'leakedCredentials', 'IPDomain', 'fraudulentDomains', 'patchManagement', 'informationDisclosure', 'websiteSecurity'
  • Avoiding browser cache<script src="https://web.chatfortress.com/embed-widget.js?t=1234567890"></script>The 1234567890  number here is used as a timestamp placeholder, this helps avoid browser caching  JS files in case it will change over time. There are several common ways to embed JS scripts like the example below (for php as an example):<script src="test.js?random=<?php echo uniqid(); ?>"></script>The GET parameter name does not have any requirements not in name nor in it’s value.
  • CompanyID variable is the main ID used to pull data from the API. Can be obtained from admin UI or just from the directory link path which could look like https://chatfortress.com/directory/company/<CompanyID>/
  • APIKey variable is your PUBLIC API key that can be obtained from Services tab of Account menu from the admin UI.
  • size variable can be one of the following: small, small-horizontal, medium, factors, vulnerabilitiesThis controls the rendered view and the data used in the widget.
  • filter variable is optional and will only work if “size” is “factors” or “vulnerabilities”.It’s value is a javascript array and can contain one or more of the following list: 'dnsHealth', 'emailSecurity', 'leakedCredentials', 'IPDomain', 'fraudulentDomains', 'patchManagement', 'informationDisclosure', 'websiteSecurity'By default (if not set) it contain all the above list.
  • “factors” and “vulnerabilities” widgets will be resized after rendering and this has to be noted when placing it in some HTML containers with fixed size.
  • “vulnerabilities” widget will be rendered expanded when containing only one category in “filter”. When filter is larger than 1 it will render all items collapsed.
By applying the category filter you can change which of the report card elements are displayed on your embed widget. 

Examples

Small widget

<script type="text/javascript" id="cf-widget-nAQunDEodCdBRdDdWG6C"> (function(){var widget = new CFWidget('nAQunDEodCdBRdDdWG6C','<APIKey>', {size: 'small'});widget.init();})()</script>

Small widget

<script type="text/javascript" id="cf-widget-nAQunDEodCdBRdDdWG6C"> (function(){var widget = new CFWidget('nAQunDEodCdBRdDdWG6C','<APIKey>', {size: 'small'});widget.init();})()</script>

Factors widget with all categories in it

<script type="text/javascript" id="cf-widget-nAQunDEodCdBRdDdWG6C"> (function(){var widget = new CFWidget('nAQunDEodCdBRdDdWG6C','<APIKey>', {size: 'factors'

});widget.init();})()</script>

Vulnerabilities widget with filtered categories

<script type="text/javascript" id="cf-widget-nAQunDEodCdBRdDdWG6C"> (function(){var widget = new CFWidget('nAQunDEodCdBRdDdWG6C','<APIKey>', {size: 'factors', filter: ['dnsHealth', 'emailSecurity','websiteSecurity']});widget.init();})()</script>



Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us