Zoho Analytics
ACCESS ZOHO ANALYTICS
Pricing Contact Us
Did you find what you were looking for? Yes | No
NAV
CURL C# GO JAVA PHP PYTHON NODE JS DELUGE

Introduction

The Zoho Analytics API allows you to perform most of the operations that you do with our web client.

Zoho Analytics API is built using REST principles, which ensures predictable URLs that make writing applications easy. This API follows HTTP rules, enabling a wide range of HTTP clients can be used to interact with the API.

Every resource is exposed as a URL. The URL of each resource can be obtained by accessing the API Root Endpoint.

Easy to use programming language wrappers called “Client Libraries“ are provided to conveniently use the Zoho Analytics API from within your familiar programming language like Java, C#, Python, PHP, GO and NodeJS.

API Specification

Zoho Analytics API uses HTTP as the underlying transport protocol. It is based on REST principles. The following are the basic points of how the REST APIs are structured:

It is important to understand the API specification clearly before referring to the actual API methods.


Server URI

The following server URI are available for Zoho Analytics. Choose the server URI based on your data centre.

Data Centre ZohoAnalytics_Server_URI ZohoAccounts_Server_URI DeveloperConsole
US
(United States)
analyticsapi.zoho.com accounts.zoho.com api-console.zoho.com
EU
(Europe)
analyticsapi.zoho.eu accounts.zoho.eu api-console.zoho.eu
IN
(India)
analyticsapi.zoho.in accounts.zoho.in api-console.zoho.in
AU
(Australia)
analyticsapi.zoho.com.au accounts.zoho.com.au api-console.zoho.com.au
CN
(China)
analyticsapi.zoho.com.cn accounts.zoho.com.cn api-console.zoho.com.cn
JP
(Japan)
analyticsapi.zoho.jp accounts.zoho.jp api-console.zoho.jp


Request Format

Sample Request:

Copy
curl https://analyticsapi.zoho.com/restapi/v2/workspaces --data-urlencode 'CONFIG={ "workspaceName":"<workspace-name>" }' -X 'POST' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

All API requests should be placed as HTTPS requests. A request consists of the following components:

URI

The URI of each resource can be obtained by accessing the API Root Endpoint.

Sample: https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces

Config to be passed in Query String

The following snippet shows the config that should be passed as query string with the URI defined above.

https://<end_point>?CONFIG={"workspaceName":"<workspace-name>"}

Authorization Using OAuth 2.0

Access token have to be passed in the header for authorization purpose in the format given below.

Authorization: Zoho-oauthtoken <access_token>

Organization ID

Zoho Analytics Organization


For every organization in Zoho Analytics an unique ID (Organization ID) is present. The header “ZANALYTICS-ORGID“ with the 'Organization ID' should be sent with the API request to identify the organization.

ZANALYTICS-ORGID: <organization_id>

Using Get Organizations API the list of all accessible organizations can be obtained.


Note: In case of importing CSV or JSON files, multipart/form-data format should be used. (This is the default format used by HTML forms that contain file type fields used for uploading files.)


Response Format

Sample Response:

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

{
    "status": "success",
    "summary": "Create workspace",
    "data": {
        "workspaceId": "1767024000003145002"
    }
}

Zoho Analytics supports JSON response format for APIs. CSV, JSON, XML, PDF, HTML and Image response formats are supported only for Export API.

Note: See this link for response formats in case of errors on API execution.

Formats such as CSV, PDF can be specified only for EXPORT API. These formats don’t have any generic parseable header/footer. See this link for more details about these formats.


Error handling

Sample Error:

HTTP/1.1 400 Bad Request
Content-Type:application/json;charset=UTF-8

{
    "status": "failure",
    "summary": "META_DBNAME_DUPLICATE",
    "data": {
        "errorCode": 7101,
        "errorMessage": "Workspace with the same name exists already. Provide an alternate name"
    }
}

API execution could result in Error conditions. In such cases, follow the below steps to identify an error condition and handle the same:


Applying Filter Criteria

Example


(( "Sales"."Region"='East' and "Sales"<1000) or ("Sales"."Region"='West'
and "Sales"<2000))

Sample


A sample delete request that deletes all the rows that match the criteria 
"Sales"."Region"='East' is given below.

URL:


https://analyticsapi.zoho.com/restapi/v2/workspaces/1767025050053160012/views/1769024500004160002/rows?CONFIG={"criteria":"\"Sales\".\"Region\"='East'"}

Zoho Analytics API allows you to apply filter criteria while you execute the various actions. On applying a criteria, the action will be performed only on the data that matches the given filter criteria.

You can apply criteria as part of the following API actions:

The filter criteria has to be passed as a JSON attribute named “criteria“ in the API request.

Format

The filter criteria that is passed as part of the request, should follow the same format as that of the SQL SELECT WHERE clause.

The generalized format of a simple criteria is given below:

(<columnname/SQL expression/SQL function calls> <relational operator> <value/column name/SQL expression/SQL function calls>)

On using criteria for views which involves multiple tables having the same column name, the criteria should append with the table name to avoid name mismatch.

<tablename>.<columnname> <relational operator> <value/column name/SQL expression/SQL function calls>

Description

The criteria follows the SQL SELECT WHERE condition like format. You could also use SQL in-built functions as part of the criteria. These built-in functions should be the functions supported by any of Oracle, MS SQL Server, MySQL, DB2, Sybase, ANSI SQL, Informix and PostgreSQL databases.

Name Description
column name Refers to the column name of your table or query table on which you are applying a criteria.
SQL Expression You could provide any valid SQL Expression.
The above expression subtracts the value in the “Cost” column from the value in the “Sales” column. You could use any of the Arithmetic operators supported in an SQL SELECT WHERE clause.
Supported Arithmetic Operators: +, -, *, /
SQL Function call Oracle, MS SQL Server, MySQL, DB2, Sybase, ANSI SQL, Informix and PostgreSQL databases
Eg.: year(date_column) = 2008 .
Note: All supported in-built function from different databases will be documented soon.
relational operator This could be any of the relational operators supported in an SQL SELECT WHERE clause.
Supported Relational Operators:
  • =
  • !=
  • <
  • >
  • <=
  • >=
  • LIKE
  • NOT LIKE
  • IN
  • NOT IN
  • BETWEEN
  • value Refers to the exact value to match.
    Eg.: "Department" = 'Finance'
    here 'Finance' is a literal value to match.

    NOTES FOR CRITERIA FORMATION:

    Refer to the SQL SELECT WHERE clause documentation of any database that we support, to know more on how to construct the filter criteria.

    View this link for more details about how to construct a custom date format.

    Authentication

    Zoho Analytics REST API supports OAuth 2.0 protocol to authorize and authenticate API calls. Follow the steps listed here to use OAuth 2.0 protocol in Zoho Analytics APIs.


    Registering New Client

    Follow the below steps to register with Zoho's Developer console.

    1. Visit DeveloperConsole and click GET STARTED.
    2. Choose Client Type that suits your application type. Zoho Analytics
      • Client-based Applications: Applications that are built to run exclusively on browsers independent of web servers.
      • Server-based Applications: Web-based applications that are built to run with a dedicated HTTP server.
        NOTE:Server-based applications are chosen when your application is used by multiple users and requires user intervention during authorization.
      • Mobile-based Applications: Applications that are built to run on smartphones and tablets.
      • Non-browser Applications: Applications that run on devices without browsers such as smart TVs and printers.
      • Self Client: For standalone server-side application performing a back-end job, and you do not have a domain and a redirect URL.
        NOTE:Self Client type is recommended for users using ZohoAnalytics UploadTool and ZohoAnalytics Client Libraries.
    3. After choosing the client type, provide the required details and click 'Create'.

    On successful registration, you will be provided with a set of OAuth 2.0 credentials such as <Client_ID> and <Client_Secret> that will be only known to Zoho and your application. (Do not share this credentials anywhere.)


    Generating Code

    After generating <Client_ID> and <Client_Secret>, a grant code has to be generated. Based on the client type the code can be generated in two ways.


    Self Client Method

    Save this code and continue to step 3.


    Redirect Method

    
    The below URL is used to generate code.
    
    https://accounts.zoho.com/oauth/v2/auth?scope=<SCOPE>&client_id=<CLIENT_ID>&state=testing&response_type=code&redirect_uri=<REDIRECT_URI>&access_type=offline&prompt=consent
    


    Generating Tokens

    REFRESH TOKEN

    Refresh token is used to obtain new access tokens. This token has an unlimited lifetime, it can be revoked manually.

    ACCESS TOKEN

    A token that is sent to the resource server to access the protected resources of the user. Each access token will be valid only for an hour, and can be used only for the set of operations that is described in the scope.

    After generating the code, a POST request has to be made for the following URI, with the params given below, to generate refresh_token and access_token.

    POST https://<ZohoAccounts_Server_URI>/oauth/v2/token

    
    The below URL is used to generate access token and refresh token.
    
    https://accounts.zoho.com/oauth/v2/token?code=<CODE>&client_id=<CLIENT_ID>&client_secret=<CLIENT_SECRET>&redirect_uri=<REDIRECT_URI>&grant_type=authorization_code
    
    Parameter Name Description
    code* <code> which is obtained in the above step (Step 2)
    client_id* <client_id> obtained during Client Registration (Step 1)
    client_secret* <client_secret> obtained during Client Registration (Step 1)
    redirect_uri This param should be same redirect url mentioned while adding Client (Step 1).
    This param is not required when self client application type is choosen during Client Registration (Step 1).
    grant_type* authorization_code (provide this literal string as value)
    scope Scope (scope is nothing but a permission to access specific API) for which the token to be generated. Multiple scopes can be given, separated by commas.
    Example: ZohoAnalytics.data.all,ZohoAnalytics.modeling.create
    Refer: available scopes
    state An opaque string that is round-tripped in the protocol; that is to say, value will be passed back to the user.

    Note: Fields with * are mandatory

    1. The <access_token> will expire after an hour.

    2. The <refresh_token> is permanent and will be used to regenerate new <access_token>, if the current access token expired.

    NOTE: Each time a re-consent page is accepted, a new refresh token is generated. The maximum limit is 20 refresh tokens per user. If this limit is crossed, the first refresh token is automatically deleted to accommodate the latest one. This is done irrespective of whether the first refresh token is in use or not. (You can manually delete a refresh token by revoke request.)


    Refreshing Access Tokens

    Access Tokens have limited validity, which expires in an hour. Once the access_token expires, user (or) the app will have to use the refresh token to request for a new access token. On using an expired access token, the request terminates throwing Invalid Oauthtoken.

    NOTE: A client can create up to ten access tokens in a span of ten minutes, using a refresh token. If the limit is reached, the access token creation will be blocked for the next ten minutes.

    The following POST URI with the params given below, generates a new access token.

    POST https://<ZohoAccounts_Server_URI>/oauth/v2/token

    
    The below URL is used to Generating Access Token From Refresh Token.
    
    https://accounts.zoho.com/oauth/v2/token?refresh_token=<REFRESH_TOKEN>&client_id=<CLIENT_ID>&client_secret=<CLIENT_SECRET>&redirect_uri=<REDIRECT_URI>&grant_type=refresh_token
    
    Parameter Name Description
    refresh_token* <refresh_token> which is obtained in the above step (Step 3)
    client_id* <client_id> obtained during Client Registration (Step 1)
    client_secret* <client_secret> obtained during Client Registration (Step 1)
    redirect_uri This param should be same redirect url mentioned while registering Client (Step 1).
    This param is not required when self client application type is choosen during Client Registration (Step 1).
    grant_type* refresh_token (provide this literal string as value)

    Calling an API using OAuth authentication

    Access Token can be passed only in header and cannot be passed in the request param.


    Revoking a Refresh Token

    You may choose to revoke a refresh token manually, when you no longer need access for a particular scope.

    Call the following POST URL with the given params to revoke a refresh token.

    POST https://<ZohoAccounts_Server_URI>/oauth/v2/token/revoke

    Request Example

    
    The below URL is used to revoke the refresh token.
    
    https://accounts.zoho.com/oauth/v2/token/revoke?token=<REFRESH_TOKEN>
    
    Parameter Name Description
    token <refresh_token> which is to be revoked


    SCOPE

    Zoho Analytics APIs use selected scopes, which control the type of API's that the client application (or) end user can access. Tokens are usually created with specific scopes to restrict it from acceessing other API's. For example, you can generate a scope to create a view (or) to view metadata and so on. Scopes contain three parameters — service name, scope name, and operation type.

    List of scopes available in Zoho Analytics :

    Scope Description
    data To access data related APIs
    Availabe Scopes: ZohoAnalytics.data.read, ZohoAnalytics.data.delete, ZohoAnalytics.data.update, ZohoAnalytics.data.create, ZohoAnalytics.data.all
    modeling To access modeling related APIs
    Availabe Scopes: ZohoAnalytics.modeling.delete, ZohoAnalytics.modeling.update, ZohoAnalytics.modeling.create, ZohoAnalytics.modeling.all
    metadata To access metadata related APIs
    Availabe Scopes: ZohoAnalytics.metadata.read, ZohoAnalytics.metadata.all
    share To access sharing related APIs
    Availabe Scopes: ZohoAnalytics.share.delete, ZohoAnalytics.share.read, ZohoAnalytics.share.create, ZohoAnalytics.share.all
    embed To access embed related APIs
    Availabe Scopes: ZohoAnalytics.embed.read, ZohoAnalytics.embed.all
    usermanagement To access usermanagement related APIs
    Availabe Scopes: ZohoAnalytics.usermanagement.read, ZohoAnalytics.usermanagement.delete, ZohoAnalytics.usermanagement.update, ZohoAnalytics.usermanagement.create, ZohoAnalytics.usermanagement.all
    fullaccess To access all ZohoAnalytics APIs
    Availabe Scope: ZohoAnalytics.fullaccess.all

    Data API

    Data APIs are used to perform addition, update, deletion, bulk import of the Zoho Analytics table data. It also offers APIs to export your tables, reports, dashboards in PDF, Excel, JSON, HTML, Image, and CSV formats.


    Add Row

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/views/<view-id>/rows?CONFIG=<encoded_json_value> -X 'POST' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "columns": { "<column-name1>": "<column-value1>", "<column-name2>": "<column-value2>" } }

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Add row",
        "data": {
            "addedColumns": {
                "region": "East",
                "Sales": "1000"
            },
            "invalidColumns": {}
        }
    }
    

    Add a single row in the specified table.

    request uri

    POST https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/views/<view-id>/rows

    oauthscope: ZohoAnalytics.data.create

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    columns* JSONObject

    JSONObject with column name as key and data as value.

    Sample: {"columnName1":"value1","columnName2":"value2"}
    dateFormat String

    Specify this in-case any date field is being added and its format cannot be auto recognized.

    Sample: dd-MMM-YYYY
    Refer this link for more details about how to construct a custom date format.

    Possible Error Codes

    7103 , 7138 , 7507 , 7511 , 8016 , 8504 , 8506 , 8516


    Update Row

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/views/<view-id>/rows?CONFIG=<encoded_json_value> -X 'PUT' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "columns": { "<column-name1>": "<column-value1>", "<column-name2>": "<column-value2>" }, "criteria": "\"<table-name>\".\"<column-name>\"='value'" }

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Update row",
        "data": {
            "updatedColumns": {
                "region": "East",
                "Sales": "1000"
            },
            "updatedRows": 27,
            "invalidColumns": {}
        }
    }
    

    Update rows in the specified table.

    request uri

    PUT https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/views/<view-id>/rows

    oauthscope: ZohoAnalytics.data.update

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    columns* JSONObject

    JSONObject with column name as key and data as value.

    Sample: {"columnName1":"value1","columnName2":"value2"}
    criteria String

    If criteria is sent, then the rows matching the criteria alone are updated.

    Sample: {"criteria":"\"SalesTable\".\"Region\"='East'"}
    Refer this link for more details about how to construct a criteria.
    updateAllRows Boolean

    To update all the rows in the table.
    dateFormat String

    Specify this in-case any date field is being added and its format cannot be auto recognized.

    Sample: dd-MMM-YYYY
    Refer this link for more details about how to construct a custom date format.

    Possible Error Codes

    7103 , 7138 , 8002 , 8004 , 8504 , 8506 , 8516


    Delete Row

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/views/<view-id>/rows?CONFIG=<encoded_json_value> -X 'DELETE' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "criteria": "\"<table-name>\".\"<column-name>\"='value'" }

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Delete row",
        "data": {
            "deletedRows": 27
        }
    }
    

    Delete rows in the specified table.

    request uri

    DELETE https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/views/<view-id>/rows

    oauthscope: ZohoAnalytics.data.delete

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    criteria String

    If criteria is sent, then the rows matching the criteria alone are deleted.

    Sample: {"criteria":"\"SalesTable\".\"Region\"='East'"}
    Refer this link for more details about how to construct a criteria.
    deleteAllRows Boolean

    To delete all the rows in the table.

    Possible Error Codes

    7103 , 7138 , 7507 , 8002 , 8004 , 8016 , 8504 , 8506 , 8516


    Error codes in Data API

    Sample Error:

    HTTP/1.1 400 Bad Request
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "failure",
        "summary": "API_NO_COLUMN_PRESENT",
        "data": {
            "errorCode": 8016,
            "errorMessage": "You need to have atleast one column for INSERT or UPDATE action"
        }
    }
    

    This section lists all possible error codes that could be sent from the Zoho Analytics server on failure of Data APIs. You can use this for appropriate error handling.

    Error Codes

    Error-Code Reason Solution
    7103 The workspace id mentioned in the API URL does not exist. Check the workspace id in the request URL and provide a valid Workspace id.
    7138 The view id mentioned in the API URL does not exist. Check the view id in the request URL and provide a valid view id.
    7235 Not even a single column name provided in source file matches with the column data in table. Check whether the column name in source data matches with column names present in analytics table.
    NOTE:Also check whether the config fileType is provided with proper value.
    7507 Value entered in the mentioned column does not follow the specified data-type. Check the value of that column and provide value in the specified data-type.
    7511 Mentioned Column is a mandatory column. Should specify the value for that mandatory column.
    8002 Specified criteria is invalid. Provide valid criteria.
    8004 The column mentioned in the criteria is not present in the table. Check the column name and provide valid name.
    8016 You need to have at-least one column for INSERT or UPDATE action. You should provide at-least one column with value.
    8504 The required parameter is not proper or has not been sent. Send the parameter with valid data.
    8506 The mentioned parameter has been sent more than the required count. Check and remove that extra parameter mentioned in the response.
    8516 Invalid value passed in the mentioned parameter. Provide the valid data to the mentioned parameter.

    In case of any error other than the above said, mail the API request URL parameters and error response details to support@zohoanalytics.com. Zoho Analytics Team will get back to you with the best possible solution.

    Bulk API

    Bulk APIs are used to import bulk data into Zoho Analytics table and also offers APIs to export your tables, reports, dashboards in PDF, Excel, JSON, HTML, Image, and CSV formats.


    Import Data

    Import the provided bulk data in a new table (or) an existing table.


    In New Table

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/data?CONFIG=<encoded_json_value> -F 'FILE=@/home/local/import.csv' -X 'POST' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "tableName": "<table-name>", "fileType": "csv", "autoIdentify": "true" }

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Import data",
        "data": {
            "viewId": "1767024000003153002",
            "importSummary": {
                "importType": "APPEND",
                "totalColumnCount": 7,
                "selectedColumnCount": 7,
                "totalRowCount": 101,
                "successRowCount": 101,
                "warnings": 0,
                "importOperation": "created"
            },
            "columnDetails": {
                "Date": "Date",
                "Region": "Plain Text",
                "Product Category": "Plain Text",
                "Product": "Plain Text",
                "Customer Name": "Plain Text",
                "Sales": "Currency",
                "Cost": "Currency"
            },
            "importErrors": ""
        }
    }
    

    Create a new table and import data on the same.

    request uri

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

    oauthscope: ZohoAnalytics.data.create

    ACTION SPECIFIC PARAMETERS

    Parameter Name Description
    FILE (or) DATA* FILE - The file to be imported.

    • In the case of importing files multipart/form-data format should be used. (This is the default format used by html forms that contain file type fields used for uploading files)
    • Maximum allowed file size is 20 MB.


    DATA - The string to be imported.

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    tableName* String

    The name of the table.
    fileType* String

    The format of the file to be imported.
    • csv
    • json
    autoIdentify* Boolean

    To specify whether to auto identify the CSV format.
    onError String

    Controls the action to be taken incase there is an error during import.
    • abort - Incase of any error, abort the whole import.
    • skiprow - In case of any error, skip that specific row(s) which has the problem and continue importing the rest.
    • setcolumnempty - In case of any error, set the value of the error column for the row to empty and continue importing.
    selectedColumns JSONArray

    Controls the columns that need to be imported.

    Sample: ["column1","column2"]
    skipTop Integer

    Number of rows that are to be skipped from the top in the CSV file being imported.
    thousandSeparator Integer

    Controls the action to be taken in case there is a thousand separator in the data.
    • 0 - COMMA
    • 1 - DOT
    • 2 - SPACE
    • 3 - SINGLE QUOTE
    decimalSeparator Integer

    Controls the action to be taken in case there is a decimal separator in the data.
    • 0 - DOT
    • 1 - COMMA
    dateFormat String

    Specify this in-case any date field is being imported and its format cannot be auto recognized by Zoho Analytics.

    Sample: dd-MMM-YYYY
    Refer this link for more details about how to construct a custom date format.
    columnDateFormat JSONObject

    Specify this in case multiple date fields are being imported having different format each.
    Column name as key and date format as value.

    Sample: {"columnName1":"dd-MMM-YYYY","columnName2":"MM/dd/yyyy"}

    CSV Specific Attributes

    Note : These attributes are mandatory if autoIdentify is set to false.

    Key Description
    commentChar Char

    If the character mentioned is found at the beginning of the row, the csv row will be skipped.

    Sample: #
    delimiter Integer

    The delimiter character used for separating the fields in a row in the CSV.
    • 0 - COMMA
    • 1 - TAB
    • 2 - SEMICOLON
    • 3 - SPACE
    quoted Integer

    The Text Qualifier.
    • 0 - NONE
    • 1 - SINGLE QUOTE
    • 2 - DOUBLE QUOTE

    JSON Specific Attributes

    Key Description
    retainColumnNames Boolean

    Controls how the columns names are to be constructed from the JSON file.
    Default value - false.
    • true - the final key attribute alone will be considered as column name.
    • false - the column name will be constructed by appending all the parent attributes separated by dot (.). This will result in column names which captures the full JSON tree hierarchy eg., employee.Name, employee.Department

    Possible Error Codes

    7103 , 7111 , 7232 , 7248 , 7249 , 8046 , 8119 , 8504 , 8506 , 8513 , 8516


    In Existing Table

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/views/<view-id>/data?CONFIG=<encoded_json_value> -F 'FILE=@/home/local/import.csv' -X 'POST' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "importType": "append", "fileType": "csv", "autoIdentify": "true" }

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Import data",
        "data": {
            "importSummary": {
                "importType": "APPEND",
                "totalColumnCount": 7,
                "selectedColumnCount": 7,
                "totalRowCount": 755,
                "successRowCount": 755,
                "warnings": 0,
                "importOperation": "updated"
            },
            "columnDetails": {
                "Date": "Date",
                "Region": "Plain Text",
                "Product Category": "Plain Text",
                "Product": "Plain Text",
                "Customer Name": "Plain Text",
                "Sales": "Currency",
                "Cost": "Currency"
            },
            "importErrors": ""
        }
    }
    

    Import data in the specified table.

    request uri

    POST https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/views/<view-id>/data

    oauthscope: ZohoAnalytics.data.create

    ACTION SPECIFIC PARAMETERS

    Parameter Name Description
    FILE (or) DATA* FILE - The file to be imported.
    • In the case of importing files multipart/form-data format should be used. (This is the default format used by html forms that contain file type fields used for uploading files)
    • Maximum allowed file size is 20 MB.

    DATA - The string to be imported.

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    importType* String

    Controls the type of import.
    • append - Appends the data into the table.
    • truncateadd - Deletes all exisiting rows in the table and adds the imported data as new entry.
    • updateadd - Updates the row if the mentioned column values are matched, else a new entry will be added.
    fileType* String

    The format of the file to be imported.
    • csv
    • json
    autoIdentify* Boolean

    To specify whether to auto identify the CSV format.
    onError String

    Controls the action to be taken incase there is an error during import.
    • abort - Incase of any error, abort the whole import.
    • skiprow - In case of any error, skip that specific row(s) which has the problem and continue importing the rest.
    • setcolumnempty - In case of any error, set the value of the error column for the row to empty and continue importing.
    matchingColumns
    (mandatory only when the importType is updateadd)
    JSONArray

    The values in the columns to be matched will be used for comparison to check whether data row(s) being imported matches with an existing row(s) in the table.
    The existing rows in the table that match will be updated with values from data imported. The remaining rows are appended to the table as new rows.

    Sample: ["column1","column2"]
    selectedColumns JSONArray

    Controls the columns that need to be imported.

    Sample: ["column1","column2"]
    skipTop Integer

    Number of rows that are to be skipped from the top in the CSV file being imported.
    thousandSeparator Integer

    Controls the action to be taken in case there is a thousand separator in the data.
    • 0 - COMMA
    • 1 - DOT
    • 2 - SPACE
    • 3 - SINGLE QUOTE
    decimalSeparator Integer

    Controls the action to be taken in case there is a decimal separator in the data.
    • 0 - DOT
    • 1 - COMMA
    dateFormat String

    Specify this in-case any date field is being imported and its format cannot be auto recognized by Zoho Analytics.

    Sample: dd-MMM-YYYY
    Refer this link for more details about how to construct a custom date format.
    columnDateFormat JSONObject

    Specify this in case multiple date fields are being imported having different format each.
    Column name as key and date format as value.

    Sample: {"columnName1":"dd-MMM-YYYY","columnName2":"MM/dd/yyyy"}

    CSV Specific Attributes

    Note : These attributes are mandatory if autoIdentify is set to false.

    Key Description
    commentChar Char

    If the character mentioned is found at the beginning of the row, the csv row will be skipped.

    Sample: #
    delimiter Integer

    The delimiter character used for separating the fields in a row in the CSV.
    • 0 - COMMA
    • 1 - TAB
    • 2 - SEMICOLON
    • 3 - SPACE
    quoted Integer

    The Text Qualifier.
    • 0 - NONE
    • 1 - SINGLE QUOTE
    • 2 - DOUBLE QUOTE

    JSON Specific Attributes

    Note : These attributes are mandatory if autoIdentify is set to false.

    Key Description
    retainColumnNames Boolean

    Controls how the columns names are to be constructed from the JSON file.
    Default value - false.
    • true - the final key attribute alone will be considered as column name.
    • false - the column name will be constructed by appending all the parent attributes separated by dot (.). This will result in column names which captures the full JSON tree hierarchy eg., employee.Name, employee.Department

    Possible Error Codes

    7103 , 7138 , 7232 , 7248 , 7249 , 8046 , 8119 , 8504 , 8506 , 8513 , 8516


    Import Data (Asynchronous)

    Import the provided bulk data in a new table (or) an existing table in asynchronous manner.

    Work flow of Asynchronous Import API is as follows:


    Limitations:


    Create Import Job

    Create an import job for importing the provided data in a new table (or) an existing table.


    For New Table

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/bulk/workspaces/<workspace-id>/data?CONFIG=<encoded_json_value> -F 'FILE=@/home/local/import.csv' -X 'POST' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "tableName": "<table-name>", "fileType": "csv", "autoIdentify": "true" }

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Create bulk import job",
        "data": {
            "jobId": "1767024000003153087"
        }
    }
    

    Create an import job to import data in a new table.

    request uri

    POST https://<ZohoAnalytics_Server_URI>/restapi/v2/bulk/workspaces/<workspace-id>/data

    oauthscope: ZohoAnalytics.data.create

    ACTION SPECIFIC PARAMETERS

    Parameter Name Description
    FILE* File

    The file to be imported.

    • Format should be multipart/form-data. (This is the default format used by html forms that contain file type fields used for uploading files)
    • Maximum allowed file size is 100 MB.

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    tableName* String

    The name of the table.
    fileType* String

    The format of the file to be imported.
    • csv
    • json
    autoIdentify* Boolean

    To specify whether to auto identify the CSV format.
    onError String

    Controls the action to be taken incase there is an error during import.
    • abort - Incase of any error, abort the whole import.
    • skiprow - In case of any error, skip that specific row(s) which has the problem and continue importing the rest.
    • setcolumnempty - In case of any error, set the value of the error column for the row to empty and continue importing.
    selectedColumns JSONArray

    Controls the columns that need to be imported.

    Sample: ["column1","column2"]
    skipTop Integer

    Number of rows that are to be skipped from the top in the CSV file being imported.
    thousandSeparator Integer

    Controls the action to be taken in case there is a thousand separator in the data.
    • 0 - COMMA
    • 1 - DOT
    • 2 - SPACE
    • 3 - SINGLE QUOTE
    decimalSeparator Integer

    Controls the action to be taken in case there is a decimal separator in the data.
    • 0 - DOT
    • 1 - COMMA
    dateFormat String

    Specify this in-case any date field is being imported and its format cannot be auto recognized by Zoho Analytics.

    Sample: dd-MMM-YYYY
    Refer this link for more details about how to construct a custom date format.
    columnDateFormat JSONObject

    Specify this in case multiple date fields are being imported having different format each.
    Column name as key and date format as value.

    Sample: {"columnName1":"dd-MMM-YYYY","columnName2":"MM/dd/yyyy"}
    callbackUrl String

    A valid URL, that should allow HTTP Post method.
    The Bulk Import Job's details is posted to this URL on successful completion of job or on failure of job.

    CSV Specific Attributes

    Note : These attributes are mandatory if autoIdentify is set to false.

    Key Description
    commentChar Char

    If the character mentioned is found at the beginning of the row, the csv row will be skipped.

    Sample: #
    delimiter Integer

    The delimiter character used for separating the fields in a row in the CSV.
    • 0 - COMMA
    • 1 - TAB
    • 2 - SEMICOLON
    • 3 - SPACE
    quoted Integer

    The Text Qualifier.
    • 0 - NONE
    • 1 - SINGLE QUOTE
    • 2 - DOUBLE QUOTE

    JSON Specific Attributes

    Key Description
    retainColumnNames Boolean

    Controls how the columns names are to be constructed from the JSON file.
    Default value - false.
    • true - the final key attribute alone will be considered as column name.
    • false - the column name will be constructed by appending all the parent attributes separated by dot (.). This will result in column names which captures the full JSON tree hierarchy eg., employee.Name, employee.Department

    Possible Error Codes

    7103 , 7111 , 7232 , 7248 , 7249 , 8046 , 8119 , 8504 , 8506 , 8513 , 8516


    For Existing Table

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/bulk/workspaces/<workspace-id>/views/<view-id>/data?CONFIG=<encoded_json_value> -F 'FILE=@/home/local/import.csv' -X 'POST' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "importType": "append", "fileType": "csv", "autoIdentify": "true" }

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Create bulk import job",
        "data": {
            "jobId": "1757024000003153087"
        }
    }
    

    Create an import job to import data in the specified table.

    request uri

    POST https://<ZohoAnalytics_Server_URI>/restapi/v2/bulk/workspaces/<workspace-id>/views/<view-id>/data

    oauthscope: ZohoAnalytics.data.create

    ACTION SPECIFIC PARAMETERS

    Parameter Name Description
    FILE* File

    The file to be imported.

    • Format should be multipart/form-data. (This is the default format used by html forms that contain file type fields used for uploading files)
    • Maximum allowed file size is 100 MB.

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    importType* String

    Controls the type of import.
    • append - Appends the data into the table.
    • truncateadd - Deletes all exisiting rows in the table and adds the imported data as new entry.
    • updateadd - Updates the row if the mentioned column values are matched, else a new entry will be added.
    fileType* String

    The format of the file to be imported.
    • csv
    • json
    autoIdentify* Boolean

    To specify whether to auto identify the CSV format.
    onError String

    Controls the action to be taken incase there is an error during import.
    • abort - Incase of any error, abort the whole import.
    • skiprow - In case of any error, skip that specific row(s) which has the problem and continue importing the rest.
    • setcolumnempty - In case of any error, set the value of the error column for the row to empty and continue importing.
    matchingColumns
    (mandatory only when the importType is updateadd)
    JSONArray

    The values in the columns to be matched will be used for comparison to check whether data row(s) being imported matches with an existing row(s) in the table.
    The existing rows in the table that match will be updated with values from data imported. The remaining rows are appended to the table as new rows.

    Sample: ["column1","column2"]
    selectedColumns JSONArray

    Controls the columns that need to be imported.

    Sample: ["column1","column2"]
    skipTop Integer

    Number of rows that are to be skipped from the top in the CSV file being imported.
    thousandSeparator Integer

    Controls the action to be taken in case there is a thousand separator in the data.
    • 0 - COMMA
    • 1 - DOT
    • 2 - SPACE
    • 3 - SINGLE QUOTE
    decimalSeparator Integer

    Controls the action to be taken in case there is a decimal separator in the data.
    • 0 - DOT
    • 1 - COMMA
    dateFormat String

    Specify this in-case any date field is being imported and its format cannot be auto recognized by Zoho Analytics.

    Sample: dd-MMM-YYYY
    Refer this link for more details about how to construct a custom date format.
    columnDateFormat JSONObject

    Specify this in case multiple date fields are being imported having different format each.
    Column name as key and date format as value.

    Sample: {"columnName1":"dd-MMM-YYYY","columnName2":"MM/dd/yyyy"}
    callbackUrl String

    A valid URL, that should allow HTTP Post method.
    The Bulk Import Job's details is posted to this URL on successful completion of job or on failure of job.

    CSV Specific Attributes

    Note : These attributes are mandatory if autoIdentify is set to false.

    Key Description
    commentChar Char

    If the character mentioned is found at the beginning of the row, the csv row will be skipped.

    Sample: #
    delimiter Integer

    The delimiter character used for separating the fields in a row in the CSV.
    • 0 - COMMA
    • 1 - TAB
    • 2 - SEMICOLON
    • 3 - SPACE
    quoted Integer

    The Text Qualifier.
    • 0 - NONE
    • 1 - SINGLE QUOTE
    • 2 - DOUBLE QUOTE

    JSON Specific Attributes

    Note : These attributes are mandatory if autoIdentify is set to false.

    Key Description
    retainColumnNames Boolean

    Controls how the columns names are to be constructed from the JSON file.
    Default value - false.
    • true - the final key attribute alone will be considered as column name.
    • false - the column name will be constructed by appending all the parent attributes separated by dot (.). This will result in column names which captures the full JSON tree hierarchy eg., employee.Name, employee.Department

    Possible Error Codes

    7103 , 7111 , 7138 , 7232 , 7248 , 7249 , 8046 , 8119 , 8504 , 8506 , 8513 , 8516


    Get Import Job Details

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/bulk/workspaces/<workspace-id>/importjobs/<job-id> -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Fetch import job info",
        "data": {
            "jobId": "1767024000003153087",
            "jobCode": "1004",
            "jobStatus": "JOB COMPLETED",
            "jobInfo": {
                "viewId": "1767024000003154002",
                "importSummary": {
                    "importType": "APPEND",
                    "totalColumnCount": 7,
                    "selectedColumnCount": 7,
                    "totalRowCount": 755,
                    "successRowCount": 755,
                    "warnings": 0,
                    "importOperation": "created"
                },
                "columnDetails": {
                    "Date": "Date",
                    "Region": "Plain Text",
                    "Product Category": "Plain Text",
                    "Product": "Plain Text",
                    "Customer Name": "Plain Text",
                    "Sales": "Currency",
                    "Cost": "Currency"
                },
                "importErrors": ""
            },
            "expiryTime": "1623764592309"
        }
    }
    

    Returns details of the specified import job.

    request uri

    GET https://<ZohoAnalytics_Server_URI>/restapi/v2/bulk/workspaces/<workspace-id>/importjobs/<job-id>

    oauthscope: ZohoAnalytics.data.create

    Possible Error Codes

    7103 , 8137 , 8138


    Export Data

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/views/<view-id>/data?CONFIG=<encoded_json_value> -X 'GET' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "responseFormat": "csv" }

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:text/csv;charset=UTF-8
    
    Date,Region,Product,Customer Name,Sales
    "15 June, 2021",East,Cereals,Vincent Herbert,682.39
    "15 June, 2021",West,Clocks,John Britto,$272.34
    "15 June, 2021",Central,Art Supplies,Susan Juliet,$45.31
    

    Export data from the specified view.

    request uri

    GET https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/views/<view-id>/data

    oauthscope: ZohoAnalytics.data.read

    Note: Export Data API is restricted for certain resources ( given below ). For the same kindly use Asynchronous Export APIs for exporting data.
    • Tables having more than one million rows.
    • Tables and Views from live connect workspaces.
    • Dashboard and Querytable view types.

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    responseFormat* String

    The format of the data to be exported.
    • csv
    • json
    • xml
    • pdf
    • html
    • image
    criteria String

    If criteria is sent, then the rows matching the criteria alone are exported.

    Sample: {"criteria":"\"SalesTable\".\"Region\"='East'"}
    Refer this link for more details about how to construct a criteria.
    selectedColumns JSONArray

    Controls the columns that need to be exported.

    Sample: ["column1","column2"]
    showHiddenCols Boolean

    Controls whether the columns that have been hidden in the table have to be exported.
    Default value - false.
    showPersonalCols Boolean

    Controls whether the columns that have been marked as personal data in the table have to be exported.
    Default value - false.
    generateTOC Boolean

    To generate Table Of Contents.Only for dashboards
    Default value - false.
    dashboardLayout Integer

    Layout type of the dashboard to be exported.Only for dashboards
    • 0 - For Each Report in New Page
    • 1 - For Layout as in Dashboard

    CSV Specific Attributes

    Key Description
    delimiter Integer

    The delimiter character used for separating the fields in a row in the CSV.
    • 0 - COMMA
    • 1 - TAB
    • 2 - SEMICOLON
    • 3 - SPACE
    recordDelimiter Integer

    The record delimiter (newline character) to use.
    • 0 - DOS
    • 1 - UNIX
    • 2 - MAC
    quoted Integer

    The quote character to use for quoting the values.
    • 0 - SINGLE
    • 1 - DOUBLE
    includeHeader Boolean

    To include the column names in the first row of the CSV exported.
    Default value - true.

    JSON Specific Attributes

    Key Description
    keyValueFormat Boolean

    To return JSON data as ColumnName - Value pair.
    Default value - true.

    PDF Specific Attributes

    Key Description
    paperSize Integer

    The size of the paper.
    • 0 - LETTER
    • 1 - LEGAL
    • 2 - TABLOID
    • 3 - A3
    • 4 - A4
    • 5 - AUTO
    paperStyle String

    To controls the orientation.
    Portrait/Landscape
    showTitle Integer

    To controls the title positioning.
    • 0 - AT TOP
    • 1 - AT BOTTOM
    • 2 - NONE
    showDesc Integer

    To controls the description positioning.
    • 0 - AT TOP
    • 1 - AT BOTTOM
    • 2 - NONE
    exportLanguage Integer

    PDF will be rendered using the specified language.
    • 0 - ENGLISH
    • 1 - CHINESE
    • 2 - JAPANESE
    • 3 - EUROPEAN
    • 4 - KOREAN

    Default value - 0 (ENGLISH).
    zoomfactor Integer

    To control the zoom factor for the PDF.
    0 to 100
    Default value - 100.
    Margin Settings:
    topMargin
    bottomMargin
    leftMargin
    rightMargin
    Float

    The margin in inches for that edge. Can be decimal between 0 to 1 (like 0.5).
    Header/Footer Settings:
    leftHeader
    rightHeader
    centerHeader
    leftFooter
    rightFooter
    centerFooter
    Integer

    The header or footer value that needs to be generated for each page at that particular position.
    • 0 - Leave it blank
    • 1 - Include Title
    • 2 - Current Date/Time
    • 3 - Include Page number in the format “Page #”
    • 4 - Include page number in the format “Page # Of #”
    • 5 - CUSTOM - Include custom text in footer
    Custom Header/Footer value
    leftHeaderText
    rightHeaderText
    centerHeaderText
    leftFooterText
    rightFooterText
    centerFooterText
    String

    If any of the header/footer setting is 5 (.ie, CUSTOM) then the corresponding custom value/text should be passed.

    HTML Specific Attributes

    Key Description
    includeTitle Integer

    To contol the title positioning.
    Default value - 0.
    • 0 - AT TOP
    • 1 - AT BOTTOM
    • 2 - NONE
    includeDesc Integer

    To contol the description positioning.
    Default value - 0.
    • 0 - AT TOP
    • 1 - AT BOTTOM
    • 2 - NONE

    IMAGE Specific Attributes

    Key Description
    width Integer

    The width of the image.
    Default value - 500.
    height Integer

    The height of the image.
    Default value - 400.
    title Boolean

    To include the view name in the exported view.
    Default value - true.
    description Boolean

    To include the view description in the exported view.
    Default value - true.
    legend Boolean

    Controls whether the legend is to be included in the image generated.
    Default value - true.
    imageFormat String

    The format of the exported image.
    png/jpg
    Default value - png.

    Possible Error Codes

    7103 , 7138 , 8002 , 8046 , 8119 , 8504


    Export Data (Asynchronous)

    Export a large set of data from tables/reports in asynchronous manner.

    Work flow of Bulk Export API is as follows:


    Limitations:


    Create Export Job

    Create an export job for exporting data from a single view (or) use SQL queries to export data by joining multiple tables.


    Using View ID

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/bulk/workspaces/<workspace-id>/views/<view-id>/data?CONFIG=<encoded_json_value> -X 'GET' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "responseFormat": "csv" }

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Create bulk export job",
        "data": {
            "jobId": "35130000001381001"
        }
    }
    

    Create an export job to initiate data export for the mentioned view.

    request uri

    GET https://<ZohoAnalytics_Server_URI>/restapi/v2/bulk/workspaces/<workspace-id>/views/<view-id>/data

    oauthscope: ZohoAnalytics.data.read

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    responseFormat* String

    The format of the data to be exported.
    • csv
    • json
    • xml
    • pdf
    • html
    • image
    criteria String

    If criteria is sent, then the rows matching the criteria alone are exported.

    Sample: {"criteria":"\"SalesTable\".\"Region\"='East'"}
    Refer this link for more details about how to construct a criteria.
    selectedColumns JSONArray

    Controls the columns that need to be exported.

    Sample: ["column1","column2"]
    showHiddenCols Boolean

    Controls whether the columns that have been hidden in the table have to be exported.
    Default value - false.
    showPersonalCols Boolean

    Controls whether the columns that have been marked as personal data in the table have to be exported.
    Default value - false.
    generateTOC Boolean

    To generate Table Of Contents.Only for dashboards
    Default value - false.
    dashboardLayout Integer

    Layout type of the dashboard to be exported.Only for dashboards
    • 0 - For Each Report in New Page
    • 1 - For Layout as in Dashboard
    callbackUrl String

    A valid URL, that should allow HTTP Post method.
    The Bulk Export Job's details is posted to this URL on successful completion of job or on failure of job.

    CSV Specific Attributes

    Key Description
    delimiter Integer

    The delimiter character used for separating the fields in a row in the CSV.
    • 0 - COMMA
    • 1 - TAB
    • 2 - SEMICOLON
    • 3 - SPACE
    recordDelimiter Integer

    The record delimiter (newline character) to use.
    • 0 - DOS
    • 1 - UNIX
    • 2 - MAC
    quoted Integer

    The quote character to use for quoting the values.
    • 0 - SINGLE
    • 1 - DOUBLE
    includeHeader Boolean

    To include the column names in the first row of the CSV exported.
    Default value - true.

    JSON Specific Attributes

    Key Description
    keyValueFormat Boolean

    To return JSON data as ColumnName - Value pair.
    Default value - true.

    PDF Specific Attributes

    Key Description
    paperSize Integer

    The size of the paper.
    • 0 - LETTER
    • 1 - LEGAL
    • 2 - TABLOID
    • 3 - A3
    • 4 - A4
    • 5 - AUTO
    paperStyle String

    To controls the orientation.
    Portrait/Landscape
    showTitle Integer

    To controls the title positioning.
    • 0 - AT TOP
    • 1 - AT BOTTOM
    • 2 - NONE
    showDesc Integer

    To controls the description positioning.
    • 0 - AT TOP
    • 1 - AT BOTTOM
    • 2 - NONE
    exportLanguage Integer

    PDF will be rendered using the specified language.
    • 0 - ENGLISH
    • 1 - CHINESE
    • 2 - JAPANESE
    • 3 - EUROPEAN
    • 4 - KOREAN

    Default value - 0 (ENGLISH).
    zoomfactor Integer

    To control the zoom factor for the PDF.
    0 to 100
    Default value - 100.
    Margin Settings:
    topMargin
    bottomMargin
    leftMargin
    rightMargin
    Float

    The margin in inches for that edge. Can be decimal between 0 to 1 (like 0.5).
    Header/Footer Settings:
    leftHeader
    rightHeader
    centerHeader
    leftFooter
    rightFooter
    centerFooter
    Integer

    The header or footer value that needs to be generated for each page at that particular position.
    • 0 - Leave it blank
    • 1 - Include Title
    • 2 - Current Date/Time
    • 3 - Include Page number in the format “Page #”
    • 4 - Include page number in the format “Page # Of #”
    • 5 - CUSTOM - Include custom text in footer
    Custom Header/Footer value
    leftHeaderText
    rightHeaderText
    centerHeaderText
    leftFooterText
    rightFooterText
    centerFooterText
    String

    If any of the header/footer setting is 5 (.ie, CUSTOM) then the corresponding custom value/text should be passed.

    HTML Specific Attributes

    Key Description
    includeTitle Integer

    To contol the title positioning.
    Default value - 0.
    • 0 - AT TOP
    • 1 - AT BOTTOM
    • 2 - NONE
    includeDesc Integer

    To contol the description positioning.
    Default value - 0.
    • 0 - AT TOP
    • 1 - AT BOTTOM
    • 2 - NONE

    IMAGE Specific Attributes

    Key Description
    width Integer

    The width of the image.
    Default value - 500.
    height Integer

    The height of the image.
    Default value - 400.
    title Boolean

    To include the view name in the exported view.
    Default value - true.
    description Boolean

    To include the view description in the exported view.
    Default value - true.
    legend Boolean

    Controls whether the legend is to be included in the image generated.
    Default value - true.
    imageFormat String

    The format of the exported image.
    png/jpg
    Default value - png.

    Possible Error Codes

    7103 , 7138 , 8002 , 8046 , 8119 , 8504


    Using SQL Query

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/bulk/workspaces/<workspace-id>/data?CONFIG=<encoded_json_value> -X 'GET' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "responseFormat": "csv", "sqlQuery": "select * from Sales" }

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Create bulk export job",
        "data": {
            "jobId": "35130000001391001"
        }
    }
    

    Create an export job using SQL select statement to initiate data export.

    request uri

    GET https://<ZohoAnalytics_Server_URI>/restapi/v2/bulk/workspaces/<workspace-id>/data

    oauthscope: ZohoAnalytics.data.read

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    sqlQuery* String

    SQL SELECT Query.
    Using SQL Select statements data can be exported from a single Table/Query Table or joining one or more tables.
    Check here for more details.
    responseFormat* String

    The format of the data to be exported.
    • csv
    • json
    • xml
    • pdf
    • html
    selectedColumns JSONArray

    Controls the columns that need to be exported.

    Sample: ["column1","column2"]
    showHiddenCols Boolean

    Controls whether the columns that have been hidden in the table have to be exported.
    Default value - false.
    showPersonalCols Boolean

    Controls whether the columns that have been marked as personal data in the table have to be exported.
    Default value - false.
    callbackUrl String

    A valid URL, that should allow HTTP Post method.
    The Bulk Export Job's details is posted to this URL on successful completion of job or on failure of job.

    CSV Specific Attributes

    Key Description
    delimiter Integer

    The delimiter character used for separating the fields in a row in the CSV.
    • 0 - COMMA
    • 1 - TAB
    • 2 - SEMICOLON
    • 3 - SPACE
    recordDelimiter Integer

    The record delimiter (newline character) to use.
    • 0 - DOS
    • 1 - UNIX
    • 2 - MAC
    quoted Integer

    The quote character to use for quoting the values.
    • 0 - SINGLE
    • 1 - DOUBLE
    includeHeader Boolean

    To include the column names in the first row of the CSV exported.
    Default value - true.

    JSON Specific Attributes

    Key Description
    keyValueFormat Boolean

    To return JSON data as ColumnName - Value pair.
    Default value - true.

    PDF Specific Attributes

    Key Description
    paperSize Integer

    The size of the paper.
    • 0 - LETTER
    • 1 - LEGAL
    • 2 - TABLOID
    • 3 - A3
    • 4 - A4
    • 5 - AUTO
    paperStyle String

    To controls the orientation.
    Portrait/Landscape
    showTitle Integer

    To controls the title positioning.
    • 0 - AT TOP
    • 1 - AT BOTTOM
    • 2 - NONE
    showDesc Integer

    To controls the description positioning.
    • 0 - AT TOP
    • 1 - AT BOTTOM
    • 2 - NONE
    exportLanguage Integer

    PDF will be rendered using the specified language.
    • 0 - ENGLISH
    • 1 - CHINESE
    • 2 - JAPANESE
    • 3 - EUROPEAN
    • 4 - KOREAN

    Default value - 0 (ENGLISH).
    zoomfactor Integer

    To control the zoom factor for the PDF.
    Between 0 to 100
    Default value - 100.
    Margin Settings:
    topMargin
    bottomMargin
    leftMargin
    rightMargin
    Decimal values between 0 to 1 The margin in inches for that edge. Can be decimal between 0 to 1 (like 0.5).
    Header/Footer Settings:
    leftHeader
    rightHeader
    centerHeader
    leftFooter
    rightFooter
    centerFooter
    Integer

    The header or footer value that needs to be generated for each page at that particular position.
    • 0 - Leave it blank
    • 1 - Include Title
    • 2 - Current Date/Time
    • 3 - Include Page number in the format “Page #”
    • 4 - Include page number in the format “Page # Of #”
    • 5 - CUSTOM - Include custom text in footer
    Custom Header/Footer value
    leftHeaderText
    rightHeaderText
    centerHeaderText
    leftFooterText
    rightFooterText
    centerFooterText
    String

    If any of the header/footer setting is 5 (.ie, CUSTOM) then the corresponding custom value/text should be passed.

    HTML Specific Attributes

    Key Description
    includeTitle Integer

    To contol the title positioning.
    Default value - 0.
    • 0 - AT TOP
    • 1 - AT BOTTOM
    • 2 - NONE
    includeDesc Integer

    To contol the description positioning.
    Default value - 0.
    • 0 - AT TOP
    • 1 - AT BOTTOM
    • 2 - NONE

    Possible Error Codes

    7103 , 7403 , 8002 , 8046 , 8119 , 8504


    Get Export Job Details

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/bulk/workspaces/<workspace-id>/exportjobs/<job-id> -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Fetch export job info",
        "data": {
            "jobId": "35130000001391001",
            "jobCode": "1004",
            "jobStatus": "JOB COMPLETED",
            "downloadUrl": "https://analyticsapi.zoho.com/restapi/v2/bulk/workspaces/35130000001242001/exportjobs/35130000001391001/data",
            "expiryTime": "1623765872891"
        }
    }
    

    Returns details of the specified export job.

    request uri

    GET https://<ZohoAnalytics_Server_URI>/restapi/v2/bulk/workspaces/<workspace-id>/exportjobs/<job-id>

    oauthscope: ZohoAnalytics.data.read

    Possible Error Codes

    7103 , 8120 , 8124


    Download Exported Data

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/bulk/workspaces/<workspace-id>/exportjobs/<job-id>/data -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:text/csv;charset=UTF-8
    
    Date,Region,Product,Customer Name,Sales
    "15 June, 2021",East,Cereals,Vincent Herbert,682.39
    "15 June, 2021",West,Clocks,John Britto,$272.34
    "15 June, 2021",Central,Art Supplies,Susan Juliet,$45.31
    

    Download data for the bulk export job.

    request uri

    GET https://<ZohoAnalytics_Server_URI>/restapi/v2/bulk/workspaces/<workspace-id>/exportjobs/<job-id>/data

    oauthscope: ZohoAnalytics.data.read

    Possible Error Codes

    7103 , 8120 , 8121 , 8122 , 8124


    Error codes in Bulk API

    Sample Error:

    HTTP/1.1 400 Bad Request
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "failure",
        "summary": "META_DBOBJECT_NAME_DUPLICATED",
        "data": {
            "errorCode": 7111,
            "errorMessage": "A Table with the name Sales already exists in this workspace. Please provide an alternate name."
        }
    }
    

    This section lists all possible error codes that could be sent from the Zoho Analytics server on failure of Data APIs. You can use this for appropriate error handling.

    Error Codes

    Error-Code Reason Solution
    7103 The workspace id mentioned in the API does not exist. Provide the valid workspace id.
    7111 A table with the same name already exist. Provide an alternative name.
    7138 The view id mentioned in the API URL does not exist. Check the view id in the request URL and provide a valid view id.
    7232 Import Aborted. Check the error message returned.
    7235 Not even a single column name provided in source file matches with the column data in table. Check whether the column name in source data matches with column names present in analytics table.
    NOTE:Also check whether the config fileType is provided with proper value.
    7248 The file content is not \"multipart/form-data\" format. Check whether the file is passed as multipart-form data.
    7249 The file cannot be imported. Verify whether the file content is same as the "fileType" provided.
    7403 Parsing of SQL query failed. Check the SQL syntax provided is valid.
    7507 Value entered in the mentioned column does not follow the specified data-type. Check the value of that column and provide value in the specified data-type.
    7511 Mentioned Column is a mandatory column. Should specify the value for that mandatory column.
    8002 Specified criteria is invalid. Provide valid criteria.
    8004 The column mentioned in the criteria is not present in the table. Check the column name and provide valid name.
    8016 You need to have at-least one column for INSERT or UPDATE action. You should provide at-least one column with value.
    8046 Not even one column in the selected columns list is valid. Check whether the column name provided is present in the table.
    8119 Invalid value provided for the attribute. Check the value for the attribute provided is valid.
    8120 Export job not found. Check the export job id provided is valid and not expired.
    8121 Export job not initiated. Check the export job is completed before downloadin the data.
    8122 Export job not completed. Check the export job is completed before downloadin the data.
    8124 Export job access denied. Only the user created the job can access the job.
    8137 Import job not found. Check the import job id provided is valid and not expired.
    8138 Import job access denied. Only the user created the job can access the job.
    8504 The required parameter is not proper or has not been sent. Send the parameter with valid data.
    8506 The mentioned parameter has been sent more than the required count. Check and remove that extra parameter mentioned in the response.
    8513 The file size is more than the supported size. File size should be less than the mentioned size.
    8516 Invalid value passed in the mentioned parameter. Provide the valid data to the mentioned parameter.

    Modeling API

    Modeling APIs are used to add, delete and rename Zoho Analytics workspaces, views, columns, and folders. It also offers APIs to copy workspaces, reports, and formulas from one workspace to another workspace in the same account or across different accounts.


    Create Workspace

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces?CONFIG=<encoded_json_value> -X 'POST' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "workspaceName": "<workspace-name>" }

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Create workspace",
        "data": {
            "workspaceId": "1767024000003145002"
        }
    }
    

    Create a blank workspace in the specified organization.

    request uri

    POST https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces

    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
    workspaceName* String

    The name of the workspace.
    workspaceDesc String

    The description of the workspace.

    Possible Error Codes

    7101 , 8504 , 8506 , 8516


    Copy Workspace

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>?CONFIG=<encoded_json_value> -X 'POST' -H 'ZANALYTICS-ORGID: <source-org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "newWorkspaceName": "<workspace-name>" }

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Copy workspace",
        "data": {
            "workspaceId": "1767024000003145006"
        }
    }
    

    Copy the specified workspace from one organization to another or within the organization.

    Note: For ZANALYTICS-ORGID header, provide the source organization id as the value.

    request uri

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

    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
    newWorkspaceName* String

    The name of the new workspace.
    newWorkspaceDesc String

    The description of the new workspace.
    workspaceKey String

    source workspace secret key
    The secret key used for allowing the user to copy the source workspace.
    copyWithData Boolean

    To copy the workspace with table data.
    copyWithImportSource Boolean

    To copy the workspace with import sources.

    Request Headers (Action Specific)

    Name Value Description
    ZANALYTICS-DEST-ORGID <destination-org-id> Id of the organization where the workspace have to be copied.

    Possible Error Codes

    7101 , 7103 , 7138 , 8024 , 8504 , 8506 , 8516 , 15007


    Rename Workspace

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>?CONFIG=<encoded_json_value> -X 'PUT' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "workspaceName": "<workspace-name>" }

    Sample Response:

    HTTP/1.1 204 No Content

    Rename a specified workspace in the organization.

    request uri

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

    oauthscope: ZohoAnalytics.modeling.update

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    workspaceName* String

    The new name of the workspace.
    workspaceDesc String

    The new description of the workspace.

    Possible Error Codes

    7103 , 7138 , 7165 , 8504 , 8506 , 8516


    Delete Workspace

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id> -X 'DELETE' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 204 No Content

    Delete a specified workspace in the organization.

    request uri

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

    oauthscope: ZohoAnalytics.modeling.delete

    Possible Error Codes

    7103 , 7138 , 7165 , 8504 , 8506 , 8516


    Create Table

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/tables?CONFIG=<encoded_json_value> -X 'POST' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "tableDesign": { "TABLENAME": "Sales", "TABLEDESCRIPTION": "Test", "COLUMNS": [{ "COLUMNNAME": "Column1", "DATATYPE": "PLAIN" }, { "COLUMNNAME": "Column2", "DATATYPE": "NUMBER" }] } }

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Create table",
        "data": {
            "viewId": "1767024000003145011"
        }
    }
    

    Create a table in the specified workspace.

    request uri

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

    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
    tableDesign* JSONObject

    <Table Structure>

    Table Structure

    Key Description
    TABLENAME* String

    The name of the table.
    TABLEDESCRIPTION String

    The description of the table.
    FOLDERNAME String

    The name of the folder where the table have to be created.
    COLUMNS* JSONArray

    <Column Structure>

    Column Structure

    Key Description
    COLUMNNAME* String

    The name of the column.
    DATATYPE* String

    The data type of the column.
    Supported data types:
    • PLAIN
    • MULTI_LINE
    • EMAIL
    • NUMBER
    • POSITIVE_NUMBER
    • DECIMAL_NUMBER
    • CURRENCY
    • PERCENT
    • DATE
    • BOOLEAN
    • URL
    • AUTO_NUMBER
    • GEO
    MANDATORY Boolean

    Controls whether the column should contain a mandatory non-empty value.
    Default value - false.
    DESCRIPTION String

    The description of the column.
    DEFAULT String

    Default value for the column
    Fills the provided value when a cell in the column is empty.
    GEOROLE Integer

    To specify the geo location type.
    This attribute is mandatory for GEO DATATYPE.
    • 0 - Continent
    • 1 - Country
    • 2 - State/Province
    • 3 - County/Distict
    • 4 - City
    • 5 - Zip Code
    • 6 - Latitude
    • 7 - Longitude
    • 8 - Airport

    Possible Error Codes

    7103 , 7111 , 7138 , 8504 , 8506 , 8516 , 8534


    Saveas View

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/views/<view-id>/saveas?CONFIG=<encoded_json_value> -X 'POST' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "viewName": "<view-name>" }

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Saveas view",
        "data": {
            "viewId": "1767024000004723001"
        }
    }
    

    Copy a specified view within the workspace.

    request uri

    POST https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/views/<view-id>/saveas

    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
    viewName* String

    The name of the new view.
    viewDesc String

    The description of the new view.
    copyWithData Boolean

    To copy table with data.
    copyWithLookup Boolean

    To copy table with lookup details.
    folderId Long The folder id where the created view to be placed.

    Possible Error Codes

    7103 , 7105 , 7111 , 7144 , 8504 , 8506 , 8516, 15018


    Rename View

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/views/<view-id>?CONFIG=<encoded_json_value> -X 'PUT' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "viewName": "<view-name>" }

    Sample Response:

    HTTP/1.1 204 No Content

    Rename a specified view in the workspace.

    request uri

    PUT https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/views/<view-id>

    oauthscope: ZohoAnalytics.modeling.update

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    viewName* String

    The new name of the view.
    viewDesc String

    The new description of the view.

    Possible Error Codes

    7103 , 7105 , 7111 , 7138 , 8504 , 8506 , 8516


    Delete View

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/views/<view-id> -X 'DELETE' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 204 No Content

    Delete a specified view in the workspace.

    request uri

    DELETE https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/views/<view-id>

    oauthscope: ZohoAnalytics.modeling.delete

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    deleteDependentViews Boolean

    To delete dependent views while deleting a table/querytable(table/querytable which has dependent views).

    Possible Error Codes

    7103 , 7138 , 7277 , 8504 , 8506 , 8516


    Create Folder

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/folders?CONFIG=<encoded_json_value> -X 'POST' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "folderName": "<folder-name>" }

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Create folder",
        "data": {
            "folderId": "1767024000003145066"
        }
    }
    

    Create a folder in the specified workspace.

    request uri

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

    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
    folderName* String

    The name of the folder.
    folderDesc String

    The description of the folder.
    parentFolderId Long Id of the parent folder.
    Newly created folder will be placed under this folder.

    Possible Error Codes

    7103 , 7138 , 7277 , 8504 , 8506 , 8516


    Rename Folder

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/folders/<folder-id>?CONFIG=<encoded_json_value> -X 'PUT' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "folderName": "<folder-name>" }

    Sample Response:

    HTTP/1.1 204 No Content

    Rename a specified folder in the workspace.

    request uri

    PUT https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/folders/<folder-id>

    oauthscope: ZohoAnalytics.modeling.update

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    folderName* String

    The new name of the folder.
    folderDesc String

    The new description of the folder.

    Possible Error Codes

    7103 , 7138 , 7277 , 8504 , 8506 , 8516


    Make Default Folder

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/folders/<folder-id>/default -X 'PUT' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 204 No Content
    

    Make the specified folder as default in the workspace.

    request uri

    PUT https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/folders/<folder-id>/default

    oauthscope: ZohoAnalytics.modeling.update

    Possible Error Codes

    7103 , 7144 , 8504 , 8506


    Delete Folder

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/folders/<folder-id> -X 'DELETE' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 204 No Content

    Delete a specified folder in the workspace.

    request uri

    DELETE https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/folders/<folder-id>

    oauthscope: ZohoAnalytics.modeling.delete

    Possible Error Codes

    7103 , 7138 , 7277 , 8504 , 8506 , 8516


    Add Column

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/views/<view-id>/columns?CONFIG=<encoded_json_value> -X 'POST' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "columnName": "<column-name>", "dataType": "<data-type>", }

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Add column",
        "data": {
            "columnId": "1767024000003145067"
        }
    }
    

    Add a column in the specified table.

    request uri

    POST https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/views/<view-id>/columns

    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
    columnName* String

    The name of the column.
    dataType* String

    The data type of the column.
    supported data types:
    • PLAIN
    • MULTI_LINE
    • EMAIL
    • NUMBER
    • POSITIVE_NUMBER
    • DECIMAL_NUMBER
    • CURRENCY
    • PERCENT
    • DATE
    • BOOLEAN
    • URL
    • AUTO_NUMBER

    Possible Error Codes

    7103 , 7128 , 7138 , 7161 , 8504 , 8506 , 8516


    Rename Column

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/views/<view-id>/columns/<column-id>?CONFIG=<encoded_json_value> -X 'PUT' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "columnName": "<column-name>" }

    Sample Response:

    HTTP/1.1 204 No Content

    Rename a specified column in the table.

    request uri

    PUT https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/views/<view-id>/columns/<column-id>

    oauthscope: ZohoAnalytics.modeling.update

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    columnName* String

    The new name of the column.

    Possible Error Codes

    7103 , 7107 , 7138 , 7128 , 8504 , 8506 , 8516


    Delete Column

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/views/<view-id>/columns/<column-id> -X 'DELETE' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 204 No Content

    Delete a specified column in the table.

    request uri

    DELETE https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/views/<view-id>/columns/<column-id>

    oauthscope: ZohoAnalytics.modeling.delete

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    deleteDependentViews Boolean

    To delete column with dependent views.

    Possible Error Codes

    7103 , 7107 , 7138 , 7159 , 8504 , 8506 , 8516


    Add Lookup

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/views/<view-id>/columns/<column-id>/lookup?CONFIG=<encoded_json_value> -X 'POST' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "referenceViewId": "<view-id>", "referenceColumnId": "<column-id>" }

    Sample Response:

    HTTP/1.1 204 No Content

    Add a lookup in the specified child table.

    request uri

    POST https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/views/<view-id>/columns/<column-id>/lookup

    oauthscope: ZohoAnalytics.modeling.update

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    referenceViewId* Long The reference view id.
    referenceColumnId* Long The reference column id.

    Possible Error Codes

    7103 , 7107 , 7138 , 8504 , 8506 , 8516


    Remove Lookup

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/views/<view-id>/columns/<column-id>/lookup -X 'DELETE' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 204 No Content

    Remove the lookup for the specified column in the table.

    request uri

    DELETE https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/views/<view-id>/columns/<column-id>/lookup

    oauthscope: ZohoAnalytics.modeling.update

    Possible Error Codes

    7103 , 7107 , 7138 , 8504 , 8506 , 8516


    Hide Columns

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/views/<view-id>/columns/hide?CONFIG=<encoded_json_value> -X 'PUT' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "columnIds": ["<column-id1>", "<column-id2>"] }

    Sample Response:

    HTTP/1.1 204 No Content

    Hide the specified columns in the table.

    request uri

    PUT https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/views/<view-id>/columns/hide

    oauthscope: ZohoAnalytics.modeling.update

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    columnIds* JSONArray

    The column ids to be hidden.

    Sample: ["columnId1","columnId2"]

    Possible Error Codes

    7103 , 7107 , 7138 , 8504 , 8506 , 8516


    Show Columns

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/views/<view-id>/columns/show?CONFIG=<encoded_json_value> -X 'PUT' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "columnIds": ["<column-id1>", "<column-id2>"] }

    Sample Response:

    HTTP/1.1 204 No Content

    Show the specified hidden columns in the table.

    request uri

    PUT https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/views/<view-id>/columns/show

    oauthscope: ZohoAnalytics.modeling.update

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    columnIds* JSONArray

    The column ids to be shown.

    Sample: ["columnId1","columnId2"]

    Possible Error Codes

    7103 , 7107 , 7138 , 8504 , 8506 , 8516


    Copy Views

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<source-workspace-id>/views/copy?CONFIG=<encoded_json_value> -X 'POST' -H 'ZANALYTICS-ORGID: <source-org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "viewIds": ["<view-id1>", "<view-id2>"], "destWorkspaceId": "<workspace-id>" }

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Copy views",
        "data": {
            "views": [
                {
                    "sourceViewId": "1767024000004221089",
                    "destViewId": "2102449000000625001"
                },
                {
                    "sourceViewId": "1767024000004221093",
                    "destViewId": "2102449000000625005"
                }
            ]
        }
    }
    

    Copy the specified views from one workspace to another workspace.

    Note: For ZANALYTICS-ORGID header, provide the source organization id as the value.

    request uri

    POST https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<source-workspace-id>/views/copy

    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
    viewIds* JSONArray

    The id of the views to be copied.

    Sample: ["viewId1","viewId2"]
    destWorkspaceId* Long The destination workspace id.
    workspaceKey String

    The secret key used for allowing the user to copy the views from one organization to another organization.
    copyWithData Boolean

    To copy the table with data.
    copyWithDependentViews Boolean

    The copy the views with dependents.

    Request Headers (Action Specific)

    Name Value Description
    ZANALYTICS-DEST-ORGID <destination-org-id> Id of the organization where the destination workspace is present.

    Possible Error Codes

    7103 , 7138 , 8504 , 8506 , 8516 , 15000 , 15001 , 15002 , 15005 , 15007 , 15012


    Copy Formulas

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<source-workspace-id>/views/<source-view-id>/formulas/copy?CONFIG=<encoded_json_value> -X 'POST' -H 'ZANALYTICS-ORGID: <source-org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "formulaColumnNames": ["<column-name1>", "<column-name2>"], "destWorkspaceId": "<workspace-id>" }

    Sample Response:

    HTTP/1.1 204 No Content

    Copy the specified formulas from one table to another across workspaces.

    Note:

    request uri

    POST https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<source-workspace-id>/views/<source-view-id>/formulas/copy

    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
    formulaColumnNames* JSONArray

    The name of the formula columns to be copied.

    Sample: ["column1","column2"]
    destWorkspaceId* Long The destination workspace id.
    workspaceKey String

    The secret key used for allowing the user to copy the formulas from one organization to another organization.

    Request Headers (Action Specific)

    Name Value Description
    ZANALYTICS-DEST-ORGID <destination-org-id> Id of the organization where the destination workspace is present.

    Possible Error Codes

    7103 , 7138 , 8504 , 8506 , 8516 , 15002 , 15007 , 15009 , 15010


    Create Similar Views

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<source-workspace-id>/views/<view-id>/similarviews?CONFIG=<encoded_json_value> -X 'POST' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "referenceViewId": "<view-id>", "folderId": "<folder-id>" }

    Sample Response:

    HTTP/1.1 204 No Content

    Create reports for the specified table based on the reference table.

    request uri

    POST https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<source-workspace-id>/views/<view-id>/similarviews

    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
    referenceViewId* Long The reference view id.
    folderId* Long The folder id where the views to be saved.

    Possible Error Codes

    7103 , 7138 , 7144 , 8504 , 8506 , 8516


    Auto Analyse View

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<source-workspace-id>/views/<view-id>/autoanalyse -X 'POST' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 204 No Content

    Auto generate reports for the specified table.

    request uri

    POST https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<source-workspace-id>/views/<view-id>/autoanalyse

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

    To generate duplicate reports if reports generated before.

    Possible Error Codes

    7103 , 7107 , 7138 , 8504 , 8506 , 8516


    Auto Analyse Column

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<source-workspace-id>/views/<view-id>/columns/<column-id>/autoanalyse -X 'POST' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 204 No Content

    Auto generate reports for the specified column.

    request uri

    POST https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<source-workspace-id>/views/<view-id>/columns/<column-id>/autoanalyse

    oauthscope: ZohoAnalytics.modeling.create

    Possible Error Codes

    7103 , 7107 , 7138 , 8504 , 8506 , 8516


    Get Variables

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/variables -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
       "status":"success",
       "summary":"Get variables",
       "data":{
          "variables":[
             {
                "variableName":"Variable - 1",
                "variableId":"137687000007146340",
                "variableType":"0",
                "variableDataType":"1"
             },
             {
                "variableName":"Variable - 2",
                "variableId":"137687000007146338",
                "variableType":"3",
                "variableDataType":"1"
             }
          ]
       }
    }
    

    Returns list of variables for the specified workspace.

    request uri

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

    oauthscope: ZohoAnalytics.modeling.read

    Possible Error Codes

    7103, 7301, 8083, 8518, 8535


    Get Variable Details

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/variables/<variable-id> -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
       "status":"success",
       "summary":"Get variable details",
       "data":{
          "variableName":"Variable - 2",
          "variableType":0,
          "variableDataType":1,
          "userSpecificData":[
             {
                "values":[
                   "4",
                   "5",
                   "6"
                ],
                "defaultValue":"4",
                "emailIds":[
                   "user+1@zoho.com"
                ]
             },
             {
                "values":[
                   "7",
                   "8",
                   "9"
                ],
                "defaultValue":"7",
                "emailIds":[
                   "user+2@zoho.com"
                ]
             }
          ],
          "defaultData":{
             "values":[
                "1",
                "2",
                "3"
             ],
             "defaultValue":"1"
          },
          "format":{
             "alignment":"Left"
          }
       }
    }
    

    Returns details of the specified variable.

    request uri

    GET https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/variables/<variable-id>

    oauthscope: ZohoAnalytics.modeling.read

    Possible Error Codes

    7103, 7301, 8083, 8518, 8535, 70329


    Create Variable

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/variables?CONFIG=<encoded_json_value> -X 'POST' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "variableName":"Variable - 1", "variableType":3, "variableDataType":1, "userSpecificData":[ { "values":[ "4", "5", "6" ], "emailIds":[ "user+1@zohotest.com" ] }, { "values":[ "1", "2", "3" ], "emailIds":[ "user+2@zohotest.com" ] } ], "format":{ "alignment":"Left" } }

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
       "status":"success",
       "summary":"Create variable",
       "data":{
          "variableId":"137687000006991651"
       }
    }
    

    Create a variable in the specified workspace.

    request uri

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

    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
    variableName* String

    Name of the variable.
    variableDatatype Integer

    Datatype of the variable.
    • 1 - PLAIN
    • 4 - NUMBER
    • 5 - POSITIVE_NUMBER
    • 6 - DECIMAL_NUMBER
    • 7 - CURRENCY
    • 8 - PERCENT
    variableType Integer

    Type of the variable.
    • 0 - LIST
    • 1 - RANGE
    • 2 - ALL_VALUES
    format JSONObject

    Variable format.
    Refer FORMAT JSON Structure.
    userSpecificData JSONArray

    Array of user specfic values.
    Refer USER_SPECIFIC_DATA JSON Structure.
    defaultData JSONObject

    Default value for the variable.
    Mandatory for LIST and RANGE variable type.
    Refer DEFAULT_DATA JSON Structure.

    format structure

    Key Description
    alignment String

    • Left
    • Center
    • Right
    decimalPlaces Integer

    -1 to 10
    currencySymbol String

    <CURRENCY_SYMBOL>
    Sample : en;US;
    showNegativeSign Boolean

    true / false
    userLocale Boolean

    true / false
    thousandSeparator Integer

    • 0 - NONE
    • 1 - COMMA
    • 2 - DOT
    • 3 - SPACE
    • 4 - SINGLE_QUOTE
    decimalSeparator Integer

    • 0 - DOT
    • 1 - COMMA
    showPercent Boolean

    true / false
    Valid only for PERCENT format type.

    USER_SPECIFIC_DATA structure

    Key Description
    values JSONArray

    Array of values
    Sample : ["Value_1","Value_2"]
    emailIds JSONArray

    Array of EmailIds
    Sample : ["user+1@zoho.com","user+2@zoho.com"]
    defaultValue String

    Default value for the variable.
    Mandatory for RANGE variable type.
    minValue String

    Minimum value for the variable.
    Mandatory for RANGE variable type.
    maxValue String

    Maximum value for the variable.
    Mandatory for RANGE variable type.
    stepSize String

    Incremental value for the variable.
    Mandatory for RANGE variable type.
    domainName String

    Name of the domain
    To add variable values to the white label domain users.

    DEFAULT_DATA structure

    Key Description
    values JSONArray

    Array of values
    Sample : ["Value_1","Value_2"]
    Mandatory for LIST variable type.
    defaultValue String

    Default value for the variable.
    Mandatory for RANGE variable type.
    minValue String

    Minimum value for the variable.
    Mandatory for RANGE variable type.
    maxValue String

    Maximum value for the variable.
    Mandatory for RANGE variable type.
    stepSize String

    Incremental value for the variable.
    Mandatory for RANGE variable type.

    Possible Error Codes

    7103, 7301, 8083, 8504, 8516, 8518, 8535, 70323


    Update Variable

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/variables/<variable-id>?CONFIG=<encoded_json_value> -X 'PUT' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "variableName":"Variable - 1", "variableType":3, "variableDataType":1, "userSpecificData":[ { "values":[ "4", "5", "6" ], "emailIds":[ "user+1@zohotest.com" ] }, { "values":[ "1", "2", "3" ], "emailIds":[ "user+2@zohotest.com" ] } ], "format":{ "alignment":"Left" } }

    Sample Response:

    HTTP/1.1 204 No Content
    

    Update details of the specified variable.

    request uri

    PUT https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/variables/<variable-id>

    oauthscope: ZohoAnalytics.modeling.update

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    variableName* String

    New name of the variable.
    variableDatatype Integer

    New datatype of the variable.
    • 1 - PLAIN
    • 4 - NUMBER
    • 5 - POSITIVE_NUMBER
    • 6 - DECIMAL_NUMBER
    • 7 - CURRENCY
    • 8 - PERCENT
    variableType Integer

    New type of the variable.
    • 0 - LIST
    • 1 - RANGE
    • 2 - ALL_VALUES
    format JSONObject

    Variable format.
    Refer FORMAT JSON Structure.
    userSpecificData JSONArray

    Array of user specfic values.
    Refer USER_SPECIFIC_DATA JSON Structure.
    defaultData JSONObject

    Default value for the variable.
    Mandatory for LIST and RANGE variable type.
    Refer DEFAULT_DATA JSON Structure.

    format structure

    Key Description
    alignment String

    • Left
    • Center
    • Right
    decimalPlaces Integer

    -1 to 10
    currencySymbol String

    <CURRENCY_SYMBOL>
    Sample : en;US;
    showNegativeSign Boolean

    true / false
    userLocale Boolean

    true / false
    thousandSeparator Integer

    • 0 - NONE
    • 1 - COMMA
    • 2 - DOT
    • 3 - SPACE
    • 4 - SINGLE_QUOTE
    decimalSeparator Integer

    • 0 - DOT
    • 1 - COMMA
    showPercent Boolean

    true / false
    Valid only for PERCENT format type.

    USER_SPECIFIC_DATA structure

    Key Description
    values JSONArray

    Array of values
    Sample : ["Value_1","Value_2"]
    emailIds JSONArray

    Array of EmailIds
    Sample : ["user+1@zoho.com","user+2@zoho.com"]
    defaultValue String

    Default value for the variable.
    Mandatory for RANGE variable type.
    minValue String

    Minimum value for the variable.
    Mandatory for RANGE variable type.
    maxValue String

    Maximum value for the variable.
    Mandatory for RANGE variable type.
    stepSize String

    Incremental value for the variable.
    Mandatory for RANGE variable type.
    domainName String

    Name of the domain
    To add variable values to the white label domain users.

    DEFAULT_DATA structure

    Key Description
    values JSONArray

    Array of values
    Sample : ["Value_1","Value_2"]
    Mandatory for LIST variable type.
    defaultValue String

    Default value for the variable.
    Mandatory for RANGE variable type.
    minValue String

    Minimum value for the variable.
    Mandatory for RANGE variable type.
    maxValue String

    Maximum value for the variable.
    Mandatory for RANGE variable type.
    stepSize String

    Incremental value for the variable.
    Mandatory for RANGE variable type.

    Possible Error Codes

    7103, 7301, 8083, 8504, 8516, 8518, 8535, 70323


    Delete Variable

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/variables/<variable-id> -X 'DELETE' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 204 No Content
    

    Delete the specified variable.

    request uri

    DELETE https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/variables/<variable-id>

    oauthscope: ZohoAnalytics.modeling.delete

    Possible Error Codes

    7103, 7301, 8083, 8518, 8535, 70329


    Error codes in Modeling API

    Sample Error:

    HTTP/1.1 400 Bad Request
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "failure",
        "summary": "META_DBNAME_DUPLICATE",
        "data": {
            "errorCode": 7101,
            "errorMessage": "Workspace with the same name exists already. Provide an alternate name"
        }
    }
    

    This section lists all possible error codes that could be sent from the Zoho Analytics server on failure of Modeling APIs. You can use this for appropriate error handling.

    Error Codes

    Error-Code Reason Solution
    7101 Workspace with the same name exists already. Provide an alternate name.
    7103 The workspace id mentioned in the API does not exist. Provide the valid workspace id.
    7105 The view id mentioned in the API URL does not exist. Check the view id in the request URL and provide a valid view id.
    7107 The column is not present in the specified table. Provide a valid column id.
    7111 A Table with the name already exists in the Workspace. Provide an alternate name.
    7128 The column with the same name is already exists in the table. Provide an alternate name.
    7138 The view id mentioned in the API URL does not exist. Check the view id in the request URL and provide a valid view id.
    7144 Mentioned folder is not present in the Workspace. Check if the mentioned folder is available.
    7159 The column to be deleted is used in Reports, Formula Columns, Query Tables, etc. The column with dependent views cannot be deleted. Please delete the dependent views and formula columns associated with this column before calling the delete column API.
    7161 The specified table in this API is a system table (created for Service Integration). Adding columns into system table is not allowed. You could only add columns in a non-system table using this API.
    7165 The Workspace specified is a system Workspace (dedicated Workspace created for other Zoho Service integrations) which cannot be deleted. The system Workspace cannot be deleted.
    7277 The specified view holds dependent views. Set deleteDependentViews as true to delete the dependent views.
    8023 You do not have required permission to perform this operation. Kindly contact our support team.
    8024 Copy Workspace operation not allowed. Check the Workspace key provided in the API request.
    8025 Invalid custom domain. Provide a valid domain name.
    8504 The required parameter is not proper or has not been sent. Send the parameter with valid data.
    8506 The mentioned parameter has been sent more than the required count. Check and remove that extra parameter mentioned in the response.
    8516 Invalid value passed in the mentioned parameter. Provide the valid data to the mentioned parameter.
    8518 Invalid authentication. Provide a valid OAuth token for API authentication.
    8534 Invalid JSON data. Provide a valid JSON data.
    8535 Invalid oauthtoken. Provide a valid OAuth token.
    15000 A table which is needed to copy the specified report is missing in the destination workspace. Check the destination workspace and create the missing tables.
    15001 A column which is needed to copy the specified report is missing in the destination workspace. Check the destination workspace and create the column before copying the report.
    15002 A formula column which is needed to copy the specified report is missing in the destination workspace. Check the destination workspace and create the formula column before copying the report.
    15005 The report name specified already exists in the destination workspace. Check whether the report with the same name exists in the destination workspace. Try renaming the source report or the report in destination workspace and invoke the API again.
    15007 Insufficient privileges to copy the report. Check whether the copy workspace Key is valid.
    15009 The formula column name specified already exists in the destination workspace. Check whether the formula column is already copied, otherwise, try renaming the formula column in the source table or in the destination workspace and invoke the API again.
    15010 The Formula Column name specified in the API request is not present in the source table. Check the formula column name(s) specified in the request.
    15012 The reports specified in the API request is not present in the source workspace. Check the reports specified in the request are correct and are available.
    15018 The table to be copied have more than two hundred thousand rows. Set copyHugeData as true.
    70323 Variable with the same name exists already. Provide an alternate name.
    70329 The variable id mentioned in the API does not exist. Provide a valid variable id.

    In case of any error other than the above said, mail the API request URL parameters and error response details to support@zohoanalytics.com. Zoho Analytics Team will get back to you with the best possible solution.

    Metadata API

    Metadata APIs are used to fetch information about the reporting Workspaces, tables, reports, and dashboards created in Zoho Analytics.


    Get Organizations

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/orgs -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Get organizations",
        "data": {
            "orgs": [
                {
                    "orgId": "671712892",
                    "orgName": "bruce.wn",
                    "orgDesc": "",
                    "createdBy": "bruce.wn@zoho.com",
                    "createdByZuId": "671546307",
                    "planName": "Premium",
                    "isDefault": true,
                    "numberOfworkspaces": 27,
                    "role": "Account Admin"
                },
                {
                    "orgId": "647668523",
                    "orgName": "clark.nt",
                    "orgDesc": "",
                    "createdBy": "clark.nt@zoho.com",
                    "createdByZuId": "647310528",
                    "planName": "Premium",
                    "isDefault": false,
                    "numberOfworkspaces": 2,
                    "role": "User"
                }
            ]
        }
    }
    

    Returns list of all accessible organizations.

    request uri

    GET https://<ZohoAnalytics_Server_URI>/restapi/v2/orgs

    oauthscope: ZohoAnalytics.metadata.read

    Possible Error Codes

    8518, 8535


    Get All Workspaces

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Get all workspaces",
        "data": {
            "ownedWorkspaces": [
                {
                    "workspaceId": "1767024000000060001",
                    "workspaceName": "Zoho CRM Reports",
                    "workspaceDesc": "",
                    "orgId": "671712892",
                    "createdTime": "1548914379156",
                    "createdBy": "bruce.wn@zoho.com",
                    "isDefault": false
                },
                {
                    "workspaceId": "1767024000000004900",
                    "workspaceName": "Zoho Sales reports",
                    "workspaceDesc": "",
                    "orgId": "671712892",
                    "createdTime": "1533642916942",
                    "createdBy": "bruce.wn@zoho.com",
                    "isDefault": false
                }
            ],
            "sharedWorkspaces": [
                {
                    "workspaceId": "1038728000004459012",
                    "workspaceName": "Sales Data",
                    "workspaceDesc": "",
                    "orgId": "67510920",
                    "createdTime": "1614961625207",
                    "createdBy": "clark.nt@zoho.com",
                    "isDefault": false
                }
            ]
        }
    }
    

    Returns list of all accessible workspaces.

    request uri

    GET https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces

    oauthscope: ZohoAnalytics.metadata.read

    Possible Error Codes

    7925, 8518, 8535


    Get Owned Workspaces

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/owned -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Get owned workspaces",
        "data": {
            "workspaces": [
                {
                    "workspaceId": "1767024000000060001",
                    "workspaceName": "Zoho CRM Reports",
                    "workspaceDesc": "",
                    "orgId": "671712892",
                    "createdTime": "1548914379156",
                    "createdBy": "bruce.wn@zoho.com",
                    "isDefault": false
                },
                {
                    "workspaceId": "1767024000000004900",
                    "workspaceName": "Zoho Sales reports",
                    "workspaceDesc": "",
                    "orgId": "671712892",
                    "createdTime": "1533642916942",
                    "createdBy": "bruce.wn@zoho.com",
                    "isDefault": false
                }
            ]
        }
    }
    

    Returns list of owned workspaces.

    request uri

    GET https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/owned

    oauthscope: ZohoAnalytics.metadata.read

    Possible Error Codes

    7301, 7925, 8518, 8535


    Get Shared Workspaces

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/shared -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Get shared workspaces",
        "data": {
            "workspaces": [
                {
                    "workspaceId": "1038728000004459012",
                    "workspaceName": "Sales Data",
                    "workspaceDesc": "",
                    "orgId": "67510920",
                    "createdTime": "1614961625207",
                    "createdBy": "clark.nt@zoho.com",
                    "isDefault": false
                }
            ]
        }
    }
    

    Returns list of shared workspaces.

    request uri

    GET https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/shared

    oauthscope: ZohoAnalytics.metadata.read

    Possible Error Codes

    7925, 8518, 8535


    Get Views

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/views -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Get views",
        "data": {
            "views": [
                {
                    "viewId": "1767024000003145011",
                    "viewName": "Accounts",
                    "viewDesc": "Description",
                    "viewType": "Table",
                    "parentViewId": "",
                    "folderId": "null",
                    "createdTime": "1623743876529",
                    "createdBy": "bruce.wn@zoho.com",
                    "lastModifiedTime": "1623746630294",
                    "lastModifiedBy": "bruce.wn@zoho.com",
                    "isFavorite": false,
                    "sharedBy": ""
                },
                {
                    "viewId": "1767024000003145052",
                    "viewName": "Sales",
                    "viewDesc": "",
                    "viewType": "Table",
                    "parentViewId": "",
                    "folderId": "null",
                    "createdTime": "1623745056012",
                    "createdBy": "bruce.wn@zoho.com",
                    "lastModifiedTime": "1623746622469",
                    "lastModifiedBy": "bruce.wn@zoho.com",
                    "isFavorite": false,
                    "sharedBy": ""
                }
            ]
        }
    }
    

    Returns list of all accessible views for the specified workspace.

    request uri

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

    oauthscope: ZohoAnalytics.metadata.read

    Possible Error Codes

    7301, 7387, 8083, 8518, 8535


    Get Folders

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/folders -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Get folders",
        "data": {
            "folders": [
                {
                    "folderId": "1767024000003145004",
                    "folderName": "Tables & Reports",
                    "folderDesc": "",
                    "folderIndex": 1,
                    "isDefault": true,
                    "parentFolderId": "-1"
                },
                {
                    "folderId": "1767024000003145066",
                    "folderName": "Account Details",
                    "folderDesc": "",
                    "folderIndex": 2,
                    "isDefault": false,
                    "parentFolderId": "-1"
                }
            ]
        }
    }
    

    Returns list of all accessible folders for the specified workspace.

    request uri

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

    oauthscope: ZohoAnalytics.metadata.read

    Possible Error Codes

    7301, 7387, 8083, 8518, 8535


    Get Recent Views

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/recentviews -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Get recent views",
        "data": {
            "views": [
                {
                    "viewId": "1767024000003145011",
                    "viewName": "Accounts",
                    "viewType": "Table",
                    "workspaceId": "1767024000003145002",
                    "workspaceName": "Zoho CRM Reports",
                    "viewLastAccessedTime": "1623746630303"
                },
                {
                    "viewId": "1767024000003145052",
                    "viewName": "Sales",
                    "viewType": "Table",
                    "workspaceId": "1767024000003145002",
                    "workspaceName": "Zoho CRM Reports",
                    "viewLastAccessedTime": "1623746622479"
                }
            ]
        }
    }
    

    Returns list of recently accessed views.

    request uri

    GET https://<ZohoAnalytics_Server_URI>/restapi/v2/recentviews

    oauthscope: ZohoAnalytics.metadata.read

    Possible Error Codes

    7925, 8518, 8535


    Get Dashboards

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/dashboards -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Get all dashboards",
        "data": {
            "ownedViews": [
                {
                    "viewId": "1767024000000060095",
                    "viewName": "Closed Revenue",
                    "viewDesc": "Dashboard capturing the  highlights of closed revenue",
                    "viewType": "Dashboard",
                    "parentViewId": "",
                    "folderId": "1767024000000060002",
                    "createdTime": "1548914379158",
                    "createdBy": "bruce.wn@zoho.com",
                    "lastModifiedTime": "1548914399837",
                    "lastModifiedBy": "bruce.wn@zoho.com",
                    "isFavorite": false,
                    "sharedBy": "",
                    "workspaceId": "1767024000000060001",
                    "orgId": "671712892"
                }
            ],
            "sharedViews": [
                {
                    "viewId": "1770174000000672854",
                    "viewName": "Sales VS Cost Dashboard",
                    "viewDesc": "Comparison between Sales and Cost",
                    "viewType": "Dashboard",
                    "parentViewId": "",
                    "folderId": "1770174000000674175",
                    "createdTime": "1553245755646",
                    "createdBy": "clark.nt@zoho.com",
                    "lastModifiedTime": "1554441829143",
                    "lastModifiedBy": "clark.nt@zoho.com",
                    "isFavorite": false,
                    "sharedBy": "",
                    "workspaceId": "1770174000000670320",
                    "orgId": "671711195"
                }
            ]
        }
    }
    

    Returns list of all accessible dashboards.

    request uri

    GET https://<ZohoAnalytics_Server_URI>/restapi/v2/dashboards

    oauthscope: ZohoAnalytics.metadata.read

    Possible Error Codes

    7925, 8518, 8535


    Get Owned Dashboards

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/dashboards/owned -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Get owned dashboards",
        "data": {
            "views": [
                {
                    "viewId": "1767024000000060095",
                    "viewName": "Closed Revenue",
                    "viewDesc": "Dashboard capturing the  highlights of closed revenue",
                    "viewType": "Dashboard",
                    "parentViewId": "",
                    "folderId": "1767024000000060002",
                    "createdTime": "1548914379158",
                    "createdBy": "bruce.wn@zoho.com",
                    "lastModifiedTime": "1548914399837",
                    "lastModifiedBy": "bruce.wn@zoho.com",
                    "isFavorite": false,
                    "sharedBy": "",
                    "workspaceId": "1767024000000060001",
                    "orgId": "671712892"
                },
                {
                    "viewId": "1767024000000060099",
                    "viewName": "Expected Revenue",
                    "viewDesc": "Expected Revenue Dashboard",
                    "viewType": "Dashboard",
                    "parentViewId": "",
                    "folderId": "1767024000000060002",
                    "createdTime": "1548914379158",
                    "createdBy": "bruce.wn@zoho.com",
                    "lastModifiedTime": "1548914400061",
                    "lastModifiedBy": "bruce.wn@zoho.com",
                    "isFavorite": false,
                    "sharedBy": "",
                    "workspaceId": "1767024000000060001",
                    "orgId": "671712892"
                }
            ]
        }
    }
    

    Returns the list of owned dashboards.

    request uri

    GET https://<ZohoAnalytics_Server_URI>/restapi/v2/dashboards/owned

    oauthscope: ZohoAnalytics.metadata.read

    Possible Error Codes

    7301, 7925, 8518, 8535


    Get Shared Dashboards

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/dashboards/shared -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Get shared dashboards",
        "data": {
            "views": [
                {
                    "viewId": "1770174000000672854",
                    "viewName": "Sales VS Cost Dashboard",
                    "viewDesc": "Comparison between Sales and Cost",
                    "viewType": "Dashboard",
                    "parentViewId": "",
                    "folderId": "1770174000000674175",
                    "createdTime": "1553245755646",
                    "createdBy": "clark.nt@zoho.com",
                    "lastModifiedTime": "1554441829143",
                    "lastModifiedBy": "clark.nt@zoho.com",
                    "isFavorite": false,
                    "sharedBy": "",
                    "workspaceId": "1770174000000670320",
                    "orgId": "671711195"
                }
            ]
        }
    }
    

    Returns list of shared dashboards.

    request uri

    GET https://<ZohoAnalytics_Server_URI>/restapi/v2/dashboards/shared

    oauthscope: ZohoAnalytics.metadata.read

    Possible Error Codes

    7925, 8518, 8535


    Get Workspace Secretkey

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/secretkey -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Get workspace secretkey",
        "data": {
            "workspaceKey": "dc0543fc624210a5e4f578adabe07369"
        }
    }
    

    Returns the secret key of the specified workspace.

    request uri

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

    oauthscope: ZohoAnalytics.metadata.read

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    regenerateKey Boolean

    To create the new secret key.
    (NOTE:The old key will be disabled.)

    Possible Error Codes

    7301, 7387, 8083, 8518, 8535


    Get Workspace Details

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id> -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Get workspace details",
        "data": {
            "workspaces": {
                "workspaceId": "1767024000003145002",
                "workspaceName": "Account Details",
                "workspaceDesc": "",
                "createdTime": "1623743494151",
                "createdBy": "bruce.wn@zoho.com",
                "orgId": "671712892"
            }
        }
    }
    

    Returns details of the specified workspace.

    request uri

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

    oauthscope: ZohoAnalytics.metadata.read

    Possible Error Codes

    7301, 7103, 8518, 8535


    Get View Details

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/views/<view-id> -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Get view details",
        "data": {
            "views": {
                "viewId": "1767024000003145011",
                "viewName": "Accounts",
                "viewDesc": "Description",
                "viewType": "Table",
                "workspaceId": "1767024000003145002",
                "orgId": "671712892"
            }
        }
    }
    

    Returns details of the specified view.

    request uri

    GET https://<ZohoAnalytics_Server_URI>/restapi/v2/views/<view-id>

    oauthscope: ZohoAnalytics.metadata.read

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    withInvolvedMetaInfo Boolean

    To include the column details/involved views details of the specific view.

    Possible Error Codes

    7301, 7104, 8518, 8535


    Add Favorite Workspace

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/favorite -X 'POST' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 204 No Content

    Adds a specified workspace as favorite.

    request uri

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

    oauthscope: ZohoAnalytics.metadata.update

    Possible Error Codes

    7103, 7301, 7387, 8083, 8518, 8535


    Remove Favorite Workspace

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/favorite -X 'DELETE' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 204 No Content

    Remove a specified workspace from favorite.

    request uri

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

    oauthscope: ZohoAnalytics.metadata.update

    Possible Error Codes

    7103, 7301, 7387, 8083, 8518, 8535


    Add Favorite View

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/views/<view-id>/favorite -X 'POST' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 204 No Content

    Adds a specified view as favorite.

    request uri

    POST https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/views/<view-id>/favorite

    oauthscope: ZohoAnalytics.metadata.update

    Possible Error Codes

    7104, 7301, 7387, 8083, 8518, 8535


    Remove Favorite View

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/views/<view-id>/favorite -X 'DELETE' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 204 No Content

    Remove a specified view from favorite.

    request uri

    DELETE https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/views/<view-id>/favorite

    oauthscope: ZohoAnalytics.metadata.update

    Possible Error Codes

    7104, 7301, 7387, 8083, 8518, 8535


    Add Default Workspace

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/default -X 'POST' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 204 No Content

    Adds a specified workspace as default.

    request uri

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

    oauthscope: ZohoAnalytics.metadata.update

    Possible Error Codes

    7103, 7301, 7387, 8083, 8518, 8535


    Remove Default Workspace

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/default -X 'DELETE' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 204 No Content

    Remove a specified workspace from default.

    request uri

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

    oauthscope: ZohoAnalytics.metadata.update

    Possible Error Codes

    7103, 7301, 7387, 8083, 8518, 8535


    Get Meta Details

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/metadetails?CONFIG=<encoded_json_value> -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "workspaceName": "<workspace-name>" }

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Get meta details",
        "data": {
            "workspaces": {
                "workspaceId": "1767024000003145002",
                "workspaceName": "Account details",
                "workspaceDesc": "",
                "orgId": "671712892"
            }
        }
    }
    

    Returns details of the specified workspace/view.

    request uri

    GET https://<ZohoAnalytics_Server_URI>/restapi/v2/metadetails

    oauthscope: ZohoAnalytics.metadata.read

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    workspaceName* String

    The name of the workspace.
    viewName String

    The name of the view.

    Possible Error Codes

    7103, 7104, 7301, 8083, 8504, 8518, 8535


    Get Datasources

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/datasources -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
       "status":"success",
       "summary":"Fetch Datasources",
       "data":{
          "dataSources":[
             {
                "datasourceName":"Zoho Books",
                "datasourceId":"7617000004356057",
                "source":"AnalyticsTest",
                "lastDataSyncStatus":"Data Sync Successful",
                "lastDataSyncTime":"18 January, 2022 12:30:05 PM GMT",
                "schedule":"Daily at 12:30 hrs GMT",
                "nextScheduleTime":"19 January, 2022 12:30:00 PM GMT",
                "syncUsed":"0",
                "totalSyncAllowed":"5"
             },
             {
                "datasourceName":"LinkedIn Ads",
                "datasourceId":"7617000005026296",
                "source":"Ad Account_test",
                "lastDataSyncStatus":"Data Sync Successful",
                "lastDataSyncTime":"18 January, 2022 10:52:00 PM IST",
                "schedule":"Every 3 Hours",
                "nextScheduleTime":"18 January, 2022 06:38:33 PM GMT",
                "syncUsed":"1",
                "totalSyncAllowed":"5"
             }
          ]
       }
    }
    

    Returns list of datasources for the specified workspace.

    request uri

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

    oauthscope: ZohoAnalytics.metadata.read

    Possible Error Codes

    7103, 7301, 7387, 8518, 8535


    Sync Data

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/datasources/<datasource-id>/sync -X 'POST' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 204 No Content
    

    Initiate data sync for the specified datasource.

    request uri

    POST https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/datasources/<datasource-id>/sync

    oauthscope: ZohoAnalytics.metadata.create

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    userName String

    Datasource credential - username
    password String

    Datasource credential - password

    Possible Error Codes

    7103, 7301, 8083, 8518, 8535, 18061


    Refetch Data

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/views/<view-id>/sync -X 'POST' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 204 No Content
    

    Sync data from available datasource for the specified view.

    request uri

    POST https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/views/<view-id>/sync

    oauthscope: ZohoAnalytics.metadata.create

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    userName String

    Datasource credential - username
    password String

    Datasource credential - password

    Possible Error Codes

    7103, 7104, 7301, 8083, 8518, 8535


    Get Last Import Details

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/views/<view-id>/importdetails -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
       "status":"success",
       "summary":"Fetch last import details",
       "data":{
          "viewName":"SampleSales",
          "lastImportTime":"18 October, 2021 11:02:41 AM GMT",
          "lastImportStatus":"Success",
          "columns":{
             "total":"7",
             "success":"7"
          },
          "rows":{
             "total":"755",
             "success":"755",
             "warning":"0",
             "failed":"0"
          },
          "importErrors":""
       }
    }
    

    Returns last import details of the specified view.

    request uri

    GET https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/views/<view-id>/importdetails

    oauthscope: ZohoAnalytics.metadata.read

    Possible Error Codes

    7103, 7104, 7301, 8083, 8518, 8535


    Update Datasource Connection

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/datasources/<datasoure-id>?CONFIG=<encoded_json_value> -X 'PUT' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "serviceName":"AMAZON RDS", "databaseType":"POSTGRESQL", "hostName":"******", "port":"5432", "userName":"******", "password":"******", "cloudDatabaseName":"sampledb" }

    Sample Response:

    HTTP/1.1 204 No Content
    

    Update connection details for the specified datasource.

    request uri

    PUT https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/datasources/<datasource-id>

    oauthscope: ZohoAnalytics.metadata.update

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    serviceName*String

    Name of the cloud service.

    Allowed Values:

    • AMAZON RDS
    • AMAZON REDSHIFT
    • MICROSOFT AZURE
    • GOOGLE CLOUD SQL
    • HEROKU POSTGRESQL
    • LOCAL DATABASE
    • SNOWFLAKE
    • AMAZON ATHENA
    • GOOGLE BIG QUERY
    • PANOPLY
    • RACKSPACE CLOUD
    • IBM CLOUD
    • ORACLE CLOUD
    • OTHER CLOUD SERVICES
    databaseTypeString

    Type of the database.

    Allowed Values:

    • MYSQL
    • SQLSERVER
    • ORACLE
    • POSTGRESQL
    • MARIADB
    • AMAZON AURORA MYSQL
    • PERVASIVE
    • SYBASE
    • AMAZON ATHENA
    • SQL DATABASE
    • SQL DATA WAREHOUSE
    • MEMSQL
    • DB2
    • AMAZON AURORA POSTGRESQL
    • EXASOL
    • VERTICA
    • AMAZON VECTOR
    • GREENPLUM
    • DENODO
    • JDBC CONNECTION
    hostName*String
    • For AMAZON ATHENA service - provide the AWS Region value.
    • For SNOWFLAKE service - provide full name of your account as in snowflake.
    • For all other services - provide the service endpoint (or) hostname, used to identifiy the cloud database instance. This can be obtained from the management console provided by the respective cloud database services.
    portInteger

    Database port number.
    userName*String

    Service provider login username.
    passwordString

    Service provider login password.
    cloudDatabaseNameString

    Specify the database name as in the cloud service.
    instanceNameString

    For SQLSERVER datatype - provide the instance name on which your database is present. If not specified, then default instance will be taken to establish connection.
    s3OutputLocationString

    For AMAZON ATHENA service - provide the Amazon s3 location path where you want to store the query results. This path should be prefixed bt s3://.
    warehouseNameString

    For SNOWFLAKE service - provide the warehousename value on which your snowflake database instance is present. Make sure that the provided warehouse is active and the given user has permission to access the database.
    sIdString

    For ORACLE service - provide the oracle service name value.
    projectIdString

    For GOOGLE BIG QUERY service - provide the project id of your BigQuery project. This can be obtained from the dashboard of your Google Cloud console.
    refreshTokenString

    For GOOGLE BIG QUERY service - provide the refresh token value.
    accessTokenString

    For GOOGLE BIG QUERY service - provide the access token value.
    useSSLBoolean

    Set true if your database server set up to serve encrypted data through SSL. Default false.

    Possible Error Codes

    7103, 7301, 8083, 8504, 8518, 8535, 18011, 18040, 18041, 18042, 18043, 18044, 18056, 18060, 18061


    Enable Domain Workspace

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/wlaccess -X 'POST' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 204 No Content

    Enable workspace to the specified white label domain.

    request uri

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

    oauthscope: ZohoAnalytics.metadata.update

    Possible Error Codes

    7103, 7301, 7387, 8083, 8518, 8535


    Disable Domain Workspace

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/wlaccess -X 'DELETE' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 204 No Content

    Disable workspace from the specified white label domain.

    request uri

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

    oauthscope: ZohoAnalytics.metadata.update

    Possible Error Codes

    7103, 7301, 7387, 8083, 8518, 8535


    Error codes in Metadata API

    Sample Error:

    HTTP/1.1 400 Bad Request
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "failure",
        "summary": "META_OBJECT_NOT_PRESENT",
        "data": {
            "errorCode": 7103,
            "errorMessage": "Workspace not found! Please check whether the workspace exists."
        }
    }
    

    This section lists all possible error codes that could be sent from the Zoho Analytics server on failure of Metadata APIs. You can use this for appropriate error handling.

    Error Codes

    Error-Code Reason Solution
    7103 The workspace id mentioned in the API does not exist. Provide the valid workspace id.
    7104 The view id specified in the API does not exist. Provide the valid view id.
    7301 You (your full name) do not have the permission to do this operation. Access as administrator or permitted user to perform the operation.
    7387 Workspaces does not belongs to current organization. Provide a valid organization and workspace id.
    7925 You are not part of the analytics organization. Create your analytics organization.
    8060 Domain does not exist. Provide a valid domain name that you have purchased from Zoho Analytics.
    8078 The mentioned attribute has an empty value. Provide a valid JSON data.
    8079 The mentioned attribute is not present in the JSON configuration. Provide a valid JSON data.
    8083 Organization id is not present in the request header. Provide a valid organization id in the request header.
    8504 The required parameter is not proper or has not been sent. Send the parameter with valid data.
    8518 Invalid authentication. Provide a valid OAuth token for API authentication.
    8535 Invalid oauthtoken. Provide a valid OAuth token.
    18011 Cannot connect to specified Endpoint. Please check the specified Endpoint is correct and try again. Provid a valid endpoint value for the attribute HOSTNAME.
    18040 Login failed for specified user. Please check the username and password. Check whether the username and password provided are valid for connecting the cloud service.
    18041 Provided database does not exist. Please check the details provided. Check whether the provided database exist in the cloud service.
    18042 Cannot connect to the specified S3 Output Location. Check whether the provided S3 Output Location is valid.
    18043 Cannot connect to the specified region. Check whether the provide AWS region of the Athena Database is valid.
    18044 Provided Project Id does not exist or you are not authorized to access this project in Google BigQuery. Check whether the provide Project Id is valid for connecting Google BigQuery service.
    18056 Cloud connections not available for this table. Provide a view name which has an existing cloud connection.
    18060 Provided workspace do not have a live connection setup. Specify a workspace with live connect setup.
    18061 Provided datasource id not associated for the workspace. Check whether the provided datasource id is valid and the datasource is present in the specified workspace.

    In case of any error other than the above said, mail the API request URL parameters and error response details to support@zohoanalytics.com. Zoho Analytics Team will get back to you with the best possible solution.

    Sharing and Collaboration API

    Share APIs used to share views (reports & dashboards) with permissions to users. You can also manage view sharing as well as remove sharing through APIs.


    Get Org Admins

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/orgadmins -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Get org admins",
        "data": {
            "orgAdmins": [
                "user+1@zoho.com",
                "user+2@zoho.com"
            ]
        }
    }
    
    HTTP/1.1 204 No Content

    Returns list of admins for a specified organization.

    request uri

    GET https://<ZohoAnalytics_Server_URI>/restapi/v2/orgadmins

    oauthscope: ZohoAnalytics.share.read

    Possible Error Codes

    8083, 8518, 8535


    Get Workspace Admins

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/admins -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Get workspace admins",
        "data": {
            "workspaceAdmins": [
                {
                    "adminMembers": [
                        "user+1@zoho.com",
                        "user+2@zoho.com"
                    ]
                }
            ]
        }
    }
    

    Returns list of admins for the specified workspace.

    request uri

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

    oauthscope: ZohoAnalytics.share.read

    Possible Error Codes

    7301, 7387, 8083, 8518, 8535


    Add Workspace Admins

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/admins?CONFIG=<encoded_json_value> -X 'POST' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "emailIds": ["<email-id1>", "<email-id2>"] }

    Sample Response:

    HTTP/1.1 204 No Content

    Add admins for the specified workspace.

    request uri

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

    oauthscope: ZohoAnalytics.share.create

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    emailIds* JSONArray

    The email address of the admin users to be added.
    Sample: ["emailId1","emailId2"]
    domainName String

    Name of the domain.
    To add users to the white label domain.

    Possible Error Codes

    7103, 7301, 7387, 8078, 8079, 8083, 8504, 8518, 8535


    Remove Workspace Admins

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/admins?CONFIG=<encoded_json_value> -X 'DELETE' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "emailIds": ["<email-id1>", "<email-id2>"] }

    Sample Response:

    HTTP/1.1 204 No Content

    Remove admins from the specified workspace.

    request uri

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

    oauthscope: ZohoAnalytics.share.delete

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    emailIds* JSONArray

    The email address of the admin users to be removed.

    Sample: ["emailId1","emailId2"]
    domainName String

    Name of domain.
    To remove users from the white label domain.

    Possible Error Codes

    7103, 7301, 7387, 8078, 8079, 8083, 8504, 8518, 8535


    Get Workspace Shared Details

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/share -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Get share info",
        "data": {
            "userShareInfo": [
                {
                    "emailId": "user+1@zoho.com",
                    "views": [
                        {
                            "viewId": "1767024000003145011",
                            "viewName": "Accounts",
                            "sharedBy": "bruce.wn@zoho.com",
                            "permissions": {
                                "read": true,
                                "export": false,
                                "vud": false,
                                "addRow": false,
                                "updateRow": false,
                                "deleteRow": false,
                                "deleteAllRows": false,
                                "importAppend": false,
                                "importAddOrUpdate": false,
                                "importDeleteAllAdd": false,
                                "importDeleteUpdateAdd": false,
                                "drillDown": false,
                                "share": false,
                                "discussion": true
                            }
                        }
                    ]
                }
            ],
            "groupShareInfo": [],
            "publicShareInfo": {
                "emailId": "Public Visitor",
                "views": [
                    {
                        "viewId": "1767024000003145052",
                        "viewName": "Sales",
                        "sharedBy": "bruce.wn@zoho.com",
                        "permissions": {
                            "read": true,
                            "export": false,
                            "vud": false,
                            "addRow": false,
                            "updateRow": false,
                            "deleteRow": false,
                            "deleteAllRows": false,
                            "importAppend": false,
                            "importAddOrUpdate": false,
                            "importDeleteAllAdd": false,
                            "importDeleteUpdateAdd": false,
                            "drillDown": false,
                            "share": false,
                            "discussion": false
                        }
                    }
                ]
            },
            "privateLinkShareInfo": {}
        }
    }
    

    Returns shared details of the specified workspace.

    request uri

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

    oauthscope: ZohoAnalytics.share.read

    Possible Error Codes

    7103, 7301, 7387, 8078, 8079, 8083, 8504, 8518, 8535


    Share Views

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/share?CONFIG=<encoded_json_value> -X 'POST' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "emailIds": ["<email-id1>", "<email-id2>"], "viewIds": ["<view-id1>", "<view-id2>"], "permissions": { "read": "true", "export": "true" } }

    Sample Response:

    HTTP/1.1 204 No Content

    Share views to the specified users.

    request uri

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

    oauthscope: ZohoAnalytics.share.create

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    emailIds* JSONArray

    The email address of the users to whom the views need to be shared.

    Sample: ["emailId1","emailId2"]
    viewIds* JSONArray

    View ids which to be shared.

    Sample: ["viewId1","viewId2"]
    permissions* JSONObject

    Permissions JSON object (permission attributes table).

    Sample: {"read":true,"vud":true,"export":true}
    criteria String

    To apply filter criteria while sharing a view to users. The specified criteria will be applied to the reports shared, thereby filtering the data viewed, when the report is accessed by the shared user.

    Sample: {"criteria":"\"SalesTable\".\"Region\"='East'"}
    Refer this link for more details about how to construct a criteria.
    inheritParentFilterCriteria Boolean

    This is valid only for reports(not tables). If true, then its parent tables’ criteria is also taken into account while sharing.
    inviteMail Boolean

    To send the invitation mail to the provided email addresses.
    inviteMailCCMe Boolean

    to CC the invitation mail to you on sharing.
    mailSubject String

    Invitation mail subject.
    mailMessage String

    Invitation mail messasge.
    domainName String

    Name of domian.
    To to share views to the white label domain.

    Permission Attributes

    Key Description
    read* Boolean

    Permission to access the view.
    Should be true.
    export Boolean

    Permission to export the view data.
    Default value - false.
    vud Boolean

    Permission to view the underlying data.
    Default value - false.
    drillDown Boolean

    Permission to drill down in a chart.
    Default value - false.
    addRow Boolean

    Permission to add a row in the table.
    Default value - false.
    updateRow Boolean

    Permission to update a row in the table.
    Default value - false.
    deleteRow Boolean

    Permission to delete a row in the table.
    Default value - false.
    deleteAllRows Boolean

    Permission to delete all rows in the table.
    Default value - false.
    importAppend Boolean

    Permission to import data into the table using APPEND option.
    Default value - false.
    importAddOrUpdate Boolean

    Permission to import data into the table using UPDATEADD option.
    Default value - false.
    importDeleteAllAdd Boolean

    Permission to import data into the table using the TRUNCATEADD option.
    Default value - false.
    share Boolean

    Permission to share the view to other users.
    Default value - false.
    discussion Boolean

    Permission to allow commenting in the view.
    Default value - false.

    Possible Error Codes

    7103, 7104, 7301, 7387, 8060, 8078, 8079, 8083, 8504, 8518, 8535


    Remove Share

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/share?CONFIG=<encoded_json_value> -X 'DELETE' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "emailIds": ["<email-id1>", "<email-id2>"], "removeAllViews": "true" }

    Sample Response:

    HTTP/1.1 204 No Content

    Remove shared views for the specified users.

    request uri

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

    oauthscope: ZohoAnalytics.share.delete

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    emailIds* JSONArray

    The email address of the users to whom the sharing need to be removed.

    Sample: ["emailId1", "emailId2"]
    viewIds JSONArray

    View ids whose sharing needs to be removed.

    Sample: ["viewId1", "viewId2"]
    removeAllViews Boolean

    To remove all the shared views for the specified users.
    domainName String

    Name of the domain.
    To remove the shared views from the white label domain.

    Possible Error Codes

    7103, 7104, 7301, 7387, 8060, 8078, 8079, 8083, 8504, 8518, 8535


    Get My Permissions

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/views/<view-id>/share/mypermissions -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Get user permissions",
        "data": {
            "permissions": {
                "read": true,
                "export": true,
                "vud": true,
                "addRow": true,
                "updateRow": true,
                "deleteRow": true,
                "deleteAllRows": true,
                "importAppend": true,
                "importAddOrUpdate": true,
                "importDeleteAllAdd": true,
                "importDeleteUpdateAdd": true,
                "drillDown": true,
                "share": true,
                "discussion": true
            }
        }
    }
    

    Returns permissions for the specified view.

    request uri

    GET https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/views/<view-id>/share/mypermissions

    oauthscope: ZohoAnalytics.share.read

    Possible Error Codes

    7103, 7104, 7301, 7387, 8083, 8504, 8518, 8535


    Get Groups

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/groups -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Get groups",
        "data": {
            "groups": [
                {
                    "groupName": "Group-1",
                    "groupId": "1767024000003150004",
                    "groupDesc": "",
                    "groupMembers": [
                        "user+1@zoho.com",
                        "bruce.wn@zoho.com"
                    ]
                },
                {
                    "groupName": "Group-2",
                    "groupId": "1767024000003150006",
                    "groupDesc": "",
                    "groupMembers": [
                        "bruce.wn@zoho.com"
                    ]
                }
            ]
        }
    }
    

    Returns list of groups for the specified workspace.

    request uri

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

    oauthscope: ZohoAnalytics.share.read

    Possible Error Codes

    7103, 7301, 7338, 7387, 8083, 8504, 8518, 8535


    Get Group Details

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/groups/<group-id> -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Get group details",
        "data": {
            "groups": {
                "groupName": "Group-1",
                "groupId": "1767024000003150004",
                "groupDesc": "",
                "groupMembers": [
                    "user+1@zoho.com",
                    "bruce.wn@zoho.com"
                ]
            }
        }
    }
    

    Returns details of the specified group.

    request uri

    GET https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/groups/<group-id>

    oauthscope: ZohoAnalytics.share.read

    Possible Error Codes

    7103, 7301, 7338, 7387, 8083, 8504, 8518, 8535


    Create Group

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/groups?CONFIG=<encoded_json_value> -X 'POST' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "groupName": "<group-name>", "emailIds": ["<email-id1>", "<email-id2>"] }

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Create group",
        "data": {
            "groupId": "1767024000003145069"
        }
    }
    

    Create a group in the specified workspace.

    request uri

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

    oauthscope: ZohoAnalytics.share.create

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    groupName* String

    Name of the group.
    groupDesc String

    Description of the group.
    emailIds* JSONArray

    The email address of the users to be added to the group.

    Sample: ["emailId1", "emailId2"]
    inviteMail Boolean

    To send the invitation mail to the provided email addresses.
    mailSubject String

    Invitation mail subject.
    mailMessage String

    Invitation mail messasge.
    domainName String

    Name of the domain
    To map the created group to the specified domain.

    Possible Error Codes

    7103, 7282, 7301, 7338, 7387, 8060, 8078, 8079, 8083, 8504, 8518, 8535


    Rename Group

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/groups/<group-id>?CONFIG=<encoded_json_value> -X 'PUT' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "groupName": "<group-name>" }

    Sample Response:

    HTTP/1.1 204 No Content

    Rename a specified group.

    request uri

    PUT https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/groups/<group-id>

    oauthscope: ZohoAnalytics.share.update

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    groupName* String

    New name for the group.
    groupDesc String

    New description for the group.

    Possible Error Codes

    7103, 7282, 7301, 7338, 7387, 8078, 8079, 8083, 8504, 8518, 8535


    Add Group Members

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/groups/<group-id>/members?CONFIG=<encoded_json_value> -X 'POST' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "emailIds": ["<email-id1>", "<email-id2>"] }

    Sample Response:

    HTTP/1.1 204 No Content

    Add users to the specified group.

    request uri

    POST https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/groups/<group-id>/members

    oauthscope: ZohoAnalytics.share.create

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    emailIds* JSONArray

    The email address of the users to be added to the group.

    Sample: ["emailId1", "emailId2"]
    inviteMail Boolean

    To send the invitation mail to the provided email addresses.
    mailSubject String

    Invitation mail subject.
    mailMessage String

    Invitation mail messasge.

    Possible Error Codes

    7103, 7301, 7387, 8078, 8079, 8083, 8504, 8518, 8535


    Remove Group Members

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/groups/<group-id>/members?CONFIG=<encoded_json_value> -X 'DELETE' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "emailIds": ["<email-id1>", "<email-id2>"] }

    Sample Response:

    HTTP/1.1 204 No Content

    Remove users from the specified group.

    request uri

    DELETE https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/groups/<group-id>/members

    oauthscope: ZohoAnalytics.share.delete

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    emailIds* JSONArray

    The email address of the users to be removed from the group.

    Sample: ["emailId1", "emailId2"]
    notifyUser Boolean

    To send the notification mail to the provided email addresses.

    Possible Error Codes

    7103, 7301, 7387, 8078, 8079, 8083, 8504, 8518, 8535


    Delete Group

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/groups/<group-id> -X 'DELETE' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 204 No Content

    Delete a specified group.

    request uri

    DELETE https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/groups/<group-id>

    oauthscope: ZohoAnalytics.share.delete

    Possible Error Codes

    7103, 7301, 7387, 8078, 8079, 8083, 8504, 8518, 8535


    Error codes in Sharing API

    Sample Error:

    HTTP/1.1 400 Bad Request
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "failure",
        "summary": "META_OBJECT_NOT_PRESENT",
        "data": {
            "errorCode": 7103,
            "errorMessage": "Workspace not found! Please check whether the workspace exists."
        }
    }
    

    This section lists all possible error codes that could be sent from the Zoho Analytics server on failure of Sharing APIs. You can use this for appropriate error handling.

    Error Codes

    Error-Code Reason Solution
    6028 User is in inactive state. Change user status to active.
    7003 Required parameters are missing in the request. Send all the required parameters related to that particular action.
    7103 The workspace id mentioned in the API does not exist. Provide the valid workspace id.
    7104 The view id specified in the API does not exist. Provide the valid view id.
    7105 View name specified in the Workspace does not exist. Provide a valid view name.
    7106 View id not present in the Workspace. Provide a valid view id.
    7282 Group name already exist. Provide a different group name.
    7301 You (your full name) do not have the permission to do this operation. Access as administrator or permitted user to perform the operation.
    7338 Group does not belongs to current workspace. Provide a valid group id.
    7387 Workspaces does not belongs to current organization. Provide a valid organization and workspace id.
    8026 Permission configuration missing. Atleast any one of the following permission is required: [read, export, vud, drillDown, addRow, updateRow, deleteRow, deleteAllRows, importAppend, importAddOrUpdate, importDeleteAllAdd, share, discussion].
    8027 Mentioned workspace/view is not found. Provide a valid workspace/view name.
    8060 Domain does not exist. Provide a valid domain name that you have purchased from Zoho Analytics.
    8078 The mentioned attribute has an empty value. Provide a valid JSON data.
    8079 The mentioned attribute is not present in the JSON configuration. Provide a valid JSON data.
    8083 Organization id is not present in the request header. Provide a valid organization id in the request header.
    8504 The required parameter is not proper or has not been sent. Send the parameter with valid data.
    8518 Invalid authentication. Provide a valid OAuth token for API authentication.
    8535 Invalid oauthtoken. Provide a valid OAuth token.

    In case you encounter any other errors, please mail the API request URL parameters and error response details to support@zohoanalytics.com. Zoho Analytics Team will get back to you shortly with the best possible solution.

    Embed API

    Embed APIs are used to embed reports, dashboards created in Zoho Analytics into your Web pages/applications programmatically. It also offers possibilities to developers for creating dynamic reporting content embedded within their websites and applications seamlessly.


    Get View URL

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/views/<view-id>/publish -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Get view url",
        "data": {
            "viewUrl": "https://analyticsapi.zoho.com/open-view/1767024000003145011?ZDB_THEME_NAME=blue"
        }
    }
    

    Returns the URL to access the specified view.

    request uri

    GET https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/views/<view-id>/publish

    oauthscope: ZohoAnalytics.embed.read

    Query Parameters

    Parameter Name Description
    CONFIG JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    criteria String

    If criteria is sent, then the rows matching the criteria alone are visible, else all the rows are visible.

    Sample: {"criteria":"\"SalesTable\".\"Region\"='East'"}
    Refer this link for more details about how to construct a criteria.
    includeTitle Boolean

    To display the view name in the embedded mode.
    Default value - true.
    includeDesc Boolean

    To display the view description in the embedded mode.
    Default value - true.
    includeToolBar Boolean

    To include the toolbar in the embedded mode.
    Default value - false.
    includeSearchBox Boolean

    To include the search box in the table.
    Default value - false.
    includeDatatypeSymbol Boolean

    To include the datatype symbol in the table column.
    Default value - false.
    legendPosition String

    Controls to display the position on the legend.
    • RIGHT
    • LEFT
    • TOPLEFT
    • TOPRIGHT
    • TOPCENTER
    • BOTTOMLEFT
    • BOTTOMRIGHT
    • BOTTOMCENTER
    • NONE

    Possible Error Codes

    7103, 7104, 7301, 7387, 8083, 8518, 8535


    Get Embed URL (Only For Embedded Analytics Customers)

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/views/<view-id>/publish/embed -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Get embed url",
        "data": {
            "embedUrl": "https://analyticsapi.zoho.com/open-view/1767024000003145011?ZDB_THEME_NAME=blue&FS=OS&NEW_ENCRYPTION=true&RSCONFIG=2d91fa85daeb3d27387880153d16f3c6a8ed4301aa9abfed9e4ac83ca3f1d89da971986afb68149365831e6f619752c7d75bd0489f017feb75ca54d06f835a7ebe4981c3ffa5d656a25dd84e2b5a37e2"
        }
    }
    

    Returns embed URL to access the specified view.

    The generated URL is a short-living URL, which adds more security to the URL. This URL does not require a login and is controlled by the permissions based on the configurations.

    request uri

    GET https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/views/<view-id>/publish/embed

    oauthscope: ZohoAnalytics.embed.read

    Query Parameters

    Parameter Name Description
    CONFIG JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    criteria String

    If criteria is sent, then the rows matching the criteria alone are visible, else all the rows are visible.

    Sample: {"criteria":"\"SalesTable\".\"Region\"='East'"}
    Refer this link for more details about how to construct a criteria.
    includeTitle Boolean

    To display the view name in the embedded mode.
    Default value - true.
    includeDesc Boolean

    To display the view description in the embedded mode.
    Default value - true.
    includeToolBar Boolean

    To include the toolbar in the embedded mode.
    Default value - false.
    includeSearchBox Boolean

    To include the search box in the table.
    Default value - false.
    includeDatatypeSymbol Boolean

    To include the datatype symbol in the table column.
    Default value - false.
    legendPosition String

    Controls to display the position on the legend.
    • RIGHT
    • LEFT
    • TOPLEFT
    • TOPRIGHT
    • TOPCENTER
    • BOTTOMLEFT
    • BOTTOMRIGHT
    • BOTTOMCENTER
    • NONE
    validityPeriod Integer

    Controls the validity period(in seconds) of the generated URL.
    Default value - 3600 seconds(One hour).
    permissions JSONObject

    Permissions JSON object (permission attributes table).

    Sample: {"vud":true,"export":true}
    vudColumns Array of JSONObject

    To limit the view underlying data option to specified columns from specified tables.
    This will be valid only if the vud permission is set to true.

    Sample: [{"tableName":"table1","columnNames":["column1","column2"]}]
    drillColumns Array of JSONObject

    To limit the drill down option to specified columns from specified tables.
    This will be valid only if the drillDown permission is set to true.

    Sample: [{"tableName":"table1","columnNames":["column1","column2"]}]
    language String

    To specify language for the embed view.
    Default value - english
    • english
    • chinese
    • japanese
    • french
    • italian
    • spanish
    • portuguese
    • portuguese_td
    • german
    • chinese_td
    • dutch
    • russian
    • polish
    • arabic
    • turkish
    • hungarian
    • hebrew
    • swedish
    • korean
    • danish
    • ukranian
    • vietnamies
    • bulgarian
    • croatian
    • czech
    • hindi
    • thai
    • indonesian
    • malay

    Permission Attributes

    Key Description
    export Boolean

    Permission to export the data.
    Default value - false.
    vud Boolean

    Permission to view the Underlying data.
    Default value - false.
    drillDown Boolean

    Permission to drill down in a Chart.
    Default value - false.

    Possible Error Codes

    7103, 7104, 7301, 7387, 7395, 8083, 8518, 8535


    Get Private URL

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/views/<view-id>/publish/privatelink -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Get private url",
        "data": {
            "privateUrl": "https://analyticsapi.zoho.com/open-view/1767024000003145011/eee1191ea88d52e486aaecf5f748dc56"
        }
    }
    

    Returns private URL to access the specified view.

    request uri

    GET https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/views/<view-id>/publish/privatelink

    oauthscope: ZohoAnalytics.embed.read

    Possible Error Codes

    7103, 7104, 7301, 7387, 7395, 8083, 8518, 8535


    Create Private URL

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/views/<view-id>/publish/privatelink -X 'POST' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Create private url",
        "data": {
            "privateUrl": "https://analyticsapi.zoho.com/open-view/1767024000003145011/eee1191ea88d52e486aaecf5f748dc56"
        }
    }
    

    Create a private URL for the specified view.

    request uri

    POST https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/views/<view-id>/publish/privatelink

    oauthscope: ZohoAnalytics.embed.update

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    criteria String

    If criteria is sent, then the rows matching the criteria alone are visible, else all the rows are visible.

    Sample: {"criteria":"\"SalesTable\".\"Region\"='East'"}
    Refer this link for more details about how to construct a criteria.
    permissions JSONObject

    Permissions JSON object (permission attributes table).

    Sample: {"vud":true, "export":true}
    regenerateKey Boolean

    To generate a new privatekey, previously generated privatelink will be disabled.
    Default value - false.

    Permission Attributes

    Key Description
    export Boolean

    Permission to export the data.
    Default value - false.
    vud Boolean

    Permission to view the Underlying data.
    Default value - false.
    drillDown Boolean

    Permission to drill down in a Chart.
    Default value - false.

    Possible Error Codes

    7103, 7104, 7301, 7387, 7395, 8083, 8518, 8535


    Get Slideshows

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/slides -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Get slideshows",
        "data": {
            "slideshows": [
                {
                    "slideName": "Slideshows 1",
                    "slideId": "1767024000003149001",
                    "accessType": 0
                },
                {
                    "slideName": "Slideshows 2",
                    "slideId": "1767024000003120002",
                    "accessType": 1
                }
            ]
        }
    }
    

    Returns list of slideshows for the specified workspace.

    request uri

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

    oauthscope: ZohoAnalytics.embed.read

    Possible Error Codes

    7103, 7104, 7301, 7387, 7395, 8083, 8518, 8535


    Get Slideshow Details

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/slides/<slide-id> -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Get slideshow details",
        "data": {
            "slideInfo": {
                "slideId": "1767024000003149001",
                "slideKey": "9a4c1042011ce02fc4a3182fa75a22a9",
                "slideName": "Slideshows 1",
                "accessType": 0,
                "viewIds": [
                    "1767024000003013087",
                    "1767024000003015001",
                    "1767024000003011002",
                ]
            }
        }
    }
    

    Returns details of the specified slide.

    request uri

    GET https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/slides/<slide-id>

    oauthscope: ZohoAnalytics.embed.read

    Possible Error Codes

    7103, 7104, 7301, 7387, 7395, 8083, 8518, 8535


    Get Slideshow URL

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/slides/<slide-id>/publish -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Get slideshow url",
        "data": {
            "slideUrl": "https://analyticsapi.zoho.com/ZDBSlideshow.cc?SLIDEID=1767024000003139001&SLIDEKEY=9c4a1042011ce02fc4a3182fa75a22a9&AUTOPLAY=true&INTERVAL=25&INCLUDETITLE=true&INCLUDEDESC=true&SOCIALWIDGETS=false"
        }
    }
    

    Returns slide URL to access the specified slide.

    request uri

    GET https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/slides/<slide-id>/publish

    oauthscope: ZohoAnalytics.embed.read

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    includeTitle Boolean

    To display the view name in the embedded mode.
    Default value - true.
    includeDesc Boolean

    To display the view description in the embedded mode.
    Default value - true.
    includeSocialWidgets Boolean

    To include the social widgets in the slide.
    Default value - false.
    autoplay Boolean

    To scroll to the next view in the slideshow automatically.
    Default value - false.
    withCustomDomain Boolean

    To get the slide url with your custom domain address.
    Default value - false.
    slideInterval Integer

    Interval time(in seconds)
    Time interval at which the views present in the slideshow switch.
    Note:value should be between 10 to 300.

    Possible Error Codes

    7103, 7104, 7301, 7387, 7395, 8083, 8518, 8535


    Create Slideshow

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/slides?CONFIG=<encoded_json_value> -X 'POST' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "slideName": "<slide-name>", "viewIds": ["<view-id1>", "<view-id2>"] }

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Create slideshow",
        "data": {
            "slideId": "1767024000003151001",
            "slideUrl": "https://analyticsapi.zoho.com/ZDBSlideshow.cc?SLIDEID=1767024000003151001&SLIDEKEY=69ba2ec9bfbe548f494bdf798087db41&AUTOPLAY=true&INTERVAL=25&INCLUDETITLE=true&INCLUDEDESC=true&SOCIALWIDGETS=false"
        }
    }
    

    Create a slideshow in the specified workspace.

    request uri

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

    oauthscope: ZohoAnalytics.embed.create

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    slideName* String

    Name of the slideshow.
    viewIds* JSONArray

    View ids to be included in the slideshow.

    Sample: ["viewId1","viewId2"]

    Possible Error Codes

    7103, 7104, 7301, 7387, 7395, 8083, 8518, 8535


    Update Slideshow

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/slides/<slide-id>?CONFIG=<encoded_json_value> -X 'PUT' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "slideName": "<slide-name>" }

    Sample Response:

    HTTP/1.1 204 No Content

    Update details of the specified slideshow.

    request uri

    PUT https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/slides/<slide-id>

    oauthscope: ZohoAnalytics.embed.update

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    slideName String

    The new name of the slide.
    viewIds JSONArray

    View ids to be included in the slideshow.

    Sample: ["viewId1","viewId2"]
    regenerateSlideKey Boolean

    To generate a new slidekey, previously generated link will be disabled.
    Default value - false.

    Possible Error Codes

    7103, 7104, 7301, 7387, 7395, 8083, 8518, 8535


    Delete Slideshow

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/slides/<slide-id> -X 'DELETE' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 204 No Content

    Delete a specified slideshow in the workspace.

    request uri

    DELETE https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/slides/<slide-id>

    oauthscope: ZohoAnalytics.embed.delete

    Possible Error Codes

    7103, 7104, 7301, 7387, 7395, 8083, 8518, 8535


    Error codes in Embed API

    Sample Error:

    HTTP/1.1 400 Bad Request
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "failure",
        "summary": "ATTRIBUTE_NOT_PRESENT_IN_JSON_CONFIGURATION",
        "data": {
            "errorCode": 8079,
            "errorMessage": "Attribute 'viewIds' not present in the JSON configuration. Kindly provide a valid JSON configuration."
        }
    }
    

    This section lists all possible error codes that could be sent from the Zoho Analytics server on failure of Embed APIs. You can use this for appropriate error handling.

    Error Codes

    Error-Code Reason Solution
    7103 The workspace id mentioned in the API does not exist. Provide the valid workspace id.
    7104 The view id specified in the API does not exist. Provide the valid view id.
    7301 You (your full name) do not have the permission to do this operation. Access as administrator or permitted user to perform the operation.
    7387 Workspaces does not belongs to current organization. Provide a valid organization and workspace id.
    7395 Column not present in the workspace. Provide a valid column.
    8060 Domain does not exist. Provide a valid domain name that you have purchased from Zoho Analytics.
    8078 The mentioned attribute has an empty value. Provide a valid JSON data.
    8079 The mentioned attribute is not present in the JSON configuration. Provide a valid JSON data.
    8083 Organization id is not present in the request header. Provide a valid organization id in the request header.
    8504 The required parameter is not proper or has not been sent. Send the parameter with valid data.
    8518 Invalid authentication. Provide a valid OAuth token for API authentication.
    8535 Invalid oauthtoken. Provide a valid OAuth token.

    In case of any error other than the above said, mail the API request URL parameters and error response details to support@zohoanalytics.com. Zoho Analytics Team will get back to you with the best possible solution.

    User Management API

    Manage user APIs are used to Add / Remove / Activate / Deactivate users to your Zoho Analytics organization.

    Note:This APIs cannot be used to create user accounts in Zoho. This is just meant to associate an existing Zoho user to a Zoho Analytics organization held by an administrator.


    Get Users

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/users -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Get users",
        "data": {
            "users": [
                {
                    "emailId": "user1@gmail.com",
                    "status": true,
                    "role": "Organization Admin"
                },
                {
                    "emailId": "user2@gmail.com",
                    "status": true,
                    "role": "User"
                }
            ]
        }
    }
    

    Returns list of users for the specified organization.

    request uri

    GET https://<ZohoAnalytics_Server_URI>/restapi/v2/users

    oauthscope: ZohoAnalytics.usermanagement.read

    Possible Error Codes

    7301, 8078, 8079, 8083, 8504, 8509, 8518, 8535


    Add Users

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/users?CONFIG=<encoded_json_value> -X 'POST' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "emailIds": ["<email-id1>", "<email-id2>"] }

    Sample Response:

    HTTP/1.1 204 No Content

    Add users to the specified organization.

    request uri

    POST https://<ZohoAnalytics_Server_URI>/restapi/v2/users

    oauthscope: ZohoAnalytics.usermanagement.create

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    emailIds* JSONArray

    The email address of the users to be added.

    Sample: ["emailId1", "emailId2"]
    role String

    To specify the role for the new users.
    Supported roles:
    • USER
    • VIEWER
    • ORGADMIN

    Default Value: USER
    domainName String

    Name of the domain.
    To add users to the specified domain.

    Possible Error Codes

    7301, 8060, 8078, 8079, 8083, 8504, 8509, 8518, 8535


    Remove Users

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/users?CONFIG=<encoded_json_value> -X 'DELETE' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "emailIds": ["<email-id1>", "<email-id2>"] }

    Sample Response:

    HTTP/1.1 204 No Content

    Remove users from the specified organization.

    request uri

    DELETE https://<ZohoAnalytics_Server_URI>/restapi/v2/users

    oauthscope: ZohoAnalytics.usermanagement.delete

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    emailIds* JSONArray

    The email address of the users to be removed.

    Sample: ["emailId1", "emailId2"]
    domainName String

    Name of the domain.
    To remove users from the specified domain.

    Possible Error Codes

    7301, 8060, 8078, 8079, 8083, 8504, 8509, 8518, 8535


    Activate Users

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/users/active?CONFIG=<encoded_json_value> -X 'PUT' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "emailIds": ["<email-id1>", "<email-id2>"] }

    Sample Response:

    HTTP/1.1 204 No Content

    Activate users in the specified organization.

    request uri

    PUT https://<ZohoAnalytics_Server_URI>/restapi/v2/users/active

    oauthscope: ZohoAnalytics.usermanagement.update

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    emailIds* JSONArray

    The email address of the users to be activated.

    Sample: ["emailId1", "emailId2"]
    domainName String

    Name of the domain
    To activate users in the specified domain.

    Possible Error Codes

    7301, 8060, 8078, 8079, 8083, 8504, 8509, 8518, 8535


    Deactivate Users

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/users/inactive?CONFIG=<encoded_json_value> -X 'PUT' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "emailIds": ["<email-id1>", "<email-id2>"] }

    Sample Response:

    HTTP/1.1 204 No Content

    Deactivate users in the specified organization.

    request uri

    PUT https://<ZohoAnalytics_Server_URI>/restapi/v2/users/inactive

    oauthscope: ZohoAnalytics.usermanagement.update

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    emailIds* JSONArray

    The email address of the users to be deactivated.

    Sample: ["emailId1", "emailId2"]
    domainName String

    Name of the domain.
    To deactivate users in the specified domain.

    Possible Error Codes

    7301, 8060, 8078, 8079, 8083, 8504, 8509, 8518, 8535


    Change User Role

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/users/role?CONFIG=<encoded_json_value> -X 'PUT' -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Sample value for CONFIG parameter:

    Copy
    { "emailIds": ["<email-id1>", "<email-id2>"], "role": "USER" }

    Sample Response:

    HTTP/1.1 204 No Content

    Change role for the specified users.

    request uri

    PUT https://<ZohoAnalytics_Server_URI>/restapi/v2/users/role

    oauthscope: ZohoAnalytics.usermanagement.update

    Query Parameters

    Parameter Name Description
    CONFIG* JSONObject

    Config parameter specifications are available in the below section.

    Fields for CONFIG JSON

    Key Description
    emailIds* JSONArray

    The email address of the users to be deactivated.

    Sample: ["emailId1", "emailId2"]
    role* String

    To update the role for the specified users.
    Supported roles:
    • USER
    • VIEWER
    • ORGADMIN
    domainName String

    Name of the domain
    To update users role in the specified domain.

    Possible Error Codes

    7301, 8060, 8078, 8079, 8083, 8504, 8509, 8518, 8535


    Get Subscription Details

    Download client libraries : C# | GO | JAVA | PHP | PYTHON | NODEJS



    Sample Request:

    Copy
    curl https://analyticsapi.zoho.com/restapi/v2/subscription -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'

    Response Code:200

    Sample Response:

    HTTP/1.1 200 OK
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "success",
        "summary": "Get subscription details",
        "data": {
            "subscription": {
                "planName": "Premium",
                "addOns": "Zoho Recruit Connector,Zoho Books Connector",
                "billingDate": " - ",
                "trialStatus": false
            }
        }
    }
    

    Returns subscription details of the specified organization.

    request uri

    GET https://<ZohoAnalytics_Server_URI>/restapi/v2/subscription

    oauthscope: ZohoAnalytics.usermanagement.read

    Possible Error Codes

    8504 , 8506 , 8516


    Error codes in UserManagement API

    Sample Error:

    HTTP/1.1 400 Bad Request
    Content-Type:application/json;charset=UTF-8
    
    {
        "status": "failure",
        "summary": "LESS_THAN_MIN_OCCURANCE",
        "data": {
            "errorCode": 8504,
            "errorMessage": "The parameter CONFIG is not proper(Has not been sent or is less than required count)"
        }
    }
    

    This section lists all possible error codes that could be sent from the Zoho Analytics server on failure of UserManagement APIs. You can use this for appropriate error handling.

    Error Codes

    Error-Code Reason Solution
    6021 Activating Users not allowed since the users count exceeds the allowed limit for your Zoho Analytics Plan. You can upgrade your Zoho Analytics Account or you can get additional users as add-ons. You can manage your plan by clicking the “Subscription” link at top after you log into Zoho Analytics.
  • For more details on Zoho Analytics pricing visit:
  • https://www.zoho.com/analytics/zohoreports-pricing.html .
    7301 You (your full name) do not have the permission to do this operation. Access as administrator or permitted user to perform the operation.
    8060 Domain does not exist. Provide a valid domain name that you have purchased from Zoho Analytics.
    8078 The mentioned attribute has an empty value. Provide a valid JSON data.
    8079 The mentioned attribute is not present in the JSON configuration. Provide a valid JSON data.
    8083 Organization id is not present in the request header. Provide a valid organization id in the request header.
    8504 The required parameter is not proper or has not been sent. Send the parameter with valid data.
    8506 The mentioned parameter has been sent more than the required count. Check and remove that extra parameter mentioned in the response.
    8509 The Email Ids provided is not proper / not in the EMAIL ID format. Provide a proper email address.
    8516 Invalid value passed in the mentioned parameter. Provide the valid data to the mentioned parameter.
    8518 Invalid authentication. Provide a valid OAuth token for API authentication.

    In case you encounter any other errors, please mail the API request URL parameters and error response details to support@zohoanalytics.com. Zoho Analytics Team will get back to you shortly with the best possible solution.

    Single Sign On Integration (Only For White Label Customers)

    This section lists the APIs which can be used only by White Label customers (full rebranding) to easily implement single sign-on in their application for seamless user management .

    Zoho Analytics offer a full-fledged white label (private label) solution. As a part of it, supports Single Sign on (SSO) with your website / application. Using the below mentioned procedure, it would be possible for you to implement a loosely coupled login mechanism for the white labeled Zoho Analytics solution, that works with almost ANY authentication system that you currently are using. This would involve program changes in your website/application (code to be written at your end). This page outlines the various steps to setup, perform unit/integration testing and to go live with Zoho’s third party SSO integration.


    Setup Phase

    1. Provide the following information to the Zoho Analytics team:
      • IP addresses of your test and production setups
      • The login and logout page URLs of your website (these will process login and logout requests coming from Zoho Analytics; needed for your test and production setups too)
      • Domain/sub-domain names (CNAME mapping) for test and production setups. CNAME maps your test/production sub-domains to analytics.cs.zohohost.com
      • Fill the following Zoho Creator form to design your custom page - https://creator.zoho.com/zohodbhelp/domain-rebranding/#Form:DomainProperties
    2. After submitting the above information to the Zoho Analytics team, we will send you an API key to be used you. (this is a different API key than the one provided at http://api.zoho.com/)


    Sign Up API

    Sample Request:

    curl -d "apikey=apikey&operation=signup&email=[email id of the user to signup] 
    &full_name=[Full Name of the user]"
    https://[your domain]/sso

    Sample Success Response

    
    {
        "ticket":"666b88566441b69d1a137db824314b6a9be8959a75b1a1be8b951c6e18f352
                  bb2e068f7f697fa4879e365e19967a5b537a08c8e85058625130e54e8467d
                  85259",
        "result":"success",
        "zuid":5471
    }
    
    
    

    Sample Failure Response

    {
        "result":"failure",
        "cause":"Invalid APIKey"
    }
    

    Assuming your domain URL is analytics.finepick.com.

    URL Format

    form method="POST" action="https://analytics.finepick.com/sso" target="_self"
    input type= "hidden" name ="apikey" value="[your apikey]"
    input type ="hidden" name ="operation" value ="signup"
    input type ="hidden" name ="email" value ="[email id of the user to signup]"
    input type ="hidden" name ="full_name" value ="[Full Name of the user]"
    input type ="submit" name ="Sign Up" value ="submit"
    /form

    Important: You need to send an HTTPS POST request to Zoho Analytics for user Sign Up API.

    Input Parameters for Sign Up API

    Parameter Name Description
    operation Value is “signup”
    email Email Id of the user to sign up
    full_name (optional) Full Name of the user
    apikey Your API key

    Response for Sign Up API:

    Both Success & Failure responses are present in JSON format.

    Return Value Description
    result success/failure
    If API call is success, then success value is present in the result attribute; else failure value.
    zuid ID generated by the Zoho system. Unique per user email address.
    This needs to be stored against the user for whom sign up API is called.
    This will be useful for any communication / trouble shooting at a later stage.
    ticket This is used by the user to access the reports present in the Zoho Analytics. This needs to be passed to Zoho as part of the URL.
    cause This attribute is present in the response, only in case of failure.


    Sign In API

    Sample Request:

    curl -d "apikey=apikey&operation=signin&email=[email id of the user to signin]"
             https://[your domain]/sso
    
    

    Sample Success Response

    
    {
        "ticket":"666b88566441b69d1a137db824314b6a9be8959a75b1a1be8b951c6e18f352bb
                 2e068f7f697fa4879e365e19967a5b537a08c8e85058625130e54e8467d85259",
        "result":"success",
        "redirect_url":"https://analytics.finepick.com/oauthorize?state=https%3A%2F%2Fanalytics.finepick.com%2FZDBHome.cc&zacode=1001872501-19e446dc-2398a43e6108e59a0458d550f0714628&portal=1000756871",
        "zuid":5471
    }
    
    

    Sample Failure Response

    {
        "result":"failure",
        "cause":"Invalid APIKey"
    }
    

    Assuming your domain URL is analytics.finepick.com.

    URL Format

    form method="POST" action="https://analytics.finepick.com/sso" target="_self"
    input type= "hidden" name ="apikey" value="[your apikey]"
    input type ="hidden" name ="operation" value ="signin"
    input type ="hidden" name ="email" value ="[email id of the user to signin]"
    input type ="submit" name ="Sign In" value ="submit"
    /form

    Important: You need to send an HTTPS POST to Zoho Analytics for user Sign In API.

    Input Parameter for Sign In API

    Parameter Name Description
    operation Value is “signin”
    apikey Your API key
    email Email address of the user to sign in
    STATE (optional) Landing URL of specific workspace/view for redirection once the sign-in process is completed.
    Default value: https://[your domain]/ZDBHome.cc

    Response for Sign in API:

    Both success & failure responses are present in JSON format.

    Return Value Description
    result success/failure
    If the API call is successful, then success value is present in the result attribute; else failure value.
    zuid ID generated by the Zoho system.
    Unique per user email address.
    This needs to be stored against the user for whom sign in API is being called.
    This will be useful for any communication / trouble shooting at a later stage.
    ticket This is used by the user to access the reports present in the Zoho Analytics.
    This needs to be passed to Zoho as part of the URL.
    redirect_url This is used by the user to complete the signin process.
    cause This attribute present in the response, only in case of failure


    Sign Out API

    Sample Request:

    curl https://[your domain]/ZDBCustomDomainLogin.ma?ZDBACTION=signout
    
    

    URL Format:

    https://analytics.finepick.com/ZDBCustomDomainLogin.ma?ZDBACTION=signout

    Important: You need to do a HTTP 301 redirection to the above URL once the sign out process(clearing your application credential) is completed in your server/application. Once you do that, you will be redirected to the login page immediately after you sign out from Zoho Analytics.


    Workflow Test Scenarios

    This section outlines steps that are to be tried after the unit tests have been successfully completed.

    Pre-Requisites:

    Test Login Flow

    Test Logout Flow

    Test Login as Another user functionality

    This step requires that you register 2 different email addressed using the Sign up API.


    Integration Test Scenarios

    Website driven Login flow

    White label driven Login flow

    Website Logout Flow:

    White -label Logout Flow:


    Other Terms & Conditions:

    Common error codes in API

    This section lists the common error codes that could be sent from the Zoho Analytics server on failure of Zoho Analytics API. You can use this for appropriate error handling.

    Error codes and reason

    Error_code Reason Solution
    7003 Required parameters are missing in the request. Send all the required parameters related to that particular action.
    7103 The workspace id mentioned in the API does not exist. Provide the valid workspace id.
    7104 The view id specified in the API does not exist. Provide the valid view id.
    7138 The view id mentioned in the API URL does not exist. Check the view id in the request URL and provide a valid view id.
    7301 You (your full name) do not have the permission to do this operation. Access as administrator or permitted user to perform the operation.
    7387 Workspaces does not belongs to current organization. Provide a valid organization and workspace id.
    7395 Column not present in the workspace. Provide a valid column.
    7925 You are not part of the analytics organization. Create your analytics organization.
    8002 Specified criteria is invalid. Provide valid criteria.
    8004 The column mentioned in the criteria is not present in the table. Check the column name and provide the valid name.
    8023 You do not have required permission to perform this operation. Kindly contact our support team.
    8025 Invalid custom domain. Provide a valid domain name.
    8060 Domain does not exist. Provide a valid domain name that you have purchased from Zoho Analytics.
    8078 The mentioned attribute has an empty value. Provide a valid JSON data.
    8079 The mentioned attribute is not present in the JSON configuration. Provide a valid JSON data.
    8083 Organization id is not present in the request header. Provide a valid organization id in the request header.
    8504 The required parameter is not proper or has not been sent. Send the parameter with valid data.
    8506 The mentioned parameter has been sent more than the required count. Check and remove that extra parameter mentioned in the response.
    8516 Invalid value passed in the mentioned parameter. Provide the valid data to the mentioned parameter.
    8518 Invalid authentication. Provide a valid OAuth token for API authentication.
    8534 Invalid JSON Format. Provide a valid JSON data.
    8535 Invalid oauthtoken. Provide a valid OAuth token.

    In case of any error other than the above said, mail the API request URL parameters and error response details to support@zohoanalytics.com. Zoho Analytics Team will get back to you with the best possible solution.

    Client Libraries

    Client libraries are programming language wrappers over the raw HTTP APIs. This enables developers to easily use Zoho Analytics API in the corresponding programming language. Currently we support the following programming language libraries:


    Java Library

    The Java client libraries wraps the raw HTTP based API of Zoho Analytics with easy to use methods for Java language. This enables Java developers to easily use Zoho Analytics API.

    Environment Required:  Java 1.8

    Javadocs

    Click here for javadocs.

    Download Java Client Library

    Download the java client library based on your Data Centre.

    Release Notes


    C# Library

    The C# client libraries wraps the raw HTTP based API of Zoho Analytics with easy to use methods for the C# .Net platform. This enables C# .Net developers to easily use Zoho Analytics API.

    Environment Required:  .NET Framework 4.5

    csharpdocs

    Click here for csharpdocs.

    Download C# Client Library:

    Download the C# client library (dll) based on ZohoAnalytics Server URI.

    For 32 bit

    For 64 bit



    Add reference to your C# Projects using these .dll files. With this you will be able to perform Zoho Analytics API operations using the available functions.

    Release Notes


    Python Library

    The Python client libraries wraps the raw HTTP based API of Zoho Analytics with easy to use methods for Python language. This enables Python developers to easily use Zoho Analytics API.

    Environment Required:  Python 3.x

    Pythondocs

    Click here for pythondocs.

    Download Python Client Library

    Download the python client library based on your Data Centre.

    Release Notes


    PHP Library

    The PHP client libraries wraps the raw HTTP based API of Zoho Analytics with easy to use methods for PHP language. This enables PHP developers to easily use Zoho Analytics API.

    Environment Required:  PHP 7.x

    phpdocs

    Click here for phpdocs.

    Download php Client Library

    Download the php client library based on your Data Centre.

    Release Notes


    GO Library

    The GO client libraries wraps the raw HTTP based API of Zoho Analytics with easy to use methods for GO language. This enables GO developers to easily use Zoho Analytics API.

    Environment Required:  Go 1.12.x

    godocs

    Click here for godocs.

    Download go Client Library

    Download the go client library based on your Data Centre.

    Steps to use go client

    The below instructions helps to use Zoho Analytics Go Client Library in your Go application.

    Release Notes


    NodeJS Library

    The NodeJS client libraries wraps the raw HTTP based API of Zoho Analytics with easy to use methods for NodeJS language. This enables developers to easily use Zoho Analytics API.

    Environment Required:  Node v12.x

    nodejs docs

    Click here for nodejs docs.

    Download Nodejs Client Library

    Download the nodejs client library based on your Data Centre.

    Release Notes

    Zoho CloudSQL

    Zoho CloudSQL is a middleware technology that allows customers to interact with their business data stored in Zoho Analytics through familiar SQL language. Users can access the data in Zoho Analytics using SQL SELECT queries.

    What is Zoho CloudSQL?

    Zoho with its wide range of hosted productivity and business applications collects, mines and exposes a lot of structured and unstructured data to users. For developers working over the Zoho Platform, to extend and customize the various web services, it offers a comprehensive Web API over HTTPS for most of the Zoho Services. Currently Zoho Web API is the means to access and manipulate the data collected by the various Zoho services. But one drawback with the current Web API over HTTPS is the non-standard interface for querying and data manipulation, which could add up to the learning curve, adoption and maintenance.

    Zoho CloudSQL is a platform API service that enables developers to use Standard SQL (Structured Query Language) querying over the Web, to access and manipulate data that is available in various Zoho Services in the Cloud (hence the name CloudSQL). SQL being a standard query language of Workspaces and data marts, it provides a much familiar and expressive development model for developers, thus making it easy to adopt and develop upon. With CloudSQL, Zoho Platform becomes first of its kind to offer full fledged standard SQL Querying over the Web.

    Developers could execute SELECT, INSERT, UPDATE and DELETE SQL statements over the Web to handle the data in Zoho Services with CloudSQL. Another powerful facet of CloudSQL is the support for multiple SQL dialects which could be used by developers to construct their SQL queries. CloudSQL supports SQL queries written in any of ANSI, Oracle, Microsoft SQL Server, IBM DB2, MySQL, PostgreSQL and Informix dialects. This enables developers to easily adopt CloudSQL, if they are familiar in any one of the Workspace dialects mentioned.

    Zoho Analytics and Zoho CloudSQL

    Zoho Analytics, the online reporting and business intelligence service, is the first Zoho service to adopt Zoho CloudSQL. Developers could execute SQL SELECT statements over the web to handle the data in Zoho Analytics.

    Key Highlights of Zoho Analytics CloudSQL Implementation

    The key highlights of Zoho Analytics CloudSQL implementation are:


    SQL Query Entity Mapping

    To construct and execute an SQL Query you need to first identify the entities on which the SQL Query will operate upon. The basic entities that are essential for constructing an SQL query includes Workspace, Tables and Columns.

    The following section describes the mapping in Zoho Analytics that maps to these basic entities required for SQL querying. You need to use this mapping to construct your SQL queries for execution.

    In Zoho Analytics the mapping of the entities would be the following:

    SQL Query Entity Zoho Analytics mapping
    Workspace Mapped to each Reporting Workspace in Zoho Analytics
    Table Mapped to Tables and Query Tables in a Reporting Workspace in Zoho Analytics
    Column Mapped to Columns of a Table or Query Table in a Reporting Workspace in Zoho Analytics

    Sample:

    Following is an example of a CloudSQL query executed on Zoho Analytics:

    Entities involved in Zoho Analytics:

    Workspace Name in Zoho Analytics : “Super Store Sales
    Table Name : Sales
    Columns Involved : Customer Name, Sales, Cost and Region

    SQL SELECT Query:

    select “Customer Name”,Sales,Cost,“Profit (Sales)” from Sales where Region = 'East’

    The above query will fetch the records from the Sales table in Super Store Sales Workspace in Zoho Analytics, which are from the Region 'East’.


    Zoho Analytics CloudSQL - API Specification

    SQL Querying over HTTP using Zoho Analytics API

    Zoho Analytics has implemented the Zoho CloudSQL technology as an extension to its HTTP Web API. Using the HTTP API, users can query Zoho Analytics Workspace by providing the SQL queries.

    Currently Zoho Analytics supports only SQL SELECT Queries. Other SQL statements like INSERT, UPDATE and DELETE will be supported very soon.

    Using SQL Select statements developers can fetch data from a single Table/Query Table or joining one or more tables in Zoho Analytics. The data can be fetched in different response formats, which includes CSV, PDF, HTML, JSON and XML

    SQL SELECT Query Request Format:

    Zoho Analytics uses the Export Using Query action request to execute any SQL SELECT query given.

    SQL Query:

    The query should be passed as a value to the JSON attribue sqlQuery. The exact SQL Select query string should be URL encoded.

    Sample Query:

    The sample Select Query will fetch all the employees in the 'finance’ department along with their details in CSV Format.

    Entities Involved:

    Workspace Name: EmployeeDB Tables Involved: Employee, EmpDetails

    Select Query: (Note the query should be URL Encoded)

    {"sqlQuery":"select empdet.Name Name,empdet.DOB Date_Of_Birth,empdet.Address Address,emp.BasicSal BasicPay,round(emp.BasicSal + emp.Allowance,2) Salary from Employee emp inner join EmpDetails empdet on emp.ID = empdet.ID where emp.Dept = 'Finance'"}

    URL Encoded Select Query:

    {"sqlQuery":"select%20empdet.Name%20Name%2Cempdet.DOB%20Date_Of_Birth%2Cempdet.Address%20Address%2Cemp.BasicSal%20BasicPay%2Cround%28emp.BasicSal%20%2B%20emp.Allowance%2C2%29%20Salary%20from%20Employee%20emp%20inner%20join%20EmpDetails%20empdet%20on%20emp.ID%20%3D%20empdet.ID%20where%20emp.Dept%20%3D%20%27Finance%27"}

    Sample Success Response:

    The sample response for the above query in CSV format is given below. The first row of the CSV response will contain the column names:

    Name,Date_Of_Birth,Address,BasicPay,Salary
    Akram,"10 Dec, 1979 00:00:00",california, $10,000 , $10,500
    ....


    JDBC Driver for Zoho Analytics CloudSQL

    Sample

    The example Java code snippet shows how you can register Zoho Analytics CloudSQL JDBC driver, obtain a Connection, create a Statement and execute the query.

    import java.sql.DriverManager;
    import java.sql.Connection;
    import java.sql.Statement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.Properties;
    
    public class ZohoReportsCloudSQL
    {
        public static void main(String args[])
        {
            Connection con = null;
            Statement stmt = null;
            ResultSet rs = null;
            try
            {
                Class.forName("com.zoho.cloudsql.jdbc.ZohoReportsDriver");
                Properties conProps = new Properties();
                
                // ZohoAnalytics admin emailaddress
                conProps.put("user","david.s@zoho.com");
    
                // ZohoAnalytics OAuth authentication parameters
                conProps.put("CLIENT_ID","");
                conProps.put("CLIENT_SECRET","");
                conProps.put("REFRESH_TOKEN","");
                
                // Uncomment this incase you need proxy settings
                /*
                // Proxy host name to connect the internet
                conProps.put("PROXYSERVER","proxy_hostname");
                // Proxy port to connect the internet
                conProps.put("PROXYPORT","proxy_port");
                // Proxy user name to connect the internet
                conProps.put("PROXYUSERNAME","proxy_username");
                // Proxy password to connect the internet
                conProps.put("PROXYPASSWORD","proxy_password");
                */
                /* Important Note: Connection is single threaded in Zoho Analytics */
                // david.s@zoho.com is the admin of the Workspace 'Sales'
                con = DriverManager.getConnection("https://analyticsapi.zoho.com/api/david.s@zoho.com/Sales",conProps);
                stmt = con.createStatement();
                String sql ="select * from <tablename>";
                rs = stmt.executeQuery(sql);
            }
            catch(SQLException se)
            {
                // handle any errors
                System.out.println("SQLException: " + se.getMessage());
                System.out.println("Zoho Analytics Error code: " + se.getErrorCode());
            }
            catch(Exception e)
            {
                // handle the exception
            }
            finally
            {
                if(rs != null)
                {
                    try
                    {
                        rs.close();
                    }
                    catch(SQLException sqlEx) { } // ignore
                }
                if(stmt != null)
                {
                    try
                    {
                        stmt.close();
                    }
                    catch (SQLException sqlEx) { } // ignore
                }
                if(con != null)
                {
                    try
                    {
                        con.close();
                    }
                    catch (SQLException sqlEx) { } // ignore
                }
            }
        }
    }
    

    CloudSQL enables users to execute SQL queries on structured data stored in Zoho Analytics, it also lends itself naturally to support Database Connectivity Standard like JDBC (Java Database Connectivity). Developers who are familiar using JDBC driver for connectivity to databases, can now use Zoho Analytics CloudSQL JDBC driver to connect and execute the necessary SQL queries.

    With the availablity of this JDBC driver, developers need not learn the Zoho Analytics CloudSQL HTTP Web API to execute the SQL query. They just have know how to use the Zoho Analytics JDBC driver and start interacting with the service, the same way as they would interact with a Workspace using a JDBC standard driver.

    Zoho Analytics JDBC Driver Download

    Download the Zoho Analytics JDBC Driver from the below link.

    https://css.zohostatic.com/analytics/jdbc/ZohoCloudSQLJDBC_1_0.zip

    Javadocs

    Zoho Analytics JDBC Driver

    To use the JDBC Driver you need to have a zoho login email address and password. Currently you could only execute Select queries using the JDBC driver. Other SQL statements will be supported soon.

    In JDBC, the DriverManager class manages the establishment of connections. DriverManager needs to be told which JDBC driver it should try to make connections with. The way to do this is to use Class.forName( ) on the class that implements java.sql.Driver interface.

    Refer to the Zoho Analytics JDBC Driver javadocs to know more about the same. Click to download Zoho Analytics JDBC Driver.

    JDBC Connection URL for Zoho Analytics

    https://analyticsapi.zoho.com/api/<zoho_username_dbowner>/<Workspacename>

    Sample

    The sample code is shown in the code block.

    Jars to be kept in CLASSPATH for JDBC Driver

    All the jars from 'ZohoCloudSQLJDBC_1_0/Zoho/CloudSQLJDBCDriver/lib’ directory within the JDBC Driver Zip need to be kept in CLASSPATH for JDBC driver.

    JDBC Type Mapping with Zoho Analytics Data types

    The following table provides the mapping between the Zoho Analytics data types and the JDBC SQL types. Use this mapping to process the data fetched from Zoho Analytics in your Java code.

    Zoho Analytics Data type JDBC SQL Type
    Plain Text VARCHAR
    Multi Line Text LONGVARCHAR
    Email VARCHAR
    Auto Number BIGINT
    Number BIGINT
    Positive Number BIGINT
    Decimal Number DOUBLE
    Currency DOUBLE
    Percent DOUBLE
    Date TIMESTAMP
    Decision Box BIT

    Connecting Zoho Analytics from Workspace Visualization Tools

    Zoho Analytics JDBC Driver supports connecting Zoho Analytics from the following Workspace Visualizations tools.


    DbVisualizer tool

    You can connect to Zoho Analytics from the DbVisualizer tool by following the steps below.

    Step 1: Create a New Driver Name

    Error while loading image

    Step 2: Creating New Workspace Connection

    Error while loading image

    Error while loading image

    Connections Overview

    The Connection Overview will list all the Workspace connections configured in the tool, on selecting the connections object in the Workspaces Objects Tree. To connect to your Zoho Analytics account, double click Zoho Analytics connection. All the Workspaces in your account along with the table will be listed.

    Executing a SQL SELECT Query

    Follow the below steps to execute a SQL SELECT query in your Zoho Analytics Workspace.


    Squirrel SQL Client

    You can also connect to Zoho Analytics from the Squirrel SQL client. To connect to a Zoho Analytics Workspace from Squirrel SQL client, you need to provide two sets of information i.e., the driver definition and the alias. The driver definition specifies the JDBC driver to use and the alias specifies the connection parameters.

    Steps for Creating New Driver Definition

    Create a new driver definition to specify the JDBC driver by following the steps below.

    Steps for Adding Alias

    Alias holds all configurations to connect to a Workspace. Create new alias for Zoho Analytics to specify the connection parameters by following the steps below.

    Connecting to Zoho Analytics Workspace

    Follow the steps below to connect to a Workspace in Zoho Analytics

    Executing a SQL SELECT Query

    SQL SELECT Query can be executed from the SQL tab as said below.


    CloudSQL Client Libraries

    To enable developers to easily use the Zoho Analytics CloudSQL HTTP API, we have provided Client libraries in the below given programming languages.

    C# Client Library

    C# client library wraps the HTTP API of Zoho Analytics with the easy to use methods in C# .Net programming language.

    Sample code snippet for using CloudSQL with C# client API:

    IAnalyticsClient ac = new AnalyticsClient(clientId, clientSecret, refreshToken);
    string responseFormat = "csv";
    String sqlQuery = "select * from Sales";
    IBulkAPI data = ac.GetBulkInstance(orgId, workspaceId);
    long jobId = data.InitiateBulkExportUsingSQL(sqlQuery, responseFormat, null);
    Console.WriteLine(jobId);

    For more details on C# client libraries, kindly view this link.

    Go Client Library

    Go client library wraps the HTTP API of Zoho Analytics with the easy to use methods in Go language.

    Sample code snippet for using CloudSQL with Go client API:

    ac := ZAnalytics.GetAnalyticsClient(clientId, clientSecret, refreshToken)
    config := map[string]interface{}{}
    sqlquery := "select * from Sales"
    responseformat := "csv"
    bulk := ZAnalytics.GetBulkInstance(&ac, orgId, workspaceId)
    result, err := bulk.InitiateBulkExportUsingSQL(sqlquery, responseformat, config)
    fmt.Println(result)

    For more details on Go client libraries, view this link

    Java Client Library

    Java client library wraps the HTTP API of Zoho Analytics with the easy to use methods in Java language.

    Sample code snippet for using CloudSQL with Java client API:

    AnalyticsClient ac = new AnalyticsClient(clientId, clientSecret, refreshToken);
    String sqlQuery = "select * from Sales";
    String responseFormat = "csv";
    BulkAPI bulk = ac.getBulkInstance(orgId, workspaceId);
    long jobId = bulk.initiateBulkExportUsingSQL(sqlQuery, responseFormat, null);
    System.out.println(jobId);

    For more details on Java client libraries, view this link

    PHP Client Library

    PHP client library wraps the HTTP API of Zoho Analytics with the easy to use methods in PHP language.

    Sample code snippet for using CloudSQL with PHP client API:

    $this->ac = new AnalyticsClient($this->client_id, $this->client_secret, $this->refresh_token);
    $sql_query = "select * from Sales";
    $response_format = "csv";
    $bulk = $this->ac->getBulkInstance($this->org_id, $this->workspace_id);
    $response = $bulk->initiateBulkExportUsingSQL($sql_query, $response_format);
    print_r($response);

    For more details on PHP client libraries, view this link

    Python Client Library

    Python Client Library wraps the HTTP API of Zoho Analytics with the easy to use methods in Python language.

    Sample code snippet for using CloudSQL with Python client API:

    ac = AnalyticsClient(Config.CLIENTID, Config.CLIENTSECRET, Config.REFRESHTOKEN)
    response_format = "CSV"
    sql_query = "select * from Sales where Region='East'"
    bulk = ac.get_bulk_instance(Config.ORGID, Config.WORKSPACEID)
    result = bulk.initiate_bulk_export_using_sql(sql_query, response_format) print(result)

    For more details on Python client libraries, kindly view this link

    NodeJS Client Library

    NodeJS Client Library wraps the HTTP API of Zoho Analytics with the easy to use methods in NodeJS language.

    Sample code snippet for using CloudSQL with NodeJS client API:

    var ac = new analyticsClient(clientId, clientSecret, refreshtoken);
    var config = {};
    var responseFormat = 'csv';
    var sqlQuery = 'select * from Sales';
    var bulk = ac.getBulkInstance(orgId, workspaceId);
    bulk.initiateBulkExportUsingSQL(sqlQuery, responseFormat).then((response) => {
    console.log(response);
    });

    For more details on NodeJS client libraries, kindly view this link


    Supported SQL

    User can provide SQL SELECT queries in any of the below given Workspace SQL dialects. Follow the links to know more about the SQL statements and functions, in each given Workspace dialect, supported by Zoho Analytics CloudSQL implementation.

    Zoho Analytics supports following SELECT query syntax and in-built functions in CloudSQL.

    Supported SELECT Query Syntax:

    Following are the conventions used in the SELECT syntax definition:

    CONVENTIONS MEANING EXAMPLE
    Square Brackets [ ] Indicates that the enclosed arguments are optional in the syntax DIGITS [. PRECISION ]
    Braces followed by plus sign ( )+ Indicates that the enclosed arguments can occur more than once ( DIGIT )+
    Braces followed by star sign ( )* Indicates that the enclosed arguments can occur zero or more times SELECT column_name ( , column_name)* FROM table_name
    Question Mark ? Indicates that the Question mark “?” preceded by an argument is optional. Equivalent to Square Brackets[ ] <INTEGER> ( "." <INTEGER> )?
    Vectical Line Vertical Line indicates choices (DISTINCT
    UPPER CASE Uppercase text indicates case-insensitive filenames or directory names, commands, command keywords, initializing parameters, data types. SELECT column_name FROM table_name
    lower case Lowercase text indicates Workspace objects like table name, column names etc. DELETE FROM table_name WHERE condition

    SELECT Syntax:

    SELECT [ DISTINCT | ALL ] ( ( column_clause ( "," column_clause )* ) | "*" ) [ FROM table_expression_clause ] [ where_clause ] [ group_by_clause ] [ having_clause ] [ order_by_clause ] [ limit_clause ]

    column_clause :
    ( expression | table_name.* | table_name.columnname | table_name.column_name | column_name ) [ [ AS ] alias_name ]
    table_expression_clause :
    ( table_name ) [ AS alias_name ] ( "," ( table_name ) [ AS alias_name ])*
    where_clause :
    WHERE (<Left Where Expression>(= | < | > | <= | >= | != | LIKE | NOT LIKE | BETWEEN) <Right Where Expression>) ( (OPERATOR ) (<Left Where Expression> (= | < | > | <= | >= | != | LIKE | NOT LIKE | BETWEEN) <Right Where Expression>)*
    OPERATOR includes AND/OR
    group_by_clause :
    GROUP BY expression ( "," expression )*
    having_clause :
    HAVING condition
    order_by_clause :
    ORDER BY (order_item_clause) ( "," order_item_clause )*
    limit_clause :
    LIMIT (value | ALL) [ "," value ]
    join_clause :
    table_name INNER JOIN table_name ON join_condition | <br> table_name {LEFT | RIGHT} [OUTER] JOIN table_name ON join_condition
    order_item_clause :
    (expression | column name) [ ASC | DESC ]

    UNION Syntax:

    <SELECT Query Statement> (UNION [ALL | DISTINCT] <SELECT Query Statement>)+

    Reference: MySQL SELECT Query syntax documentation

    MySQL STRING FUNCTIONS

    The MySQL in-built String functions supported by Zoho Analytics.

    ASCII(string_arg):

    Purpose:
    The ASCII value of the first character of the given argument is returned.
    Example:
    Select ascii('ant’) returns '97’
    Note:

    BIN(numeric_arg):

    Purpose:
    Returns the binary value of the given argument.
    Example:
    Select BIN('40’) returns '101000’
    Note:

    BIT_LENGTH(string_arg):

    Purpose:
    Returns the value of the length of the string argument in bits.
    Example:
    Select BIT_LENGTH('AA’) returns '16’
    Note:

    CHAR(numeric_arg1, numeric_arg2, numeric_arg3,….):

    Purpose:
    Returns a String of characters formed from the code values of the ASCII code given in the arguments.
    Example:
    Select CHAR (97.4,97.5) returns 'ab’
    Select CHAR ('97’,'X’,'98’) returns 'a b’ // Returns space for each non-numeric character in the argument.
    Note:

    CHAR_LENGTH(string_arg):

    Purpose:
    Returns the number of characters present in the argument.
    Example:
    Select CHAR_LENGTH('aa1’) returns '3’
    Note:

    CHARACTER_LENGTH(string_arg):

    Purpose:
    Returns the number of characters present in the argument.
    Example:
    Select CHARACTER_LENGTH('aa1’) returns '3’
    Note:

    CONCAT(string_arg1, string_arg2, string_arg3,…):

    Purpose:
    Returns the concatenated string of the arguments.
    Example:
    Select CONCAT('red’,'rose’) returns ’ redrose’
    Note:

    CONCAT_WS(char_arg, string_arg1, string_arg2,…):

    Purpose:
    Returns the concatenated string of the arguments with the first argument acting as the separator between the concatenated strings.
    Example:
    Select CONCAT_WS (’,’,'red’,'rose’,'is’,'beautiful’) returns 'red,rose,is,beautiful’
    Note:

    ELT(numeric_arg, string_arg1, string_arg2,…):

    Purpose:
    The value of the first argument gives the count of the argument to be returned from the rest of the arguments.
    Example:
    Select ELT ('2’,'red’,'rose’,'is’,'beautiful’) returns 'rose’
    Note:

    FIELD(string_arg, string_arg1, string_arg2,…):

    Purpose:
    The first argument string is checked with all the other arguments and the position of the argument where the first match is found is returned.
    Example:
    Select FIELD ('as’,'has’,'as’,'have’) returns '2’
    Note:

    FIND_IN_SET(string_arg1, string(element1,element2,…)):

    Purpose:
    The first argument string is checked with the second argument, which is a set of strings separated by commas, and the position of the first match in the set is returned.
    Example:
    Select FIND_IN_SET ('10’,'2,5,8,10’) returns '4’
    Note:

    FORMAT(numeric_arg,numeric_arg):

    Purpose:
    Rounds off the number given in the first argument to the number of decimals given in the second argument.
    Example:
    SELECT FORMAT (1.0001111,5) returns '1.00011’
    Note:

    HEX(string_arg):

    Purpose:
    Returns the corresponding hexadecimal number for each character of the given string.
    Example:
    Select HEX('255’) returns '323535’
    Note:

    INSTR(string_arg, string_arg):

    Purpose:
    Returns the position of the first match of second string argument in the first argument.
    Example:
    Select INSTR ('impossible’,'possible’) returns '3’
    Note:

    LEFT(string_arg, numeric_arg):

    Purpose:
    From the first argument string the number of characters as that passed in the second argument is returned.
    Example:
    Select LEFT ('select’,'3’) returns 'sel’
    Note:

    LENGTH(string_arg):

    Purpose:
    Returns the total number of bytes present in the string. The multibyte characters are counted as multiple bytes.
    Example:
    Select LENGTH ('advent123!$’) returns '11’
    Note:

    LOCATE(string_arg):

    Purpose:
    Returns the position of the first string argument in the second string argument.
    Example:
    Select LOCATE ('net’,'adventnet’) returns '7’
    Note:

    LPAD(string_arg, numeric_arg, string_arg):

    Purpose:
    The third argument is prepended to the left of the first argument until the length given in the second argument is attained.
    Example:
    Select LPAD ('brother’,'9’,'hello’) returns 'hebrother’
    Note:

    LTRIM(string_arg):

    Purpose:
    Returns the argument with the blank spaces at the prefix of the string removed.
    Example:
    Select LTRIM (’ ab cd’) returns 'ab cd’
    Note:

    MAKE_SET(numeric_arg, string_arg1, string_arg2,…):

    Purpose:
    For the given bit in the first argument, the corresponding 'set’ of arguments from the remaining arguments is returned.
    Example:
    Select MAKE_SET (3,'ab’,'cd’,'ef’) returns 'ab,cd’
    Note:

    ORD(string_arg):

    Purpose:
    If the first character of the string argument is a multi-byte character, then the code calculated from the below formula is returned.
    1st byte code + (2nd byte code * 256) + (3rd byte code * 256 * 256) + …

    REPEAT(string_arg, numeric_arg):

    Purpose:
    The first string argument is returned repeatedly the number of times as that given in the second argument.
    Example:
    Select Repeat ('AA’,5) returns 'AAAAAAAAAA’
    Note:

    REPLACE(string_arg, string_arg, string_arg):

    Purpose:
    Replaces the string given in the second argument with the string given in the third argument from the first argument string.
    Example:
    select replace('tention’,'ten’,'celebra’) returns 'celebration’
    Note:

    REVERSE(string_arg):

    Purpose:
    Returns the string argument in the reversed order of characters.
    Example:
    select reverse ('main’) returns 'niam’
    Note:

    RIGHT(string_arg, numeric arg):

    Purpose:
    For the count passed in the second argument the first argument’s characters from the right end is returned.
    Example:
    select RIGHT ('adventnet’,3) returns 'net’
    Note:

    RPAD(string_arg, numeric arg, string_arg):

    Purpose:
    The third argument is appended to the right of the first argument until the length of the second argument is acheived.
    Example:
    select RPAD ('abcdef’,10,'ghijkl’) returns 'abcdefghij’
    Note:

    RTRIM(string_args):

    Purpose:
    Returns the argument with the blank spaces at the suffix of the string removed.
    Example:
    Select rtrim ('abcd ’) returns 'abcd’
    Note:

    SOUNDEX(string_arg):

    Purpose:
    Returns the soundex string of the given argument. The soundex string is similar for same sounding strings.
    Example:
    Both Select soundex ('bye’) and Select soundex ('boy’) return 'b000’

    SPACE(numeric_arg):

    Purpose:
    The argument value is returned as the number of space characters.
    Example:
    Select space(6) returns ’ ’
    Note:

    SUBSTRING(string_arg, numeric_arg):

    Purpose:
    Returns the substring formed by cutting off the string argument passed according to the needs.
    Example:
    Select substring ('adventnet’,7) returns 'net’
    Select substring ('adventnet’ From 3) returns 'ventnet’
    Select substring ('adventnet’, 3,4 ) returns 'vent’
    Select substring ('adventnet’, -3) returns 'net’
    <> Select substring ('adventnet’, -7,4) returns 'vent’
    Note:

    SUBSTRING_INDEX(string_arg, string_arg, numeric_arg):

    Purpose:
    The second argument acts as the delimiter and the third argument is the count number. As soon as the match of the delimiter is found for the correct count in the first argument string, the rest of the string is cut off.
    Example:
    select substring_index ('how.are.you’, ’.’, 2) returns 'how.are’ // for positive count, limitation is done to the right of the delimiter.
    select substring_index ('how.are.you’, ’.’, -2) returns 'are.you’ // for negative count, limitation is done to the left of the delimiter
    Note:

    TRIM(string_arg):

    Purpose:
    For the given specifiers the string argument is trimmed accordingly.
    Example:
    Select TRIM (’ zoho ’) returns 'zoho’ // if no specifier is given, spaces before and after the string are trimmed
    Select TRIM (leading ’!’ from ’!!!!zoho!!!!’) returns 'zoho!!!!’ // if leading specifier is given then the prefix part is trimmed
    Select TRIM (trailing ’!’ from ’!!!!zoho!!!!’) returns ’!!!!zoho’ // if trailing specifier is given then the suffix part is trimmed.

    UNHEX(string_arg):

    Purpose:
    Returns the corresponding character for each pair of hexadecimal digits.
    Example:
    Select unhex('21’) returns ’!’
    Note:

    UPPER(string_arg):

    Purpose:
    Returns the argument string with all its alphabetic characters in Upper Case.
    Example:
    select upper ('AdVeNt’) returns 'ADVENT’
    Note:

    MySQL MATHEMATICAL FUNCTIONS

    The MySQL in-built Math functions supported by Zoho Analytics

    ABS(numeric_arg):

    Purpose:
    Returns the numerical value of a number given in the argument without regard of its sign.
    Example:
    Select ABS (-23) returns '23’
    Select ABS (’-23’) returns '23.0’ // If a number is passed as a string then the number is returned in decimal form.
    Select ABS (’-23B0011’) returns '23.0’ // As soon as a non numeric character is found in the number string the number is returned in decimal form.
    Note:

    ACOS(numeric_arg):

    Purpose:
    Returns the Inverse Cosine value of the argument passed. The argument’s value should be between -1 to 1.
    Example:
    Select ACOS (0.5) returns '1.0471975511966’
    Select ACOS ('0.5A@5’) returns '1.0471975511966’ // As soon as a non numeric character is found in the number string the number value is returned.
    Note:

    ASIN(numeric_arg):

    Purpose:
    Returns the Inverse Sine value of the argument passed. The argument’s value shuld be between -1 to 1.
    Example:
    Select ASIN (0.5) returns '0.5235987755983’
    Select ASIN ('0.5A@5’) returns '0.5235987755983’ // As soon as a non numeric character is found in the number string the number’s value is returned.
    Note:

    ATAN(numeric_arg):

    Purpose:
    Returns the Inverse Tangent value of the argument passed.
    Example:
    Select ATAN (0.5) returns '0.46364760900081’
    Select ATAN ('0.5A@5’) returns '0.46364760900081’ // As soon as a non numeric character is found in the number string the number’s value is returned.
    Note:

    ATAN2(numeric_arg):

    Purpose:
    Returns the number of characters present in the argument.
    Example:
    Select ATAN2 (2,4) returns '0.46364760900081’
    Select ATAN2 ('0.5A’) returns '0.46364760900081’ // As soon as a non numeric character is found in the number string the number’s value is returned.
    Note:

    CEIL(numeric_arg):

    Purpose:
    The smallest integer that is greater than or equal to the value of the argument is returned.
    Example:
    Select CEIL (1.5) returns '2’
    Note:

    CEILING(numeric_arg):

    Purpose:
    The smallest integer that is greater than or equal to the value of the argument is returned.
    Example:
    Select CEILING (1.5) returns '2’
    Note:

    CONV(string_arg, numeric_arg1, numeric_arg2):

    Purpose:
    Changes the argument number string from the given base to the required base. The first argument is the given number string, the second argument is the original base of the number and the third argument is the base to which the number string is to be converted.
    Example:
    Select CONV ('F’,16,10) returns '15’
    Note:

    COS(numeric_arg):

    Purpose:
    Returns the COSINE value of the argument passed. The value of the arguments should be in radians.
    Example:
    Select COS (45) returns '0.52532198881773’
    Note:

    COT(numeric_arg):

    Purpose:
    Returns the COTANGENT value of the argument passed.
    Example:
    Select COT() returns “
    Note:

    CRC32(numeric_arg):

    Purpose:
    Returns a 32 bit unsigned output after calculating the cyclic redundancy check.
    Example:
    Select CRC32 ('111’) returns '1298878781’
    Note:

    DEGREES(numeric_arg):

    Purpose:
    The argument’s value is converted from radians to degrees.
    Example:
    Select DEGREES (3.141593) returns '180’
    Note:

    EXP(numeric_arg):

    Purpose:
    The value of 'e’ raised to the power of the given number argument is returned.
    Example:
    Select EXP (6) returns '403.42879349274’
    Note:

    FLOOR(numeric_arg):

    Purpose:
    The largest integer that is smaller than or equal to the value of the argument is returned.
    Example:
    Select FLOOR (1.5) returns '1’
    Note:

    FORMAT(numeric_arg, numeric_arg):

    Purpose:
    Rounds off the number given in the first argument to the number of decimals given in the second argument.
    Example:
    SELECT FORMAT (1.0001111,5) returns '1.00011’
    Note:

    LN(numeric_arg):

    Purpose:
    Returns the natural logarithmic value of the given argument.
    Example:
    Select LN('123’) returns '4.8121843553724’
    Note:

    LOG(number1, number2):

    Purpose:
    Performs the same function as LN for single parameter. For 2 parameters, the first argument is the base and the second argument is the number. The logarithm of the number to the base is returned.
    Example:
    Select LOG(10,100) returns 2.0
    Note:

    LOG2(numeric_arg):

    Purpose:
    The logarithm of the number to the base 2 is returned.
    Example:
    Select LOG2 (100) returns '6.6438561897747’
    Note:

    LOG10(numeric_arg):

    Purpose:
    The logarithm of the number to the base 10 is returned.
    Example:
    Select LOG10 (100) returns '2.0’
    Note:

    MOD(numeric_arg,numeric_arg):

    Purpose:
    The first argument is the dividend and the second argument is the divisor. The remainder of the division is returned.
    Example:
    Select MOD (99,8) returns '3’
    Select 99 mod 8 returns '3’
    Select 99 % 8 returns '3’
    Note:

    OCT(numeric_arg):

    Purpose:
    Returns the octal value of the number given in the argument.
    Example:
    Select OCT (12) returns '14’.
    Note:

    PI():

    Purpose:
    The value of ¶ (pi), ie 22 / 7 is returned. Only 6 numbers after the decimal point is returned by default.
    Example:
    Select PI () returns '3.141593’

    POW(numeric_arg, numeric_arg):

    Purpose:
    The first argument is a number and the second argument is the power to which the given number is to be raised. The value of the number raised to the required power is returned.
    Example:
    Select POW (3,4) returns '81.0’
    Note:

    RADIANS(numeric_arg):

    Purpose:
    The argument’s value is converted from degree to radians.
    Example:
    Select RADIANS ( 180) returns '3.1415926535898’
    Note:

    RAND(numeric_arg):

    Purpose:
    A random value between the range of 0 and 1 is returned for the given argument.
    Example:
    Select RAND (3) returns '0.90576975597606’
    Note:

    ROUND(numeric_arg):

    Purpose:
    Returns the rounded value of the given decimal number.
    Example:
    Select ROUND (23.248) returns '23’
    Select ROUND (23.248, 1) returns '23.4’ // Rounds off the given number’s decimals upto the number given in the second argument.
    Select ROUND (23.248,-1) returns '20.0’
    Note:

    SIGN(numeric_arg):

    Purpose:
    Depending on the sign of the argument, -1 is returned for negative number, 0 is returned for zero and 1 is returned for positive number.
    Example:
    Select SIGN (-200) returns ’-1’
    Select SIGN (200) returns '1’
    Select SIGN (-0) returns '0’ / returns '0’ irrespective of the sign before 0 .
    Note:

    SIN(numeric_arg):

    Purpose:
    Returns the SINE value of the argument passed. The value of the arguments should be in radians
    Example:
    Select SIN ( 111) returns '0.86455144861061’
    Note:

    SQRT(numeric_arg):

    Purpose:
    Returns the square root value of the given number.
    Example:
    Select SQRT ('2’) returns '1.4142135623731’
    Note:

    TAN(numeric_arg):

    Purpose:
    Returns the TAN value of the argument passed. The value of the arguments should be in radians.
    Example:
    Select TAN ( '111’) returns '1.7203486651304’
    Note:

    TRUNCATE(string_arg):

    Purpose:
    The first argument is the given decimal number and the second argument is the number that decides upto which the given number’s decimals are to be truncated. The truncated number is returned.
    Example:
    Select TRUNCATE (234.56789,2) returns '234.56’
    Select TRUNCATE (234.56789,’-2’) returns '200.0’
    Note:

    MySQL DATE FUNCTIONS

    The MySQL in-built Date Time functions supported by Zoho Analytics.

    ADDDATE(date_arg, numeric_arg):

    Purpose:
    The first argument is a date value and the second argument is the number of days to be added to it. Returns the new date.
    Example:
    Select ADDDATE ( ’ 2008-08-03 ’ , 20 )
    Note:

    ADDTIME(time_arg, time_arg):

    Purpose:
    The addition value of first argument time and second argument time is returned.
    Example:
    Select ADDTIME ('12:30:15.55555555’, '01:00:44.444445’) returns '13:31:00.000000’

    CONVERT_TZ(datetime_arg, time_arg, time_arg):

    Purpose:
    Converts the given time value to the required time value by adding the time given in the third argument.The resultant time value comes in 12 hour or 24 hour format depending on the second argument.
    Example:
    Select CONVERT_TZ ( ’ 2008-11-06 03:00:00 ’ , ’ +09:00 ’ , ’ -5:30 ’ ) returns ’ 2008-11-05 12:30:00 ’
    Note:

    CURDATE():

    Purpose:
    The present date is returned in the format of ’ yr:mth:dt ’.
    Example:
    Select CURDATE () returns '2008-11-06’
    Note:

    CURRENT_DATE():

    Purpose:
    Its function is the same as CURDATE()

    CURRENT_TIME():

    Purpose:
    Its function is the same as CURTIME()

    CURTIME():

    Purpose:
    Returns the present time of the system in the form of ’ hr : min : sec ’.
    Example:
    Select CURTIME() returns ’ 12 : 46 : 21 ’
    Select CURTIME()+0 returns ’ 124621.0 ’
    Note:

    DATE(date.time_arg):

    Purpose:
    Returns the date part alone from the date-time argument given in the function.
    Example:
    Select DATE ( ’ 2008-08-03 03:45:00 ’ ) returns ’ 2008-08-03 ’
    Note:

    DATEDIFF(date.time_arg, date.time_arg):

    Purpose:
    Returns the difference between the 2 dates given in the arguments. For subtraction only the date part of the date-time values of both the argument is taken.
    Example:
    Select DATEDIFF ( '1986-08-03 03:45:22’,'1986-08-23 18:45:43’) returns ’-20’
    Note:

    DAYNAME(date_arg):

    Purpose:
    Returns the day of the week the given date is .
    Example:
    Select DAYNAME ( ’ 2008-11-03 ’ ) returns ’ Monday ’
    Note:

    DAYOFMONTH(date_arg):

    Purpose:
    Returns the day of the month the date given in the argument is.
    Example:
    Select DAYOFMONTH ( ’ 2008-11-03 ’ ) returns '3’
    Note:

    DAYOFYEAR(date_arg):

    Purpose:
    Returns the given date’s count from the start of the year.
    Example:
    Select DAYOFYEAR ( ’ 2008-12-25 ’ ) returns '360’
    Note:

    DATE_ADD(date_arg, numeric_arg):

    Purpose:
    Returns the given date after performing the required arithmetic on it. DATE_ADD is currently not supported by Zoho Analytics.

    DATE_SUB(date_arg, numeric_arg):

    Purpose:
    Returns the given date after performing the required arithmetic on it. DATE_SUB is currently not supported by Zoho Analytics.

    EXTRACT(command from date.time_arg):

    Purpose:
    Returns the required part of the date-time value after extraction from the given date-time argument.
    Example:
    Select EXTRACT ( HOUR_SECOND FROM ’ 2009-07-02 01:02:03 ’ ) returns ’ 10203 ’

    FROM_DAYS(numeric_arg):

    Purpose:
    The count of days is started from the date 01-01-01. The argument value is taken as count and its corresponding date is displayed.
    Example:
    Select FROM_DAYS ( 733714) returns ’ 2008-11-03 ’
    Note:

    FROM_UNIXTIME(numerical_arg):

    Purpose:
    For the given argument the value of the internal timestamp is returned.
    Example:
    Select FROM_UNIXTIME (1225741235) returns ’ 2008-11-03 19:40:35 ’
    Note:

    HOUR(time_arg):

    Purpose:
    Returns the number of hours present in the given time value. The time is given in the form 'hr : min : sec’
    Example:
    Select HOUR (’ 220:22:34 ’) returns '220’
    Note:

    LAST_DAY(date.time_arg):

    Purpose:
    Returns the last date of the given date-time argument’s month.
    Example:
    Select LAST_DAY ( ’ 2004-02-31 01:02:03 ’ ) returns '29’
    Note:

    LOCALTIMESTAMP():

    Purpose:
    The present date-time values of the application’s time zone is returned. The result is returned in the form of ’ yr : mth : dt hr : min : sec ’.
    Example:
    Select LOCALTIMESTAMP () returns '2008-08-23 12:59:41’
    Note:

    MAKEDATE(numeric_arg, numeric_arg):

    Purpose:
    The argument contains the year and the count of the day for that year. The date is returned.
    Example:
    Select MAKEDATE ( 2008,215 ) returns ’ 2008-08-03 ’
    Note:

    MICROSECOND(date.time_arg):

    Purpose:
    From the given date-time argument value, the microsecond term alone is returned.
    Example:
    Select MICROSECOND ( ’ 2008-11-04 17:16:50.123 ’ ) returns '123000’
    Note:

    MID(date_arg, numeric_arg):

    Purpose:
    If the given date of a new year is in the middle of the week of the previous year then the count of the last week of the previous year is returned.
    Example:
    Select MID ( YEARWEEK ( ’ 2001-01-06 ’ ),5 ) returns ’ 53 ’

    MINUTE(time_arg):

    Purpose:
    Returns the number of minutes present in the given time value. The time is given in the form 'hr : min : sec’
    Example:
    Select MINUTE (’ 220:22:34 ’) returns '22’
    Note:

    MONTH(date_arg):

    Purpose:
    This function returns the month of the given date.
    Example:
    Select MONTH ( ’ 2008-08-03 ’ ) returns '8’
    Note:

    NOW():

    Purpose:
    The present date-time values of the application’s time zone is returned. The result is returned in the form of ’ yr : mth : dt hr : min : sec ’. Its function is same as LOCALTIMESTAMP()
    Example:
    Select NOW () returns '2008-08-23 12:59:41’
    Note:

    PERIOD_ADD(numeric_arg, numeric_arg):

    Purpose:
    The argument contains the date and the number of months to be added to it. The date is passed in the format of period i.e 'yrmth’.
    Example:
    Select PERIOD_ADD ( 198608,06 ) returns ’ 198702 ’
    Note:

    PERIOD_DIFF(numeric_arg, numeric_arg):

    Purpose:
    2 dates in the form of period values are passed in the arguments. The number of months present between the 2 values is returned.
    Example:
    Select PERIOD_DIFF ( 198608, 198606 ) returns ’-10’
    Note:

    QUARTER(date_arg):

    Purpose:
    For the given date, the corresponding quarter of year is returned, ie returns '1’ if the months are 1,2,3; returns 2 if the months are 4,5,6; returns 3 if the months are 7,8 9 and returns 4 if the months are 10,11,12.
    Example:
    Select QUARTER ( ’ 2008-08-23 ’ ) returns '3’
    Note:

    SEC_TO_TIME(numeric_arg):

    Purpose:
    The argument passed is the count of seconds of a day. It’s value in hours, minutes and seconds are returned.
    Example:
    Select SEC_TO_TIME ( 86399 ) returns ’ 23:59:59 ’
    Note:

    SLEEP(numeric_arg):

    Purpose:
    This function is currently not supported by Zoho Analytics.

    STR_TO_DATE(numeric_arg, string_arg):

    Purpose:
    Returns the date-time value after its conversion from the given string. The conversion is done after taking note of the format of the given string . The format is given as second argument.
    Example:
    Select STR_TO_DATE ( ’ 06/31/2004 ’, ’ %m/%d/%Y ’ ) returns ’ 2004-07-01 ’
    Note:

    SUBDATE(date.time_arg, numeric_arg):

    Purpose:
    Returns the date-time value after subtracting the number of days passed in the second argument from the date-time value passed in the first argument.
    Example:
    Select SUBDATE ( ’ 2008-02-19 12:00:00 ’, 31 ) returns ’ 2008 -01-19 12:00:00 ’
    Select SUBDATE ( ’ 2008-02-19 ’, INTERVAL 31 DAY ) // This query is currently not supported by Zoho Analytics
    Note:

    SUBTIME(date.time_arg, time_arg):

    Purpose:
    The first argument is a date-time value and the second argument is a time value. The subtraction value of second argument from the first argument is returned.
    Example:
    Select SUBTIME ( ’ 1986-08-03 18:45:00 ’ , ’ 03:45:00 ’ ) returns ’ 1986-08-03 15:00:00 ’
    Note:

    SYSDATE():

    Purpose:
    The present date-time value of the application’s time zone is returned in the form of ’ yr : mth : dt hr : min : sec ’.
    Example:
    Select SYSDATE () returns ’ 2008-11-05 05:41:16 ’
    Note:

    TIME(date.time_arg):

    Purpose:
    From the given date-time value argument, the time value is returned.
    Example:
    Select TIME ( ’ 2008-11-05 17:34:45 ’ ) returns ’ 17:34:45 ’
    Note:

    TIMEDIFF(time_arg, time_arg):

    Purpose:
    Returns the difference between the 2 time values passed in the 2 arguments.
    Example:
    Select TIMEDIFF('20:08:05’,'20:07:34’) returns '00:00:31’
    Note:

    TIMESTAMP(date.time_arg, time_arg):

    Purpose:
    The first argument contains both the date and time values. The second argument should contain only the time values. Both the arguments are added and the resultant date-time value is returned.
    Example:
    Select TIMESTAMP ( ’ 2008-11-05 19:00:00 ’ , ’ 06:00:00 ’ ) returns ’ 2008-11-06 01:00:00 ’
    Note:

    TIMESTAMPADD():

    Purpose:
    This function is currently not supported by Zoho Analytics.

    TIMESTAMPDIFF():

    Purpose:
    This function is currently not supported by Zoho Analytics.

    TIME_FORMAT(time_arg, string_arg):

    Purpose:
    The first argument is the time and the second argument is the format string containing format specifiers. The formatted value is returned.
    Example:
    Select TIME_FORMAT ( ’ 19:30:41.32 ’ , ’ %k %l %i %s %f ’ ) returns ’ 19 7 30 41 320000 ’
    Note:

    TIME_TO_SEC(time_arg):

    Purpose:
    For the time value passed the total number of seconds is returned after converting the minutes and hours to seconds.
    Example:
    Select TIME_TO_SEC ( ’ 01:00:00 ’ ) returns ’ 3600 ’

    TO_DAYS(date_arg):

    Purpose:
    Converts the passed date argument to the total number of days passed since the date '0001-01-01’
    Example:
    Select TO_DAYS ( ’ 2008-11-07 ’ ) returns ’ 733718 ’
    Note:

    UNIX_TIMESTAMP(date.time_arg):

    Purpose:
    Returns the number of seconds completed since the date ’ 1970-01-01 00:00:00 ’
    Example:
    Select UNIX_TIMESTAMP ( ’ 1970-01-01 00:30:00 ’ ) returns ’ 1800 ’
    Note:

    UTC_DATE():

    Purpose:
    The present UTC date is returned.
    Example:
    Select UTC_TIMESTAMP () returns ’ 2008-11-06 05:40:58 ’
    Note:

    UTC_TIMESTAMP():

    Purpose:
    The present UTC date-time value is returned.
    Example:
    Select UTC_TIMESTAMP () returns ’ 2008-11-06 05:40:58 ’
    Note:

    WEEK(date_arg):

    Purpose:
    Returns the week of the year in which the given date is present.
    Example:
    Select WEEK(’ 2008-01-14 ’) returns '2’
    Note:

    WEEKDAY(date_arg):

    Purpose:
    Returns the day of the week the given date is. Returns '0’ if its a Monday, '1’ if its Tuesday,……'6’ if it is Sunday.
    Example:
    Select WEEKDAY ( ’ 2008-11-06 ’ ) returns '3’ since its a thursday.
    Note:

    WEEKOFYEAR(date_arg):

    Purpose:
    Returns the week of the year in which the given date is present.
    Example:
    Select WEEKOFYEAR ( ’ 2008-01-14 ’ ) returns '2’
    Note:

    YEAR(date_arg):

    Purpose:
    This function returns the year of the given date.
    Example:
    Select YEAR ( ’ 2008-11-22 ’ ) returns ’ 2008 ’
    Note:

    YEARWEEK(date_arg):

    Purpose:
    Starting the count of the first week from the date '0000-01-01’ the week of the given date is returned.
    Example:
    Select YEARWEEK ( ’ 2000-01-02 ’ ) returns ’ 200001 ’
    Note:

    MySQL AGGREGATE FUNCTIONS

    The MySQL in-built Aggregate functions supported by Zoho Analytics.

    AVG(numeric_arg):

    Purpose:
    Returns the average of the given term’s values.
    Example:
    Select AVG (col1) from "tab5” returns '3’ // Here 'tab5’ is the table name and 'col1’ is the column name.
    Note:

    BIT_AND(numeric_arg):

    Purpose:
    The Bitwise AND calculation is performed on the given table’s values and the result is returned.
    Example:
    SELECT BIT_AND (numCol) from “ allTypeTest ” returns '33’ // The Bitwise_AND of the values of 'numcol’ rows from the Workspace 'allTypeTest’ is returned.
    Note:

    BIT_OR(numeric_arg):

    Purpose:
    The Bitwise OR calculation is performed on the given table’s values and the result is returned.
    Example:
    SELECT BIT_OR (numCol) from “ allTypeTest ” returns '127’ // The Bitwise_OR of the values of 'numcol’ rows from the Workspace 'allTypeTest’ is returned.
    Note:

    BIT_XOR(numeric_arg):

    Purpose:
    The Bitwise XOR calculation is performed on the given table’s values and the result is returned.
    Example:
    SELECT BIT_XOR ( numCol ) from “ allTypeTest ” returns '121’ // The Bitwise_XOR of the values of 'numcol’ rows from the Workspace 'allTypeTest’ is returned.
    Select ATAN ('0.5A@5’) returns '0.46364760900081’ // As soon as a non numeric character is found in the number string the number’s value is returned.
    Note:

    COUNT(numeric_arg):

    Purpose:
    Counts the number of rows present in the given table.
    Example:
    Select COUNT (numCol) from “ allTypeTest ” returns '6’ // since 'numcol’ column from the Workspace 'allTypeTest’ contains 6 rows.
    Note:

    GROUP_CONCAT(numeric_arg):

    Purpose:
    Concatenates the string values present in the given table.
    Example:
    Select GROUP_CONCAT ( plainCol ) from “allTypeTest” returns 'Hello,Hlo,Hello,Hlo,Hello,Hlo’
    Select GROUP_CONCAT ( DISTINCT plainCol ) from “allTypeTest” returns 'Hello,Hlo’ // Does not repeat the output string.
    Note:

    MAX(string_arg, numeric_arg1, numeric_arg2):

    Purpose:
    The values present in the given columns are compared with each other and the maximum value is returned. The maximum value of both numbers and string are returned.
    Example:
    Select MAX (col3 ) from “tab2” returns 'sat’
    Note:

    MIN(numeric_arg):

    Purpose:
    The values present in the given columns are compared with each other and the minimum value is returned. The minimum value of both numbers and string are returned.
    Example:
    Select MIN (col3 ) from “tab2” returns 'chk’
    Note:

    STD(number1, number2):

    Purpose:
    The standard deviation of the given table’s numeric values are calculated and returned.
    Example:
    Select STD ( col2 ) from “ tab6 ” returns '8.0554’
    Note:

    SUM(numeric_arg):

    Purpose:
    The sum of the given table’s values are calculated and returned.
    Example:
    Select SUM ( col2 ) from “ tab6 ” returns '32.0’
    Note:

    VARIANCE(numeric_arg):

    Purpose:
    The variance of the given table’s values are calculated and returned.The logarithm of the number to the base 10 is returned.
    Example:
    Select VARIANCE ( col2 ) from “ tab6 ” returns '64.8889’
    Note:

    API Usage Limits & Pricing

    Zoho Analytics API usage will be measured based on units consumed & frequency of API calls. The API Units and frequency calculations are described in this section. API units allowed are scoped by each of the pricing plans.

    In order to ensure effective resource utilization and service quality, Zoho Analytics controls API Usage based on units of usage and frequency of invocation of API calls. The details of these are described in the document.


    API Units

    Each Zoho Analytics API method has been associated with a defined quantum of units. The units consumed by your application will be calculated based on how often the different API methods are invoked in your application on a per day basis.

    Each Zoho Analytics pricing plan will be capped with an allowed units per day. The limits will be applied based on your Zoho Analytics plan. You can also purchase add-on units on need.

    Pricing Plans and API Units allowed per Day:

    Plan API Units per Day
    Free 1,000 units
    Basic 4,000 units
    Standard 10,000 units
    Premium 30,000 units
    Enterprise 100,000 units

    For example, a user account in Zoho Analytics Standard plan, can only consume a maximum of 10,000 API units per day.

    Units Calculation for each API Method/Action

    The table below provides how many units will be consumed invoking each of the different types of API methods

    API Description API Action Units
    API Type - BULK
    Import using APPEND option Import Data
    Create Import Job
    10 units per 1000 Rows
    Import using TRUCATEADD option Import Data
    Create Import Job
    10 units per 1000 Rows
    Import using UPDATEADD option Import Data
    Create Import Job
    15 units per 1000 Rows
    Export Chart View in Image or PDF format Export Data
    Create Export Job
    10 units per request
    Export any view as PDF Export Data
    Create Export Job
    5 units per 1000 Rows
    Export Dashboard in any format Export Data
    Create Export Job
    15 units per request
    Export any view as HTML Export Data
    Create Export Job
    15 units per request
    All the other Export operations
    (not comes under the above EXPORT classifications)
    Examples:
    1. Exporting a Table in CSV format
    2. Exporting a Pivot View in JSON format etc.
    Export Data
    Create Export Job
    3 units per 1000 Rows
    Copying a Workspace without Data Copy Workspace 25 units per request
    Copying a Workspace with Data Copy Workspace 25 units per request + 1 unit per 1000 Rows
    API Type - DML
    Add a single row Add Row 0.1 unit per request
    Update rows Update Row 0.3 unit per request
    Delete rows Delete Row 0.1 unit per request
    API Type - METADATA
    Get details of an import job Get Import Job Details 0 units per request
    Get details of an export job Get Import Job Details 0 units per request
    Download data for the export job Download Exported Data 0 units per request
    Create a blank workspace Create Workspace 1 unit per request
    Rename a workspace Rename Workspace 1 unit per request
    Delete a workspace Delete Workspace 1 unit per request
    Create a new table Create Table 1 unit per request
    Copy a view within the workspace Saveas View 1 unit per request
    Rename a view Rename View 1 unit per request
    Delete a view Delete View 2 units per request
    Create a new folder Create Folder 1 unit per request
    Rename a folder Rename Folder 1 unit per request
    Set default folder Make Default Folder 1 unit per request
    Delete a folder Delete Folder 1 unit per request
    Add a new column Add Column 15 units per request
    Rename a column Rename Column 5 units per request
    Delete a column Delete Column 10 units per request
    Add a lookup in child table Add Lookup 1 unit per request
    Remove lookup from a column Remove Lookup 2 units per request
    Hide the columns Hide Columns 1 unit per request
    Unhide the hidden columns Show Columns 1 unit per request
    Copy views from one workspace to another Copy Views 1 unit per request
    Copy formulas from one table to another Copy Formulas 1 unit per request
    Create reports for table based on the reference table. Create Similar Views 1 unit per request
    Auto generate reports for the table. Auto Analyse View 1 unit per request
    Auto generate reports for the column Auto Analyse Column 1 unit per request
    Get list of admins for a workspace Get Variables 1 unit per request
    Get details of a variable Get Variable Details 1 unit per request
    Create a new variable Create Variable 1 unit per request
    Update details of a variable Update Variable 1 unit per request
    Delete a variable Delete Variable 1 unit per request
    Get all accessible organizations Get Organizations 0.1 unit per request
    Get all accessible workspaces Get All Workspaces 0.2 unit per request
    Get list of owned workspaces Get Owned Workspaces 0.1 unit per request
    Get list of shared workspaces Get Shared Workspaces 0.1 unit per request
    Get all accessible view list from a workspace Get Views 0.1 unit per request
    Get all accessible folder list from a workspace Get Folders 0.1 unit per request
    Get list of recently accessed views Get Recent Views 0.1 unit per request
    Get list of all accessible dashboards Get Dashboards 1 unit per request
    Get list of owned dashboards Get Owned Dashboards 0.1 unit per request
    Get list of shared dashboards Get Shared Dashboards 0.5 unit per request
    Get secret key of a workspace Get Workspace Secretkey 0.5 unit per request
    Get details of a workspace Get Workspace Details 0.1 unit per request
    Get details of a view Get View Details 0.1 unit per request
    Add a workspace as favorite Add Favorite Workspace 0.1 unit per request
    Remove a workspace from favorite Remove Favorite Workspace 0.1 unit per request
    Add a workspace as favorite Add Favorite View 0.1 unit per request
    Remove a view from favorite Remove Favorite View 0.1 unit per request
    Add a workspace as default Add Default Workspace 0.1 unit per request
    Remove a workspace from default Remove Default Workspace 0.1 unit per request
    Get details of a workspace/view Get Meta Details 0.1 unit per request
    Get list of datasources for a workspace Get Datasources 1 unit per request
    Initiate datasync for a connection Sync Data 5 unit per request
    Initiate datasync for a view Refetch Data 2 unit per request
    Get import details of a view Get Last Import Details 0.1 unit per request
    Update connection details Update Datasource Connection 1 unit per request
    Enable workspace access for white label domain Enable Domain Workspace 0.1 unit per request
    Disable workspace access for white label domain Disable Domain Workspace 0.1 unit per request
    Get list of admins for an organization Get Org Admins 0.1 unit per request
    Get list of admins for a workspace Get Workspace Admins 0.1 unit per request
    Add admins for a specified workspace Add Workspace Admins 5 units per request
    Remove admins from a workspace Remove Workspace Admins 5 units per request
    Get shared details of a workspace Get Workspace Shared Details 3 units per request
    Share views to users Share Views 5 units per request
    Remove shared views for users Remove Share 5 units per request
    Get permissions for a view Get My Permissions 0.1 unit per request
    Get list of groups from a workspace Get Groups 0.1 unit per request
    Get details of a group Get Group Details 0.1 unit per request
    Create a new group Create Group 1 unit per request
    Rename a group Rename Group 0.1 unit per request
    Add users to a group Add Group Members 0.1 unit per request
    Remove users from a group Remove Group Members 0.1 unit per request
    Delete a group Delete Group 1 unit per request
    Get URL to access a view Get View URL 0.1 unit per request
    Get embed URL to access a view Get Embed URL 1 unit per request
    Get private URL to access a view Get Private URL 0.1 unit per request
    Create private URL for a view Create Private URL 1 unit per request
    Get list of all slideshows in a workspace Get Slideshows 1 unit per request
    Get details of a slide Get Slideshow Details 1 unit per request
    Get URL to access a slideshow Get Slideshow URL 1 unit per request
    Create a new slideshow. Create Slideshow 2 units per request
    Update details of a slideshow Update Slideshow 2 units per request
    Delete a slideshow Delete Slideshow 2 units per request
    Get list of users in an organization Get Users 1 unit per request
    Add users in an organization Add Users 0.1 unit per request
    Remove users from an organization Remove Users 0.1 unit per request
    Activate users in an organization Activate Users 0.1 unit per request
    Deactivate users in an organization Deactivate Users 0.1 unit per request
    Change role of the users in an organization Change User Role 0.1 unit per request
    Get subscription details of an organization Get Subscription Details 0.1 unit per request

    For example, making a “IMPORT” API (Import APPEND Type) call to import 10,000 rows the units consumed will be: (10,000/1,000) * 10 units = 100 units consumed.

    Note:When the total API Units consumed per day exceeds the allowed units for the purchased plan, Zoho Analytics will send the error response with code 6043 (or) 6044.


    API Frequency

    API frequency refers to the number of API requests made per minute. Different API types have different frequency limits. Find below, the frequency limit thresholds for each API type. For example, in a minute, a maximum of 100 requests can only be sent for the DML type API.

    API Frequency per minute

    API TYPE Frequency Limit (per minute)
    DML 100
    BULK 40
    METADATA 60
    OVERALL * 100

    Note:When the number of API requests triggered per minute exceeds the above mentioned allowed frequency limits, Zoho Analytics will send the error response with code 6045.


    API Units Add-on Pricing

    In case, the API usage goes beyond the allowed limit of the purchased Zoho Analytics plan, the Administrator of the account can either upgrade to any of the higher plans or purchase the API Units as add-on.

    API Units/Day Amount (Monthly)
    10,000 units/day $15
    25,000 units/day $25
    50,000 units/day $40
    100,000 units/day $60
    200,000 units/day $80