# Infusion API
This reference serves as a practical guide for developers looking to manage Viewpoints via API using a set of standard CRUD endpoints. This documentation provides information about the data objects, data structures and endpoints and their behaviors. Below are some potential use cases for the Infusion API.
Use Case: An OEM has a self-service BI portal where users are authenticated. The OEM provides a list of Viewpoints that are available, and allows users to request which Viewpoints they want in which apps. When requested, API calls are made to change the permissions on the Viewpoint.
Use Case: As new employees join organizations, they need a Sisense login to be generated for them. Developers can use the existing User APIs to add new users, assign them to a user group, etc. When users are assigned to groups, developers can create automation to automatically assign them other assets depending on their role or group.
Use Case: When a new user group is created, automation can be in place to assign a set of Viewpoints that have been parameterized in order to work out of the box, with the appropriate data security rules applied.
See Using the REST API for more general information about authentication, conventions, etc.
# Limitations
The Infusion API is intended to work with Sisense instances that are using Infusion Apps.
In order to use the Infusion API, the Sisense instance must have Infusion Apps enabled on the license.
The Infusion API uses the Viewpoint object, which is only available for Sisense versions L2023.11
and later.
# ViewpointObject
The data related to an individual Viewpoint is stored in a single entity. This entity holds additional data structures that can be requested explicitly, like ViewpointVisibility and ViewpointDetails.
Property | Type | Description | Example |
---|---|---|---|
id | string | The unique identifier of the Viewpoint. | 6513fcdc03524c03b96bdfad |
name | string | The name that end users will see in Infusion Apps, and will reference when writing natural language queries. This value must be unique. | Secure Fraud South |
tenantId | string | The id of the tenant the Viewpoint is associated with. | 6512cd66d01d6d001b493488 |
description | string | The description that end users will see in their Infusion Apps next to the View Name. | Includes suspicious patterns, transaction volumes, and anomalies. Data is filtered to the US-South region. |
enabled | boolean | The status of the Viewpoint. When set to true, the Viewpoint is published. | true |
createdBy | string | The userId of the user who created the Viewpoint | 6512cd65d01d6d001b49347b |
updatedBy | string | The userId of the user who updated the Viewpoint | 6512cd65d01d6d001b49347b |
createdAt | timedate | The time/date the Viewpoint was created | 2023-09-27T09:58:52.669Z |
updatedAt | timedate | The time/date that Viewpoint was updated | 2023-09-27T09:58:52.669Z |
visibility | object | Defines the visibility of the Viewpoint. See ViewpointVisibility | |
details | object | Contains the data that is part of the Viewpoint. See ViewpointDetails |
# ViewpointObject
{
"id": "string",
"tenantId": "string",
"name": "string",
"description": "string",
"details": {
"datasource": {
"id": "string",
"title": "string",
"fullname": "string",
"modelType": "live"
},
"columns": [
{
"table": "string",
"column": "string",
"dim": "string",
"title": "string",
"datatype": "numeric",
"infusion": {
"visible": true,
"uid": true,
"defaultMeasure": true,
"defaultDate": true,
"header": true,
"filterOnly": true
},
"filter": {
"all": true,
"from": 0,
"to": 0,
"members": ["string"]
}
}
]
},
"visibility": {
"apps": ["Google"]
}
}
# ViewpointObject Example
{
"name": "Secure Fraud South",
"tenantId": "6512cd66d01d6d001b493488",
"description": "Includes suspicious patterns, transaction volumes, and anomalies.",
"details": {
"datasource": {
"id": "localhost_aOrdersDB",
"title": "OrdersDB",
"fullname": "localhost/OrdersDB"
},
"columns": [
{
"table": "ORDERS1",
"dim": "[ORDERS1.ORDER_ID]",
"title": "ORDER_ID",
"column": "ORDER_ID",
"datatype": "numeric",
"filter": {
"explicit": true,
"multiSelection": true,
"members": ["10002", "10003", "10004", "10005"]
},
"infusion": {
"filterOnly": false,
"uid": true
}
},
{
"table": "CUSTOMERS1",
"dim": "[CUSTOMERS1.COMPANY_NAME]",
"title": "Customer",
"column": "COMPANY_NAME",
"datatype": "text",
"filter": {}
},
{
"table": "SALES_EMPLOYEES1",
"dim": "[SALES_EMPLOYEES1.Employee Name]",
"title": "Sales Rep",
"column": "Employee Name",
"datatype": "text",
"filter": {
"explicit": true,
"multiSelection": true,
"members": ["Andrew Green", "Ben Franklin", "Cormack Coyle"]
}
}
]
},
"visibility": {
"apps": ["Google", "Slack", "Teams", "Office"],
"groups": ["Admins", "Admins", "6512cd64d01d6d001b49347a", "6512cd64d01d6d001b493479"],
"users": ["admin@sisense.com", "admin@sisense.com"],
"enabled": true
},
"createdBy": "6512cd65d01d6d001b49347b",
"createdAt": "2023-09-27T09:58:52.669Z",
"updatedAt": "2023-11-20T22:29:34.641Z",
"updatedBy": "6512cd65d01d6d001b49347b",
"id": "6513fcdc03524c03b96bdfad"
}
# ViewpointDetails
The ViewpointDetails
data structure stores the details of the data that is included in the Viewpoint. The ViewpointDetails
data structure includes two sub-structures:
Data Structure | Description |
---|---|
datasource | Describes the source of the tables and columns being referenced in the Viewpoint. |
column | Describes the columns, filters and metadata that is included in the Viewpoint. |
ViewpointDetails
can be:
- Requested using the GET infusion/viewpointsorGET infusion/viewpoints/{id}
- Created using POST infusion/viewpoints
- Updated using the PUT infusion/viewpoints/{id}
- Deleted using DELETE infusion/viewpoints/{id}
# ViewpointDetails Structure
{
datasource: datasource: {
Id: String,
title: String,
fullname: String,
modelType: live | external | perspective
},
columns: ColumnMetadata[],
}
# ViewpointDetails Example
{
"details": {
"datasource": {
"id": "localhost_aOrdersDB",
"title": "OrdersDB",
"fullname": "localhost/OrdersDB",
"modelType": "live"
},
"columns": [
{
"table": "ORDERS1",
"dim": "[ORDERS1.ORDER_ID]",
"title": "ORDER_ID",
"column": "ORDER_ID",
"datatype": "numeric",
"filter": {
"explicit": true,
"multiSelection": true,
"members": ["10002", "10003", "10004", "10005"]
},
"infusion": {
"filterOnly": false,
"uid": true
}
}
]
}
}
# datasource
Datasource defines the source of the tables and columns being referenced in the Viewpoint.
Property | Type | Description | Example |
---|---|---|---|
id | string | The id of the data source. | localhost_aOrdersDB |
title | string | The title of the data source. | OrdersDB |
fullname | string | The full name of the data source. | localhost/OrdersDB |
modelType | string | The type of datasource. A datasource can be defined as live, external or perspective. | live |
# Example
"datasource": {
"id": "localhost_aOrdersDB",
"title": "OrdersDB",
"fullname": "localhost/OrdersDB",
"modelType": "live"
}
# column
The column sub-structure describes the columns, and metadata that is included in the Viewpoint. This includes the column data, format, filters. column contains an additional nested structure called infusion, which describes the Ask Me configurations applied to each column, if any.
Property | Type | Description | Example |
---|---|---|---|
table | string | The name of the table where the column is located | CUSTOMERS1 |
column | string | The name of the column within the table | COMPANY_NAME |
dim | string | The dimension referenced in the table. | [CUSTOMERS1.COMPANY_NAME] |
datatype | string | Describes the column’s data type. The datatype can be a number, text or datetime. | datetime |
title | string | The title of the column as displayed to the user | Customer |
level | string | Defines the granularity of time. Only relevant for datetime data types. This property is optional. | days, months, quarters, years, weeks |
agg | string | Defines the aggregation applied to the column. Supported aggregations are count, sum and average This property is optional. | See JAQL docs (opens new window) |
filter | The filter parameter as defined by the JAQL syntax. This property is optional. | See JAQL docs (opens new window) | |
members | string | The values included in the filter argument. | members": [ "Andrew Green", "Ben Franklin", "Cormack Coyle" ] |
filterOnly | boolean | false | |
format | JaqlFormat of the column data. This property is optional. | See JAQL docs (opens new window) | |
sort | Describes the sort order. This property is optional. | asc |
# Example
{
table: string;
column: string;
dim: string;
datatype: number | text | datetime;
title: string;
level: days | months | quarters | years | weeks;
agg: AggType;
filter: JaqlFilter; (see JAQL docs)
Infusion: {
visible: boolean;
uid: boolean;
defaultMeasure: boolean;
defaultDate: boolean;
header: boolean;
hyperlink: string;
aliases: string[];
filterOnly: boolean;
}
format: [];
sort: asc | desc;
}
# Example
"columns": [
{
"table": "ORDERS1",
"dim": "[ORDERS1.ORDER_ID]",
"title": "ORDER_ID",
"column": "ORDER_ID",
"datatype": "number",
"filter": {
"explicit": true,
"multiSelection": true,
"members": [
"10002",
"10003",
"10004",
"10005"
]
},
"infusion": {
"filterOnly": false,
"uid": true
}
}
]
# infusion
infusion
is present or defined when Ask Me configurations (opens new window) are applied to a column within a Viewpoint. Generally, these configurations are named differently in the JSON, than in the UI. This sub-structure is optional, and should only be used if the Viewpoint is intended to be shared and used with Slack or Teams.
Property | Type | Description | Example |
---|---|---|---|
visible | boolean | This is a deprecated field. This may be shown, but do not rely on it. | |
uid | boolean | The field designated as the Unique Identifier. If defined, a filter must be added as a Filter field. A Viewpoint can have a maximum of one Unique Identifier. This property is optional. | true |
defaultMeasure | boolean | The field designated as the Default Measure. A Viewpoint can have a maximum of one Default Measure. This property is optional. | false |
defaultDate | boolean | The field designated as the Default Date. Only date fields can be selected as a Default Date. A Viewpoint can have a maximum of one Default Date. This property is optional. | true |
header | boolean | Column will display as a header in the response from the chatbot. This property is optional. | true |
members | string | The values included in the filter argument. | members: [ "Andrew Green", "Ben Franklin", "Cormack Coyle" ] |
uid | boolean | The unique id of the filter condition | true |
hyperlink | string | This is a deprecated field. This may be shown, but do not rely on it. | |
aliases | string | This is a deprecated field. This may be shown, but do not rely on it. | |
filterOnly | boolean | false |
# Example
Infusion: {
visible: boolean;
uid: boolean;
defaultMeasure: boolean;
defaultDate: boolean;
header: boolean;
hyperlink: string;
aliases: string[];
filterOnly: boolean;
}
# ViewpointVisibility
ViewpointVisibility
defines which Infusion Apps, user(s) and user group(s) (opens new window) the Viewpoint is visible to. When working with Viewpoints, sharing and publishing are two separate actions which can influence visibility.
A Viewpoint can be shared with Infusion Apps, users or user groups, but not be visible to them until published (UI) or enabled (API). See Sharing and Publishing a Viewpoint (opens new window) for more information.
When changing the visibility of a Viewpoint, the object must meet the minimum requirements:
- One or more Infusion Apps
- At least one User or one User Group
ViewpointVisibility
can be changed using the
property | Type | Description | Example |
---|---|---|---|
apps | string | The Infusion App(s) that the Viewpoint is shared with. | |
groups | string | The list of user groups that the Viewpoint is shared with. | Admins |
users | string | The list of individual users the Viewpoint is shared with | admin@sisense.com |
enabled | boolean | The visibility state of the Viewpoint | true |
# Example
"visibility": {
"apps": [
"Google",
"Slack",
"Teams",
"Office"
],
"groups": [
"Admins",
"Admins",
"6512cd64d01d6d001b49347a",
"6512cd64d01d6d001b493479"
],
"users": [
"admin@sisense.com",
"admin@sisense.com"
],
"enabled": true
}
# Infusion API Endpoints
Method | Path | Purpose |
---|---|---|
GET | /infusion/status | Returns the status of the Infusion Service. |
GET | /infusion/viewpoints | Returns a list of Viewpoints from an instance. |
GET | /infusion/viewpoints/{id} | Returns a single Viewpoint using a unique identifier. |
POST | /infusion/viewpoints | Creates a new Viewpoint. |
PUT | /infusion/viewpoints/{id} | Updates the contents of a Viewpoint. |
DELETE | /infusion/viewpoints/{id} | Deletes a Viewpoint and associated Bookmarks from all Infusion Apps. |
# GET infusion/status
This endpoint returns the status of the Infusion Service used by all Infusion Apps APIs. It provides a way to troubleshoot and verify if the service is working if Infusion Apps are experiencing issues.
This endpoint does not require authorization as it is just returning the status of the Infusion service. All other endpoints require authorization.
# Request Parameters
Parameter | Data Type | Description | Required | Example |
---|---|---|---|---|
x-tenent-id | header string | Used to define the Tenant ID on behalf of whom the operation will be executed. | No | 6512cd66d01d6d001b493488 |
authorization | header string | The user's API token preceded by the keyword Bearer (with space between it and the token). | No | "Bearer " + your token |
# Request URL
https://infusion-test.sisense.com/api/v1/infusion/status
# GET infusion/viewpoints
This endpoint returns an array of Viewpoints. The default response includes a total count of Viewpoints within an instance, ordered by id
. The request can include ViewpointSearch
, passed as an additional parameter, which can be used to return results matching the parameters.
# Request Parameters
Parameter | Data Type | Description | Required | Example |
---|---|---|---|---|
x-tenent-id | header string | Used to define the Tenant ID on behalf of whom the operation will be executed. | No | 6512cd66d01d6d001b493488 |
authorization | header string | The user's API token preceded by the keyword Bearer (with space between it and the token). | No | "Bearer " + your token |
search | query string | The search parameters that can be defined to return a sub-set of Viewpoints matching search parameters. See ViewpointsSearch. | No | {“name”: “e”, “description”: “a”, "text": "srch", “visibility”: [“Google”], “datasource”: { “fullname”: “local” }} |
with | query string | Request additional information in the response by defining a single parameter (visibility | details), or both parameters separated by a comma. Requesting visibility will return data from ViewpointVisibility, and requesting details will return data from ViewpointDetails. | No |
offset | query number | Determines the starting point for the response, skipping the number of offset records. | No | |
limit | query number | A limit on the number of objects to be returned. The default will return 100 rows. There is no limit to a minimum or maximum value. | No | 25 |
# Request URL
http://localhost:8080/api/v1/infusion/viewpoints?with=visibility,details&search=%7B%22text%22:%22%22%7D
# Request Example
https://infusion-test.sisense.com/api/v1/infusion/viewpoints?search=%7B%22text%22%3A%20%22s%22%2C%20%22visibility%22%3A%20%7B%22apps%22%3A%20%5B%22Google%22%5D%7D%2C%20%22details%22%3A%20%7B%22datasource%22%3A%20%7B%22fullname%22%3A%20%22local%22%7D%7D%7D&with=visibility%2Cdetails
# ViewpointSearch
ViewpointSearch can be passed as a search parameter when using the
# Request Parameters
Property | Type | Description | Example |
---|---|---|---|
name | string | Searches the text value in a Viewpoint name. Partial strings are accepted and will be matched. This value must be unique and is case sensitive. | Secure Fraud South |
description | string | Searches the text value in the description. Partial strings are accepted and will be matched. This value is case sensitive. | Includes suspicious patterns, transaction volumes, and anomalies. Data is filtered to the US-South region. |
text | string | Searches the text value in the name or description. Partial strings are accepted and will be matched. This value is case sensitive. | Secure Fraud South |
lastUpdate | object | Object includes two operators that can be passed individually or together. Timestamp and ISO datetime formats are supported. | {before: 1242341, after: 1112421} |
id | string | The unique identifier of the Viewpoint. | 6513fcdc03524c03b96bdfad |
details | object | A partial object with search parameters that can be passed | {"datasource": {"datasource": {fullname: "o"}}} |
visibility | object | A partial object. | {"apps":["Google"], enabled: true} |
# Example
{
id: String,
name: String,
description: String,
text: String
lastUpdate: {before: <date>, after:<date>}
visibility: ViewpointVisibility
details: ViewpointDetails
}
# GET infusion/viewpoints/{id}
This endpoint returns a single Viewpoint
object using its unique identifier. The response includes a comprehensive set of information related to the Viewpoint object, including the Viewpoint's details and permissions. The response will contain the entire Viewpoint object, including the ViewpointDetails and ViewpointVisibility.
# Request
GET api/v1/infusion/viewpoints/7554cd1ad8fd93cc9d6b5f05
# Request Parameters
Parameter | Data Type | Description | Required | Example |
---|---|---|---|---|
x-tenent-id | header string | Used to define the Tenant ID on behalf of whom the operation will be executed. | No | 6512cd66d01d6d001b493488 |
authorization | header string | The user's API token preceded by the keyword Bearer (with space between it and the token). | No | "Bearer " + your token |
id | path string | The unique identifier of the Viewpoint. | Yes | 7554cd1ad8fd93cc9d6b5f05 |
# PUT infusion/viewpoints/{id}
This endpoint updates a Viewpoint
using its unique identifier. It allows users to modify the Viewpoint
object.
If passing complex properties like DataSource, ViewpointDetails or ViewpointVisibility, these properties should be passed in full. For example, if you want to update a field title, you should pass full details objects with all columns (fields) where the required column title was changed.
# Request Parameters
Parameter | Data Type | Description | Required | Example |
---|---|---|---|---|
authorization | header string | The user's API token preceded by the keyword Bearer (with space between it and the token). | No | "Bearer " + your token |
id | path string | The unique identifier of the Viewpoint . | Yes | 6513fcdc03524c03b96bdfad |
x-tenent-id | header string | Used to define the Tenant ID on behalf of whom the operation will be executed. | No | 6512cd66d01d6d001b493488 |
# Request Body
PUT api/v1/infusion/viewpoints/6512cd66d01d6d001b493488
BODY:
{name: “Updated Name”}
# POST infusion/viewpoints
This endpoint allows users to create a new Viewpoint
within an instance. The
Note: The endpoint provides no validation on the contents of the object. This means that a Viewpoint may be created successfully, but contain errors when trying to be used by Infusion App end users.
On creation, Viewpoints will be in an unpublished status (opens new window) unless defined otherwise in the request body. A Viewpoint in Unpublished status is not visible to any Infusion Apps, users, or user groups. You must use the
ViewpointObject
, including ViewpointVisibility
where the ViewpointVisibility can be changed. # Request Parameters
Parameter | Data Type | Description | Required | Example |
---|---|---|---|---|
authorization | header string | The user's API token preceded by the keyword Bearer (with space between it and the token). | No | "Bearer " + your token |
Viewpoint | body string | A new Viewpoint object. | Yes | 6513fcdc03524c03b96bdfad |
x-tenent-id | header string | Used to define the Tenant ID on behalf of whom the operation will be executed. | No | 6512cd66d01d6d001b493488 |
# Viewpoint Properties
Parameter | Data Type | Description | Required | Example |
---|---|---|---|---|
name | string | The name of the Viewpoint. This value must be unique. | Yes | Secure Fraud South |
description | string | The description of the Viewpoint. | Yes | Includes suspicious patterns, transaction volumes, and anomalies. Data is filtered to the US-South region. |
details | object | See ViewpointDetails | No | |
visibility | object | See ViewpointVisibility | No |
# Request Body
{
"name": "string",
"description": "string",
"details": {},
"visibility": {}
}
# DELETE infusion/viewpoints/{id}
This endpoint allows users to delete a single Viewpoint
by providing its unique identifier. When a Viewpoint is deleted, its associated Bookmarks are also deleted. Deleted Viewpoints will be removed immediately and inaccesible by users in the Infusion Apps.
# Request Parameters
Parameter | Data Type | Description | Required | Example |
---|---|---|---|---|
authorization | header string | The user's API token preceded by the keyword Bearer (with space between it and the token). | No | "Bearer " + your token |
id | path string | The unique identifier of the Viewpoint. | Yes | 6513fcdc03524c03b96bdfad |
x-tenent-id | header string | Used to define the Tenant ID on behalf of whom the operation will be executed. | No | 6512cd66d01d6d001b493488 |