sisense.com

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.

PropertyTypeDescriptionExample
idstringThe unique identifier of the Viewpoint.6513fcdc03524c03b96bdfad
namestringThe 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
tenantIdstringThe id of the tenant the Viewpoint is associated with.6512cd66d01d6d001b493488
descriptionstringThe 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.
enabledbooleanThe status of the Viewpoint. When set to true, the Viewpoint is published.true
createdBystringThe userId of the user who created the Viewpoint6512cd65d01d6d001b49347b
updatedBystringThe userId of the user who updated the Viewpoint6512cd65d01d6d001b49347b
createdAttimedateThe time/date the Viewpoint was created2023-09-27T09:58:52.669Z
updatedAttimedateThe time/date that Viewpoint was updated2023-09-27T09:58:52.669Z
visibilityobjectDefines the visibility of the Viewpoint. See ViewpointVisibility
detailsobjectContains 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": ["[email protected]", "[email protected]"],
        "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 StructureDescription
datasourceDescribes the source of the tables and columns being referenced in the Viewpoint.
columnDescribes the columns, filters and metadata that is included in the Viewpoint.

ViewpointDetails can be:

  • Requested using the
    GETinfusion/viewpoints
    or
    GETinfusion/viewpoints/{id}
  • Created using
    POSTinfusion/viewpoints
  • Updated using the
    PUTinfusion/viewpoints/{id}
  • Deleted using
    DELETEinfusion/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.

PropertyTypeDescriptionExample
idstringThe id of the data source.localhost_aOrdersDB
titlestringThe title of the data source.OrdersDB
fullnamestringThe full name of the data source.localhost/OrdersDB
modelTypestringThe 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.

PropertyTypeDescriptionExample
tablestringThe name of the table where the column is locatedCUSTOMERS1
columnstringThe name of the column within the tableCOMPANY_NAME
dimstringThe dimension referenced in the table.[CUSTOMERS1.COMPANY_NAME]
datatypestringDescribes the column’s data type. The datatype can be a number, text or datetime.datetime
titlestringThe title of the column as displayed to the userCustomer
levelstringDefines the granularity of time. Only relevant for datetime data types. This property is optional.days, months, quarters, years, weeks
aggstringDefines the aggregation applied to the column. Supported aggregations are count, sum and average This property is optional.See JAQL docs
filterThe filter parameter as defined by the JAQL syntax. This property is optional.See JAQL docs
membersstringThe values included in the filter argument.members": [ "Andrew Green", "Ben Franklin", "Cormack Coyle" ]
filterOnlybooleanfalse
formatJaqlFormat of the column data. This property is optional.See JAQL docs
sortDescribes 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 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.

PropertyTypeDescriptionExample
visiblebooleanThis is a deprecated field. This may be shown, but do not rely on it.
uidbooleanThe 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
defaultMeasurebooleanThe field designated as the Default Measure. A Viewpoint can have a maximum of one Default Measure. This property is optional.false
defaultDatebooleanThe 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
headerbooleanColumn will display as a header in the response from the chatbot. This property is optional.true
membersstringThe values included in the filter argument.members: [ "Andrew Green", "Ben Franklin", "Cormack Coyle" ]
uidbooleanThe unique id of the filter conditiontrue
hyperlinkstringThis is a deprecated field. This may be shown, but do not rely on it.
aliasesstringThis is a deprecated field. This may be shown, but do not rely on it.
filterOnlybooleanfalse

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) 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 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

method.

propertyTypeDescriptionExample
appsstringThe Infusion App(s) that the Viewpoint is shared with.Google
groupsstringThe list of user groups that the Viewpoint is shared with.Admins
usersstringThe list of individual users the Viewpoint is shared with[email protected]
enabledbooleanThe visibility state of the Viewpointtrue

Example

"visibility": {
    "apps": [
      "Google",
      "Slack",
      "Teams",
      "Office"
    ],
    "groups": [
      "Admins",
      "Admins",
      "6512cd64d01d6d001b49347a",
      "6512cd64d01d6d001b493479"
    ],
    "users": [
      "[email protected]",
      "[email protected]"
    ],
    "enabled": true
  }

Infusion API Endpoints

MethodPathPurpose
GET/infusion/statusReturns the status of the Infusion Service.
GET/infusion/viewpointsReturns a list of Viewpoints from an instance.
GET/infusion/viewpoints/{id}Returns a single Viewpoint using a unique identifier.
POST/infusion/viewpointsCreates 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

ParameterData TypeDescriptionRequiredExample
x-tenent-idheader
string
Used to define the Tenant ID on behalf of whom the operation will be executed.No6512cd66d01d6d001b493488
authorizationheader
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 | with: “visibility” | | 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

method in order to return a sub-set of Viewpoints that match the search parameters.

Request Parameters

PropertyTypeDescriptionExample
namestringSearches 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
descriptionstringSearches 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.
textstringSearches the text value in the name or description. Partial strings are accepted and will be matched. This value is case sensitive.Secure Fraud South
lastUpdateobjectObject includes two operators that can be passed individually or together. Timestamp and ISO datetime formats are supported.{before: 1242341, after: 1112421}
idstringThe unique identifier of the Viewpoint.6513fcdc03524c03b96bdfad
detailsobjectA partial object with search parameters that can be passed{"datasource": {"datasource": {fullname: "o"}}}
visibilityobjectA 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

ParameterData TypeDescriptionRequiredExample
x-tenent-idheader
string
Used to define the Tenant ID on behalf of whom the operation will be executed.No6512cd66d01d6d001b493488
authorizationheader
string
The user's API token preceded by the keyword Bearer (with space between it and the token).No"Bearer " + your token
idpath
string
The unique identifier of the Viewpoint.Yes7554cd1ad8fd93cc9d6b5f05

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

ParameterData TypeDescriptionRequiredExample
authorizationheader
string
The user's API token preceded by the keyword Bearer (with space between it and the token).No"Bearer " + your token
idpath
string
The unique identifier of the Viewpoint.Yes6513fcdc03524c03b96bdfad
x-tenent-idheader
string
Used to define the Tenant ID on behalf of whom the operation will be executed.No6512cd66d01d6d001b493488

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

POSTinfusion/viewpoints
endpoint creates an empty Viewpoint, with name and description as required fields. The request body can contain a partial definition of the ViewpointObject.

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 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

PUTinfusion/viewpoints/{id}
to perform updates to the ViewpointObject, including ViewpointVisibility where the ViewpointVisibility can be changed.

Request Parameters

ParameterData TypeDescriptionRequiredExample
authorizationheader
string
The user's API token preceded by the keyword Bearer (with space between it and the token).No"Bearer " + your token
Viewpointbody
string
A new Viewpoint object.Yes6513fcdc03524c03b96bdfad
x-tenent-idheader
string
Used to define the Tenant ID on behalf of whom the operation will be executed.No6512cd66d01d6d001b493488

Viewpoint Properties

ParameterData TypeDescriptionRequiredExample
namestringThe name of the Viewpoint. This value must be unique.YesSecure Fraud South
descriptionstringThe description of the Viewpoint.YesIncludes suspicious patterns, transaction volumes, and anomalies. Data is filtered to the US-South region.
detailsobjectSee ViewpointDetailsNo
visibilityobjectSee ViewpointVisibilityNo

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

ParameterData TypeDescriptionRequiredExample
authorizationheader
string
The user's API token preceded by the keyword Bearer (with space between it and the token).No"Bearer " + your token
idpath
string
The unique identifier of the Viewpoint.Yes6513fcdc03524c03b96bdfad
x-tenent-idheader
string
Used to define the Tenant ID on behalf of whom the operation will be executed.No6512cd66d01d6d001b493488
Last Updated: