Create Visual

Create a chart, pivot or summary report in the specified workspace.

REQUEST URI

https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/reports

Post

oauthscope: ZohoAnalytics.modeling.create

QUERY PARAMETERS

 

Parameter Name
Description
CONFIG*JSONObject
Config parameter specifications are available in the below section.

FIELDS FOR CONFIG JSON

 

Key
Description
baseTableName*String
The name of the base table on which the report is created.
The table must exist in the workspace.
Length - 1 to 100 characters.

Sample: {"baseTableName":"Sales"}
title*String
The name of the report.
The name must be unique within the workspace.
Length - 1 to 100 characters.

Sample: {"title":"Sales by Region"}
descriptionString
The description of the report.
Maximum length - 250 characters.

Sample: {"description":"Comprehensive analysis of sales metrics across regions"}
folderIdLong
The ID of the folder in which the report is created.
The folder must exist in the workspace.
If not specified, the report is created at the workspace root.

Sample: {"folderId":207806000016595420}
reportType*String
The type of the report.
Supported values: "chart", "pivot", "summary"
Values are case-sensitive and must be in lowercase.

Sample: {"reportType":"chart"}
chartTypeString
The chart type of the report.
Supported values:
Area charts - "area", "area with points", "area without points", "smooth area", "smooth area with points", "smooth area without points", "stacked area", "stacked area with points", "stacked smooth area", "stacked smooth area with points", "stacked smooth area without points"
Bar charts - "bar", "horizontal bar", "stacked bar", "horizontal stacked bar"
Bubble charts - "bubble", "packed bubble"
Combo charts - "combo", "combo bar with smooth line"
Funnel and pyramid charts - "funnel", "pyramid"
Line charts - "line", "line with points", "line without points", "smooth line", "smooth line with points", "smooth line without points", "step"
Map charts - "map area", "map bubble", "map filled", "map pie", "map pie bubble", "map bubble pie", "map scatter", "geo heat map"
Pie and ring charts - "pie", "ring", "semi pie", "semi ring"
Scatter charts - "scatter"
Web charts - "web", "web with fill", "web without fill"
Heat maps - "heat map"
Other charts - "butterfly", "table chart"
Values must be in lowercase.
Ignored when reportType is "pivot" or "summary".
This attribute is mandatory when reportType is "chart".

Sample: {"chartType":"bar"}
isAxisMergeBoolean
Controls whether multiple Y-axes are merged into a single shared axis.
Supported values: "true", "false"
When true, mergeAxisInfo must be specified.

Sample: {"isAxisMerge":false}
mergeAxisInfoJSONObject
The Y-axis columns to merge and the label of the merged axis. Contains the following keys:
axisIndex (JSONArray of Integer) - The indexes of the Y-axis columns to merge. Minimum - 2 items.
labelName (String) - The label of the merged axis.
This attribute is mandatory when isAxisMerge is true.

Sample: {"mergeAxisInfo":{"axisIndex":[1,2],"labelName":"Sales and Profit"}}
axisColumns*JSONArray
The columns placed on the shelves of the report.
The supported shelves depend on the reportType.
Check the table Structure of axisColumns for more details.

Sample: {"axisColumns":[{"type":"xAxis","columnName":"Region","operation":"actual"},{"type":"yAxis","columnName":"Sales","operation":"sum"}]}
filtersJSONArray
The static filter criteria applied to the report.
Check the table Structure of filters for more details.

Sample: {"filters":[{"columnName":"Region","tableName":"Sales","operation":"actual","filterType":"individualvalues","values":["East"],"exclude":false}]}
userFiltersJSONArray
The interactive filters shown to viewers of the report.
Check the table Structure of userFilters for more details.

Sample: {"userFilters":[{"tableName":"Sales","columnName":"Product Category","operation":"actual","compType":"multiSelect","filterType":"individualvalues","isallval":false,"values":["Furniture","Grocery"],"exclude":false,"defaultFilterValues":["Furniture"],"behaviour":"ListAllValues"}]}

Structure of axisColumns

 

Key
Description
Column placement
type*String
The shelf on which the column is placed.
Supported values depend on the reportType.
For chart reports:
xAxis - The dimension axis of the chart.
yAxis - The measure axis of the chart. Maximum - 15 columns.
textAxis - The text label axis, used by certain chart types.
colorAxis - The color axis of the chart. Must not be used along with multiple yAxis columns.
sizeAxis - The size axis, used by bubble charts.
For pivot reports:
row - The row grouping of the pivot.
column - The column grouping of the pivot.
data - The measure of the pivot. Requires an aggregate operation.
For summary reports:
groupBy - The dimension grouping of the summary. The column must be a dimension (non-numeric) column. Maximum - 20 columns.
summarize - The measure of the summary. Requires a numeric aggregate operation.

Sample: {"type":"xAxis"}
columnName*String
The name of the column to place on the shelf.
Maximum length - 100 characters.

Sample: {"columnName":"Region"}
tableNameString
The name of the table that contains the column.
Maximum length - 100 characters.
This attribute is mandatory when the column belongs to a joined (lookup) table. It can be omitted when the column belongs to the base table.

Sample: {"tableName":"Sales"}
operation*String
The aggregation or date grouping function applied to the column.
Supported values depend on the column data type:
Numeric columns (positive integer, decimal, number) - "sum", "max", "min", "avg", "std", "count", "dc", "actual", "geo"
Plain text, email, URL and multi-line columns - "actual", "count", "dc", "geo"
Date columns - "actual", "year", "quarteryear", "monthyear", "weekyear", "fulldate", "datetime", "quarter", "month", "week", "weekday", "day", "hour", "count", "dc"
Aggregate operations ("sum", "avg", "std") cannot be applied to date or text columns. Date operations ("year", "month" and so on) cannot be applied to numeric or text columns.
"geo" can be applied to plain text columns with a categorical geoRole, or to numeric columns with a numeric geoRole ("latitude", "longitude").

Sample: {"operation":"sum"}
Display options
displayNameString
The display label of the column in the report.
Maximum length - 250 characters.

Sample: {"displayName":"Sales Region"}
sortString
The sort order of the column.
Supported values: "asc", "desc"

Sample: {"sort":"asc"}
Grouping and calculations
rangeSizeDouble
The bin size for range grouping on a numeric column.
The value must be a number, not a string or an array.

Sample: {"rangeSize":5.0}
windowFunctionJSONObject
The window (running or moving) calculation applied to a yAxis column.
Check the table windowFunction sub-keys for more details.

Sample: {"windowFunction":{"type":"runningTotal"}}
geoRoleString
The geographic role of the column.
Supported values:
Numeric columns - "latitude", "longitude"
Plain text columns - "continent", "country", "state", "province", "county", "district", "city", "zipcode", "airport"
Only one categorical "geo" operation is allowed per report, and it must be on the xAxis. One numeric "geo" operation is allowed per axis (X or Y).
This attribute is applicable only when operation is "geo".

Sample: {"geoRole":"country"}

Note: In a pivot report, the data shelf requires an aggregate operation (for example, "sum" or "count"), and the row and column shelves use dimension operations (for example, "actual" or "year"). In a summary report, groupBy shelves use dimension operations and summarize shelves use aggregate operations.

windowFunction sub-keys

 

Key
Description
typeString
The window function to apply.
Supported values: "runningTotal", "runningAvg", "runningMin", "runningMax", "runningCount", "difffrom", "pctdifffrom", "movingcalc"
baseFieldString
The name of the reference column.
This key is mandatory when type is "difffrom", "pctdifffrom" or "movingcalc".
baseTableString
The name of the table that contains the baseField column.
baseFieldPositionString
The shelf of the reference column, for example "xAxis".
baseFunctionString
The operation applied to the baseField column.
movingCalculationJSONObject
The settings of the moving calculation. Contains the following keys:
calculation (String)
previous (Integer)
next (Integer)
includeCurrent (Boolean)
includeNull (Boolean)
This key is mandatory when type is "movingcalc".

Structure of filters

 

Key
Description
Filter column
columnName*String
The name of the column to filter on.

Sample: {"columnName":"Region"}
tableNameString
The name of the table that contains the column.
Recommended when the column belongs to a joined table.

Sample: {"tableName":"Sales"}
operation*String
The operation applied to the column before the filter criteria is evaluated, for example "actual", "year" or "seasonal".
Supported values depend on the column data type. Check the operation key in the table Structure of axisColumns for more details.

Sample: {"operation":"actual"}
Filter criteria
filterType*String
The type of filter criteria.
Supported values: "individualValues", "range", "ranking", "rankingPct", "year", "quarteryear", "monthyear", "weekyear", "fulldate", "date", "datetime", "dateRange", "quarter", "month", "week", "weekDay", "day", "hour", "wildcard"
The supported value depends on the operation and the column data type.
Check the table Filter Type Reference for more details.

Sample: {"filterType":"individualvalues"}
values*JSONArray
The filter criteria values, as an array of strings.
The format depends on the filterType.
Check the table Filter Type Reference for more details.

Sample: {"values":["East"]}
exclude*Boolean
Controls whether the listed values are excluded or included.
Supported values: "true", "false"
The value must be a boolean, not a string.
When true, the filter excludes the listed values. When false, the filter includes them.

Sample: {"exclude":false}
Ranking and wildcard options
rankingColumnString
The measure column that drives the rank.
Applicable when filterType is "ranking" or "rankingPct".

Sample: {"rankingColumn":"Sales"}
rankingColumnDateSubTypeString
The date sub-type of the ranking column, for example "year".

Sample: {"rankingColumnDateSubType":"year"}
wildcardJSONObject
The wildcard criteria of the filter.
Applicable when filterType is "wildcard".
Check the table wildcard sub-keys for more details.

Sample: {"wildcard":{"criteria":[{"operation":"CONTAINS","value":"East"}],"expression":"1"}}

wildcard sub-keys

 

Key
Description
criteriaJSONArray
The list of wildcard conditions. Each condition contains the following keys:
operation (String) - Supported values: "CONTAINS", "DOES_NOT_CONTAIN", "IS", "IS_NOT", "STARTS_WITH", "DOES_NOT_START_WITH", "ENDS_WITH", "DOES_NOT_END_WITH"
value (String) - The value to match.
expressionString
The logical combination of the conditions, using their position numbers with AND and OR.

Sample: {"expression":"1 AND 2 OR 3"}

Structure of userFilters

 

Key
Description
Filter column
columnName*String
The name of the column to show as a user filter.

Sample: {"columnName":"Product Category"}
tableName*String
The name of the table that contains the column.

Sample: {"tableName":"Sales"}
operation*String
The filter operation.
Supported values depend on the column data type:
Dimension columns - "actual"
Measure columns - "sum", "max", "min", "avg", "std", "count", "dc", "actual"
Date columns - "actual", "dateRange", "relative", "seasonal"

Sample: {"operation":"actual"}
Widget and criteria
compTypeString
The widget type of the user filter.
Supported values depend on the column data type:
Dimension columns - "singleSelect", "multiSelect"
Measure columns - "slider", "multiSelect"
Date columns - "singleSelect", "multiSelect"
This attribute is mandatory for all operations except "dateRange", and must not be specified for "dateRange".

Sample: {"compType":"multiSelect"}
filterTypeString
The type of filter criteria.
Supported values depend on the column data type and operation:
Measure columns - "individualValues", "range", "ranking", "rankingPct"
Date columns with "actual" operation - "year", "quarteryear", "monthyear", "weekyear", "fulldate", "datetime", "quarter", "month", "week", "date"
Date columns with "seasonal" operation - "quarter", "month", "week", "weekday", "day", "hour"
Date columns with "relative" operation - "common"
This attribute is mandatory for measure columns and for date columns with "actual" or "seasonal" operation. It is not required for dimension columns, and must not be specified for "dateRange".
Check the table Filter Type Reference for more details.

Sample: {"filterType":"individualvalues"}
Values and defaults
isallvalBoolean
Controls whether the user filter shows all values by default.
Supported values: "true", "false"
Default value - true when values is absent or empty, false when values has items.

Sample: {"isallval":false}
valuesJSONArray
The values available or pre-selected in the filter widget, as an array of strings. Use numbers for the "slider" widget of measure columns.
The format depends on the filterType.
This attribute is mandatory when isallval is false.
Check the table Filter Type Reference for more details.

Sample: {"values":["Furniture","Grocery"]}
defaultFilterValuesJSONArray
The values selected when the report loads, as an array of strings.
The values must be a subset of values.

Sample: {"defaultFilterValues":["Furniture"]}
excludeBoolean
Controls whether the user filter excludes the selected values by default.
Supported values: "true", "false"
The value must be a boolean.

Sample: {"exclude":false}
Display behavior
behaviourString
Controls how the filter widget lists its selectable values.
Supported values: "ListAllValues", "ListRelevantValues", "ListOnlyRelevantValues"
Not applicable for "dateRange" or "relative" operations. Specifying it for these operations returns error 8008.

Sample: {"behaviour":"ListAllValues"}

Note: If isallval is not specified, it is set to false when values has items, and to true when values is absent or empty. When isallval is true and values is not empty, isallval takes priority.

Note: Numeric filter values must match the stored value exactly, without rounding. For example, if the stored value is 0.89123, use 0.89123 and not 0.9.

Note: For the "dateRange" operation, values must be a single-item array in the format "DD Mon YYYY to DD Mon YYYY", for example ["18 May 2020 to 24 May 2025"].

Note: For the "relative" operation, filterType must be "common". Sample values: "This Year", "Last Month", "Last 2 Years". Custom ranges in the format "Last N <unit>" or "Next N <unit>" are supported.

Note: User filter values follow the same formats as static filters. Check the table Filter Type Reference for more details.

Filter Type Reference

 

Filter Type
Description
individualValuesApplicable to - Numeric (actual), Text (actual).
Sample values: ["100", "200"], ["East", "West"]
rangeApplicable to - Numeric (actual).
Sample values: "1000 and below", "200000 to 300000", "500000 and above"
rankingApplicable to - Numeric (actual).
Sample values: "Top 2", "Top 5", "Bottom 10"
yearApplicable to - Date (actual).
Sample values: "2012", "2023"
quarteryearApplicable to - Date (actual).
Sample values: "Q1 2020", "Q2 2023"
monthyearApplicable to - Date (actual).
Sample values: "Aug 2012", "Jan 2013". Use 3-letter month abbreviations only.
weekyearApplicable to - Date (actual).
Sample values: "W03 2012", "W02 2023"
fulldate / dateApplicable to - Date (actual).
Sample values: "27 Jan, 2023", "20 Mar, 2023". Use 3-letter month abbreviations only.
datetimeApplicable to - Date (actual).
Sample values: "27 Jan 2023 00:00:00", "21 Dec 2023 00:00:01"
dateRangeApplicable to - Date (range).
Sample values: "from 10 Dec 2013 00:00:00", "10 Mar 2012 00:00:00 to 10 Dec 2012 00:00:00", "to 11 Mar 2013 00:00:00"
quarterApplicable to - Date (seasonal).
Sample values: "Q1", "Q2", "Q3", "Q4"
monthApplicable to - Date (seasonal).
Sample values: "Jan", "Feb", and so on to "Dec"
weekApplicable to - Date (seasonal).
Sample values: "Week 2", "Week 3"
weekDayApplicable to - Date (seasonal).
Sample values: "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
dayApplicable to - Date (seasonal).
Sample values: "01", "15", "31"
hourApplicable to - Date (seasonal).
Sample values: "10", "13", "23"
wildcardApplicable to - Text (actual).
Requires the wildcard object. Check the table wildcard sub-keys for more details.

Sample Request:

Copiedcurl "https://analyticsapi.zoho.com/restapi/v2/workspaces/35130000001055707/reports" -X 'POST' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>' --data-urlencode 'CONFIG={"baseTableName":"Sales","title":"Sales by Region","description":"Comprehensive analysis of sales metrics across regions","reportType":"chart","chartType":"bar","axisColumns":[{"type":"xAxis","columnName":"Region","operation":"actual"},{"type":"yAxis","columnName":"Sales","operation":"sum"}]}'
Copiedusing System;
using System.Collections.Generic;
using System.Text.Json;
using ZohoAnalytics;

namespace ZohoAnalyticsTest
{
    class Program
    {
        long orgId = 55522777;
        long workspaceId = 35130000001055707;

        public void CreateReport(IAnalyticsClient ac)
        {
            Dictionary<string, object> config = JsonSerializer.Deserialize<Dictionary<string, object>>("{\"baseTableName\":\"Sales\",\"title\":\"Sales by Region\",\"description\":\"Comprehensive analysis of sales metrics across regions\",\"reportType\":\"chart\",\"chartType\":\"bar\",\"axisColumns\":[{\"type\":\"xAxis\",\"columnName\":\"Region\",\"operation\":\"actual\"},{\"type\":\"yAxis\",\"columnName\":\"Sales\",\"operation\":\"sum\"}]}");
            IWorkspaceAPI workspace = ac.GetWorkspaceInstance(orgId, workspaceId);
            long result = workspace.CreateReport(config);
            Console.WriteLine(result);
        }

        static void Main(string[] args)
        {
            string clientId = "1000.xxxxxxx";
            string clientSecret = "xxxxxxx";
            string refreshToken = "1000.xxxxxxx.xxxxxxx";
            IAnalyticsClient ac = new AnalyticsClient(clientId, clientSecret, refreshToken);
            Program obj = new Program();
            obj.CreateReport(ac);
        }
    }
}
Copiedpackage main

import (
    "fmt"
    ZAnalytics "zoho/pkg/analyticsclient"
)

var (
    clientId = "1000.xxxxxxx"
    clientSecret = "xxxxxxx"
    refreshToken = "1000.xxxxxxx.xxxxxxx"
    orgId = "55522777"
    workspaceId = "35130000001055707"
)

func CreateReport(ac ZAnalytics.Client) {
    config := map[string]interface{}{
        "baseTableName": "Sales",
        "title": "Sales by Region",
        "description": "Comprehensive analysis of sales metrics across regions",
        "reportType": "chart",
        "chartType": "bar",
        "axisColumns": []interface{}{
            map[string]interface{}{
                "type": "xAxis",
                "columnName": "Region",
                "operation": "actual",
            },
            map[string]interface{}{
                "type": "yAxis",
                "columnName": "Sales",
                "operation": "sum",
            },
        },
    }
    workspace := ZAnalytics.GetWorkspaceInstance(&ac, orgId, workspaceId)
    result, exception := workspace.CreateReport(config)
    if exception != nil {
        fmt.Println(exception.ErrorMessage)
        return
    }
    fmt.Println(result)
}

func main() {
    ac := ZAnalytics.GetAnalyticsClient(clientId, clientSecret, refreshToken)
    CreateReport(ac)
}
Copiedimport com.zoho.analytics.client.*;
import org.json.*;

public class Test {
    private long orgId = 55522777l;
    private long workspaceId = 35130000001055707l;

    public static void main(String args[]) {
        String clientId = "1000.xxxxxxx";
        String clientSecret = "xxxxxxx";
        String refreshToken = "1000.xxxxxxx.xxxxxxx";
        Test tObj = new Test();
        AnalyticsClient ac = new AnalyticsClient(clientId, clientSecret, refreshToken);
        try {
            tObj.createReport(ac);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

    public void createReport(AnalyticsClient ac) throws Exception {
        JSONObject config = new JSONObject("{\"baseTableName\":\"Sales\",\"title\":\"Sales by Region\",\"description\":\"Comprehensive analysis of sales metrics across regions\",\"reportType\":\"chart\",\"chartType\":\"bar\",\"axisColumns\":[{\"type\":\"xAxis\",\"columnName\":\"Region\",\"operation\":\"actual\"},{\"type\":\"yAxis\",\"columnName\":\"Sales\",\"operation\":\"sum\"}]}");
        WorkspaceAPI workspace = ac.getWorkspaceInstance(orgId, workspaceId);
        long result = workspace.createReport(config);
        System.out.println(result);
    }
}
Copied<?php
require 'AnalyticsClient.php';

class Test {
    public $ac;
    public $org_id = "55522777";
    public $workspace_id = "35130000001055707";

    function __construct() {
        $this->ac = new AnalyticsClient("1000.xxxxxxx", "xxxxxxx", "1000.xxxxxxx.xxxxxxx");
    }

    function createReport() {
        $config = array(
            "baseTableName" => "Sales",
            "title" => "Sales by Region",
            "description" => "Comprehensive analysis of sales metrics across regions",
            "reportType" => "chart",
            "chartType" => "bar",
            "axisColumns" => array(
                array(
                    "type" => "xAxis",
                    "columnName" => "Region",
                    "operation" => "actual"
                ),
                array(
                    "type" => "yAxis",
                    "columnName" => "Sales",
                    "operation" => "sum"
                )
            )
        );
        $workspace = $this->ac->getWorkspaceInstance($this->org_id, $this->workspace_id);
        $response = $workspace->createReport($config);
        print_r($response);
    }
}

$obj = new Test();
$obj->createReport();
?>
Copiedfrom AnalyticsClient import AnalyticsClient

class Config:
    CLIENTID = "1000.xxxxxxx"
    CLIENTSECRET = "xxxxxxx"
    REFRESHTOKEN = "1000.xxxxxxx.xxxxxxx"
    ORGID = "55522777"
    WORKSPACEID = "35130000001055707"

class Sample:
    ac = AnalyticsClient(Config.CLIENTID, Config.CLIENTSECRET, Config.REFRESHTOKEN)

    def create_report(self, ac):
        config = {
            "baseTableName": "Sales",
            "title": "Sales by Region",
            "description": "Comprehensive analysis of sales metrics across regions",
            "reportType": "chart",
            "chartType": "bar",
            "axisColumns": [
                {
                    "type": "xAxis",
                    "columnName": "Region",
                    "operation": "actual"
                },
                {
                    "type": "yAxis",
                    "columnName": "Sales",
                    "operation": "sum"
                }
            ]
        }
        workspace = ac.get_workspace_instance(Config.ORGID, Config.WORKSPACEID)
        result = workspace.create_report(config)
        print(result)

obj = Sample()
obj.create_report(obj.ac)
Copiedvar analyticsClient = require('./AnalyticsClient');
var ac = new analyticsClient('1000.xxxxxxx', 'xxxxxxx', '1000.xxxxxxx.xxxxxxx');
var orgId = '55522777';
var workspaceId = '35130000001055707';

var config = {
    "baseTableName": "Sales",
    "title": "Sales by Region",
    "description": "Comprehensive analysis of sales metrics across regions",
    "reportType": "chart",
    "chartType": "bar",
    "axisColumns": [
        {
            "type": "xAxis",
            "columnName": "Region",
            "operation": "actual"
        },
        {
            "type": "yAxis",
            "columnName": "Sales",
            "operation": "sum"
        }
    ]
};
var workspace = ac.getWorkspaceInstance(orgId, workspaceId);
workspace.createReport(config).then((result) => { console.log(result); }).catch((error) => { console.log(error); });
CopiedorgId = "55522777";
workspaceId = "35130000001055707";
headersMap = Map();
headersMap.put("ZANALYTICS-ORGID", orgId);
xAxisCol = Map();
xAxisCol.put("type", "xAxis");
xAxisCol.put("columnName", "Region");
xAxisCol.put("operation", "actual");
yAxisCol = Map();
yAxisCol.put("type", "yAxis");
yAxisCol.put("columnName", "Sales");
yAxisCol.put("operation", "sum");
axisColumns = List();
axisColumns.add(xAxisCol);
axisColumns.add(yAxisCol);
config = Map();
config.put("baseTableName", "Sales");
config.put("title", "Sales by Region");
config.put("description", "Comprehensive analysis of sales metrics across regions");
// Allowed values for reportType: "chart", "pivot", "summary"
config.put("reportType", "chart");
// Allowed values for chartType: see the supported chart types reference
config.put("chartType", "bar");
config.put("axisColumns", axisColumns);
parameters = "CONFIG=" + zoho.encryption.urlEncode(config.toString());
response = invokeurl
[
  url :"https://analyticsapi.zoho.com/restapi/v2/workspaces/" + workspaceId + "/reports"
  type :POST
  parameters:parameters
  headers:headersMap
  connection:"analytics_oauth_connection"
];
info response;
Copiedrequire 'zoho_analytics_client'

class Config
  ORGID = "55522777"
  WORKSPACEID = "35130000001055707"
end

class Sample
  def initialize
    @ac = AnalyticsClient.new.with_data_center("US").with_oauth({
      "clientId" => "1000.xxxxxxx",
      "clientSecret" => "xxxxxxx",
      "refreshToken" => "1000.xxxxxxx.xxxxxxx"
    }).build
  end

  def create_report
    config = {
      "baseTableName" => "Sales",
      "title" => "Sales by Region",
      "description" => "Comprehensive analysis of sales metrics across regions",
      "reportType" => "chart",
      "chartType" => "bar",
      "axisColumns" => [
        {
          "type" => "xAxis",
          "columnName" => "Region",
          "operation" => "actual"
        },
        {
          "type" => "yAxis",
          "columnName" => "Sales",
          "operation" => "sum"
        }
      ]
    }
    workspace = @ac.get_workspace_instance(Config::ORGID, Config::WORKSPACEID)
    result = workspace.create_report(config)
    puts result
  end
end

obj = Sample.new
obj.create_report

Download client libraries:  C# | GO | JAVA | PHP | PYTHON | NodeJS | Ruby

Sample value for CONFIG parameter:

Copied{
  "baseTableName": "Sales",
  "title": "Sales by Region",
  "description": "Comprehensive analysis of sales metrics across regions",
  "reportType": "chart",
  "chartType": "bar",
  "axisColumns": [
    {
      "type": "xAxis",
      "columnName": "Region",
      "operation": "actual"
    },
    {
      "type": "yAxis",
      "columnName": "Sales",
      "operation": "sum"
    }
  ]
}

Sample Response:

CopiedHTTP/1.1 200 OK
Content-Type:application/json;charset=UTF-8

{
  "status": "success",
  "summary": "Create analysis view",
  "data": {
    "viewId": "207806000016661147"
  }
}