APIANT Inline
Embed Inline
1min
The following code describes how to embed and use Inline on your web page:
JS
<!-- The Inline UI has a theme file named theme_inline_{apiant_inline_key}.json on the server. If the file is not found the default system theme is used. -->
<!-- Replace with the domain of your APIANT server and your API Key -->
<script src="https://XXXXX.com/appJS/apiant_inline.js?apiant_inline_key=YYYYY" type="text/javascript"></script>
<div id="embed_apiant_inline"></div>
// When invoked, Inline has finished loading and is ready to use
function apiant_handleInlineLoaded()
{
// An empty tenant_uuid represents the root APIANT system
var objAccount = {tenant_uuid: "",
email: "[email protected]",
firstname: "Sally",
lastname: "Alsop",
initial_password: "Changeme",
timezone: "US/Eastern"};
// If the account does not exist, it is created
// Must be called as the first step before using other Inline functionality
apiant_setAccount(objAccount);
// apiant_getActiveAutomations(pageNumberZeroBased=0, pageSize=-1, sort="name"); //pageSize of -1 = all, sort can be "name" or "id"
// apiant_getInactiveAutomations(pageNumberZeroBased=0, pageSize=-1, sort="name"); //pageSize of -1 = all, sort can be "name" or "id"
}
// Invoked when apiant_setAccount() completes
function apiant_handleSetAccountComplete(objPerson)
{
if (objPerson.error)
{
alert(objPerson.error);
}
else
{
// objPerson contains identifying information about the account
}
}
// The user clicked a button on your page that selected a template to install// Templates are defined in the "templates" account// Automations can be published to the "templates" account via the dashboard gear menu "publish as template" option
// Template UUIDs can be obtained from the "templates" account's dashboard gear icon menus
// A template may be a collection of multiple automations
// Collections are defined in the "templates" account, are essentially folders having names that start with "Collection:"
function handleButtonClick(selected_template_uuid)
{
var objTemplate = {template_uuid: selected_template_uuid};
// Installs and configures the template for use
// If configuration is successfully completed, the template is turned on and ready to process data
apiant_startTemplateConfig(objTemplate);
}
// Invoked when apiant_startTemplateConfig() completes
function apiant_handleTemplateConfigComplete(objResult)
{
if (objResult.error)
{
alert(objResult.error);
}
}
// Invoked when apiant_getActiveAutomations(pageNumberZeroBased=0, pageSize=-1, sort="name") completes
function apiant_handleGetActiveAutomationsComplete(objResult)
{
if (objResult.error)
{
alert(objResult.error);
}
else
{
var jsonObj = JSON.parse(objResult.json)
}
}
// Invoked when apiant_getInactiveAutomations(pageNumberZeroBased=0, pageSize=-1, sort="name") completes
function apiant_handleGetInactiveAutomationsComplete(objResult)
{
if (objResult.error)
{
alert(objResult.error);
}
else
{
var jsonObj = JSON.parse(objResult.json)
}
}
// Invoked when apiant_turnAutomationOn(automation_uuid) or apiant_turnAutomationOff(automation_uuid) completes
function apiant_handleTurnAutomationOnOffComplete(objResult)
{
if (objResult.error)
{
alert(objResult.error);
}
else if (objResult.subscription_error)
{
alert(objResult.subscription_error);
}
}
Updated 25 Mar 2024
Did this page help you?