Dataset resource management

Updated at:

This topic describes the APIs for dataset management.

List workspace datasets

  • Endpoint: /openapi/v2/dataset/list (GET)

  • Description: Retrieves a list of datasets in a specified workspace. The results are sorted by creation time in descending order.

  • Available since: standalone deployment v3.8.3

  • Request parameters:

    Parameter

    Type

    Description

    Required

    workspaceId

    string

    The ID of the workspace.

    Yes

    directoryId

    string

    The ID of the directory. If you specify this parameter, the operation returns all datasets in the specified directory.

    No

    withChildren

    boolean

    Specifies whether to recursively retrieve datasets from subdirectories.

    true: Returns all datasets from the specified directory and its subdirectories.

    false: Returns only the datasets from the specified directory.

    No

    keyword

    string

    The keyword to search for datasets by name.

    No

    pageNum

    int

    The page number. Default value: 1.

    No

    pageSize

    int

    The page size. Default value: 10.

    No

  • Response parameters (Note: When you call this operation by using an SDK, only the data object is returned.)

    Parameter

    Type

    Description

    requestId

    string

    The request ID.

    code

    string

    The error code. Valid values:

    • 0: The request was successful.

    • Error codes that start with AE or OE: The request failed.

    message

    string

    The error message. Valid values:

    • success: The request was successful.

    • Other values: An error message is returned if the request fails.

    success

    boolean

    Indicates whether the request was successful. Valid values:

    • true: The request was successful.

    • false: The request failed.

    data

    object

    The paginated list of datasets.

    • totalNum

    int

    The total number of entries.

    • totalPages

    int

    The total number of pages.

    • pageSize

    int

    The number of entries on each page, as specified in the request.

    • pageNum

    int

    The page number.

    • data

    object

    An array of dataset objects.

    • datasetId

    string

    The ID of the dataset.

    Example: 5820f58c-c734-4d8a-baf1-7979af4f****

    • datasetName

    string

    The name of the dataset.

    Example: company_sales_record_copy12

    • authLevel

    int

    The collaborative editing permission. Valid values:

    • 0: Private

    • 11: All workspace members

    • 12: Specific members

    • authorizedUseType

    int

    Indicates whether the dataset is available to all members in the workspace.

    1: Available to all members.

    2: Not available to all members.

    • rowLevel

    boolean

    Indicates whether row-level permission is enabled. Valid values:

    • true: Enabled

    • false: Disabled

    Example: true

    • workspaceId

    string

    The ID of the workspace.

    • description

    string

    The description of the dataset.

    Example: Test dataset

    • gmtCreate

    string

    The time when the dataset was created.

    Example: 2020-11-02 10:36:05

    • ownerName

    string

    The nickname of the dataset owner.

    Example: John Doe

    • workspaceName

    string

    The name of the workspace.

    Example: Test workspace

    • ownerId

    string

    The user ID of the dataset owner in Quick BI.

    Example: 136516262323****

    • gmtModify

    string

    The time when the dataset was last modified.

    Example: 2020-11-02 10:36:05

    • openOfflineAcceleration

    boolean

    Indicates whether extraction acceleration is enabled.

    • true: Enabled

    • false: Disabled

    Example: true

    • datasource

    object

    The data source of the dataset.

    • dsType

    string

    The type of the data source.

    Example: mysql

    • dsName

    string

    The name of the data source.

    Example: Test data source

    • dsId

    string

    The ID of the data source.

    Example: 261b252d-c3c3-498a-a0a7-5d1ec6cd****

    • directory

    object

    The directory where the dataset is located.

    • pathId

    string

    The ID of the directory path.

    Example: schemaad8aad00-9c55-4984-a767-b4e0ec60****

    • pathName

    string

    The name of the directory path.

    Example: My Datasets Directory

    • name

    string

    The name of the directory.

    Example: My Datasets Directory

    • id

    string

    The ID of the directory.

    Example: schemaad8aad00-9c55-4984-a767-b4e0ec60****

  • Response example

    {
      "requestId": "7F82XXXX-DC21-XXXX-8256-6D177XXXXCE1",
      "data": {
        "data":[
          {
            "rowLevel":false,
            "gmtModify":"2024-06-24 11:02:43",
            "datasetName":"dataset create",
            "modifierId":"4ceXXXXfeXXXX8d2a63XXXXdd843af0d",
            "ownerId":"4ceXXXXfeXXXX8d2a63XXXXdd843af0d",
            "gmtCreate":"2024-06-24 11:02:43",
            "directory":{
              "pathName":"-1",
              "name":"-1",
              "id":"-1",
              "pathId":"-1"
            },
            "openOfflineAcceleration":false,
            "ownerName":"John Doe",
            "datasource":{
              "dsName":"mysql",
              "dsId":"b0d2a7e9-XXXX-422f-bc9b-XXXX45f4b64e",
              "dsType":"mysql"
            },
            "datasetId":"462bd4bb-XXXX-4c26-b3b5-XXXX8ed8f72a",
            "workspaceName":"XX Organization",
            "modifierName":"John Doe",
            "workspaceId":"0172c18a-XXXX-4340-be77-XXXX6c6056e8"
          }
          ],
        "totalNum":1,
        "totalPages":1,
        "start":0,
        "pageSize":20,
        "pageNum":1
      }
      ,
      "success": true
    }
    
  • Java SDK example

    private static void testQueryDatasetList() throws SDKException {
        HttpRequest request = HttpRequest.build()
            .setUri("/openapi/v2/dataset/list")
            .setMethod(HttpMethod.GET);
        request.addParameter("workspaceId", "c5f86ad2-*");
        //request.addParameter("directoryId", "3ff361ec-*");
        //request.addParameter("withChildren", false);
        //request.addParameter("keyword", "test");
        request.addParameter("pageNum", 1);
        request.addParameter("pageSize", 100);
        String result = client.syncExecute(request);
        System.out.println(result);
    }

Get dataset details

  • Endpoint: GET /openapi/v2/dataset/infoNew

  • Description: Retrieves details for a specified dataset, including its data source, directory, and data model, which contains dimensions, measures, physical fields, custom SQL, relationships, and more.

  • Available since: standalone deployment v4.0.2

  • Request parameters:

    Parameter

    Type

    Description

    Required

    datasetId

    string

    The ID of the dataset.

    Yes

  • Response parameters: (For SDK calls, only the data object is returned.)

    Parameter

    Type

    Description

    traceId

    string

    The request ID.

    code

    string

    The error code. Valid values:

    • 0: The call was successful.

    • An error code starting with AE or OE: The call failed.

    message

    string

    The error message. Valid values:

    • success: The call was successful.

    • Other values: An error message is returned if the call fails.

    success

    boolean

    Indicates whether the request was successful. Valid values:

    • true: The request was successful.

    • false: The request failed.

    data

    object

    The details of the dataset.

    • datasetId

    string

    The ID of the dataset.

    • datasetName

    string

    The name of the dataset.

    • authLevel

    Integer

    Collaborative editing permissions. Valid values:

    • 0: Private

    • 11: All workspace members

    • 12: Specified members

    • authorizedUseType

    Integer

    Indicates whether the dataset is available to all members in the workspace.

    1: Available to all workspace members.

    2: Not available to all workspace members.

    • cubeTableList

    object [ ]

    A list of physical tables associated with the dataset.

    datasourceId

    string

    The ID of the data source.

    dsType

    string

    The type of the data source.

    uniqueId

    string

    The unique ID of the table.

    caption

    string

    The display name.

    tableName

    string

    The name of the physical table.

    factTable

    boolean

    Indicates whether this is the fact table.

    isCustomsql

    boolean

    Indicates whether the table is defined by custom SQL.

    sql

    string

    The SQL statement for the custom SQL table.

    childTables

    object [cubeTable ]

    A list of the underlying physical or SQL-based tables, returned only for merged tables.

    • measureList

    object [ ]

    A list of measure fields.

    tableUniqueId

    string

    The unique ID of the table that contains this measure.

    uid

    string

    The unique ID of the measure.

    caption

    string

    The display name.

    dataType

    string

    The data type. Valid values:

    • String: string

    • Number: number

    • Date: datetime

    measureType

    string

    The type of the measure. Valid values:

    • STANDARD_MEASURE: Standard measure

    • CALCULATE_MEASURE: Calculated measure

    expression

    string

    The expression for the calculated measure. This parameter is valid only for calculated measures.

    expressionV2

    string

    The flattened expression for the calculated field.

    factColumn

    string

    The underlying physical field.

    fieldDescription

    string

    The description of the field.

    • dimensionList

    object [ ]

    A list of dimension fields.

    tableUniqueId

    string

    The unique ID of the table that contains this dimension.

    uid

    string

    The unique ID of the dimension.

    caption

    string

    The display name.

    dataType

    string

    The data type. Valid values:

    • String: string

    • Number: number

    • Date: datetime

    refUid

    string

    For a grouped dimension, this specifies the unique ID of the referenced field.

    granularity

    string

    The granularity for date and geographic dimensions.

    expression

    string

    The expression for the calculated dimension. This parameter is valid only for calculated dimensions.

    expressionV2

    string

    The flattened expression for the calculated field.

    factColumn

    string

    The underlying physical field.

    dimensionType

    string

    The type of the dimension. Valid values:

    • STANDARD_DIMENSION: Standard dimension

    • CALCULATE_DIMENSION: Calculated dimension

    • GROUP_DIMENSION: Grouped dimension

    • dsId

    string

    The ID of the data source.

    • gmtCreate

    string

    The dataset's creation timestamp.

    • ownerName

    string

    The name of the dataset owner.

    • ownerId

    string

    The user ID of the dataset owner.

    • dsName

    string

    The name of the data source.

    • directory

    string

    Details of the dataset's directory.

    • id

    string

    The ID of the directory.

    • name

    string

    The name of the directory.

    • pathId

    string

    The path of directory IDs, for example, aa/bb/cc/dd.

    • pathName

    string

    The path of directory names, for example, First-level Directory/Second-level Directory.

    • dsType

    string

    The type of the data source.

    • workspaceName

    string

    The name of the workspace.

    • workspaceId

    string

    The ID of the workspace.

    • custimzeSql

    boolean

    Indicates whether the dataset uses custom SQL.

    • modifierName

    string

    The name of the user who last modified the dataset.

    • modifierId

    string

    The ID of the last user to modify the dataset.

    • rowLevel

    boolean

    Indicates whether row-level security is enabled.

    • gmtModify

    string

    The dataset's last modification timestamp.

    • OpenOfflineAcceleration

    boolean

    Indicates whether extraction acceleration is enabled.

    • true: Enabled

    • false: Disabled

    Example value: true

  • Response example

    {
        "rowLevel": false,
        "gmtModify": 1720754891000,
        "dsName": "Demo Database",
        "dsId": "67727257-a475-****-9b12-cc22f7aa2a0f",
        "datasetName": "company_sales_record_update1123456",
        "dsType": "mysql",
        "placeholders": [
            {
                "defaultValue": [
                    "'a' = 'a'"
                ],
                "name": "shipping_type_ph",
                "style": "param",
                "useInGlobal": true,
                "type": "string",
                "uniqueId": "794f80****"
            },
            {
                "name": "shipping_type_ph1",
                "style": "placeholder",
                "useInGlobal": false,
                "type": "string",
                "uniqueId": "7c052e****"
            },
            {
                "name": "shipping_type_ph2",
                "style": "placeholder",
                "useInGlobal": false,
                "type": "string",
                "uniqueId": "87a8aa****"
            },
            {
                "name": "order_amt_ph",
                "style": "placeholder",
                "useInGlobal": false,
                "type": "number",
                "uniqueId": "f1115e****"
            },
            {
                "originalType": "dateRange",
                "defaultValue": [
                    "2020-01",
                    "2022-10"
                ],
                "name": "shipping_date_ph",
                "format": "YYYY-MM",
                "style": "placeholder",
                "useInGlobal": true,
                "type": "monthRegion",
                "uniqueId": "7485e3****"
            },
            {
                "name": "area_province_city_ph",
                "conditionPlaceHolderFields": [
                    {
                        "column": "area1",
                        "uniqueId": "a35777****"
                    },
                    {
                        "column": "province1",
                        "uniqueId": "21e95a****"
                    },
                    {
                        "column": "11city123",
                        "uniqueId": "1bbc04****"
                    }
                ],
                "style": "condition",
                "useInGlobal": false,
                "type": "string",
                "uniqueId": "03f99b****"
            }
        ],
        "ownerId": "7856b****92847bcb9ec5bf1b19fe6bb",
        "gmtCreate": 1720751851000,
        "openOfflineAcceleration": false,
        "ownerName": "gengnan.wy",
        "datasetId": "c0f8a3f6-890f-****-a47f-959346b1b17d",
        "workspaceName": "Sample Workspace",
        "dimensionList": Array[32],
        "cubeTableList": Array[1],
        "workspaceId": "8d829c5e-1604-****-b053-0a9f45d34803",
        "measureList": Array[5]
    }
  • Java SDK example

    private static void testQueryDatasetInfo() throws SDKException {
        HttpRequest request = HttpRequest.build()
            .setUri("/openapi/v2/dataset/infoNew")
            .setMethod(HttpMethod.GET);
        request.addParameter("datasetId", "a201c85c-*");
        String result = client.syncExecute(request);
        System.out.println(result);
    }

Get authorized users

  • Endpoint: /openapi/v2/dataset/share/grantedList (GET)

  • Description: Retrieves the list of authorized or unauthorized users for a specified dataset.

  • Available since: private deployment 3.12.1

  • Input parameters:

    Parameter

    Type

    Description

    Required

    grantType

    boolean

    Specifies whether to retrieve authorized or unauthorized users:

    • true: Retrieves the list of authorized users.

    • false: Retrieves the list of unauthorized users.

    Yes

    worksId

    String

    The ID of the dataset.

    Yes

    keyword

    String

    A keyword for a fuzzy search on the accountName and nickName fields.

    Main search fields: accountName/nickName.

    No

    pageNum

    int

    The page number.

    Default value: 1.

    No

    pageSize

    int

    The number of entries per page.

    Default value: 10.

    No

  • Response parameters (When using an SDK, the response contains only the 'data' object.)

    Parameter

    Type

    Description

    traceId

    string

    The request ID.

    code

    string

    The error code. Valid values:

    • 0: The request was successful.

    • Codes that start with AE or OE indicate a failed request.

    message

    string

    The response message. Valid values:

    • success: The request was successful.

    • Other values: An error message that describes the failure.

    success

    boolean

    Indicates whether the request was successful. Valid values:

    • true: The request succeeded.

    • false: The request failed.

    data

    object

    A paginated list of users.

    • totalNum

    int

    The total number of rows.

    • totalPages

    int

    The total number of pages.

    • pageSize

    int

    The page size specified in the request.

    • pageNum

    int

    The page number.

    • data

    object [ ]

    The list of users.

    • nickname

    string

    The user's nickname.

    • worksId

    string

    The dataset ID.

    • userId

    string

    The user ID.

  • Response example:

    {
        "data": [
            {
                "worksId": "539c5512-*****9",     // The ID of the dataset
                "nickname": "BI Analyst Pro",     // The user's nickname
                "userId": "de4bc5f9*****5"     // The Quick BI user ID
            }
        ],
        "totalNum": 1,
        "totalPages": 1,
        "start": 0,
        "pageSize": 10,
        "pageNum": 1
    }
  • Java SDK example:

    private static void testGetUsers() throws SDKException {
        HttpRequest request = HttpRequest.build()
            .setUri("/openapi/v2/dataset/share/grantedList")
            .setMethod(HttpMethod.GET);
        request.addParameter("grantType", "true");
        request.addParameter("worksId", "a201c85c-*");
        request.addParameter("keyword", "");
        request.addParameter("pageNum", "1");
        request.addParameter("pageSize", "10");
        String result = client.syncExecute(request);
        System.out.println(result);
    }

Grant dataset authorization (batch supported)

  • API: POST /openapi/v2/dataset/share/authorize

  • Description: Grants authorization for a dataset to an entire workspace or to specified users within that workspace.

  • Available since: private deployment v3.12.1

  • Request parameters (Content-Type: application/x-www-form-urlencoded;charset=UTF-8. Parameters are sent as form data.)

    Parameter

    Type

    Description

    Required

    grantType

    boolean

    The authorization mode. Valid values:

    • true: Grants authorization to the entire workspace.

    • false: Grants authorization to specified users in the workspace.

    Yes

    worksId

    String

    The ID of the dataset.

    Yes

    shareToUserIds

    String

    The IDs of the users to authorize. For batch requests, separate multiple user IDs with a half-width comma (,).

    No.

    This takes effect only when grantType=false.

  • Response parameters (Note: The SDK call returns only the data field.)

    Parameter

    Type

    Description

    traceId

    string

    The request ID.

    code

    string

    The error code. Valid values:

    • 0: The request was successful.

    • Error codes that start with AE or OE: The call failed.

    message

    string

    The error message. Valid values:

    • success: The request was successful.

    • Other values: An error message if the request fails.

    success

    boolean

    Indicates whether the request was successful. Valid values:

    • true: The request was successful.

    • false: The request failed.

    data

    boolean

    Indicates whether the operation was successful. Valid values:

    • true: The operation was successful.

    • false: The operation failed.

  • Response example:

    {
        "traceId": "ccc2c13b-fd40-****-bc33-1d66c30ec828",
        "code": null,
        "message": null,
        "data": true,
        "success": true
    }
  • Java SDK example:

        private static void testAuthorize() throws SDKException {
            HttpRequest request = HttpRequest.build()
                .setUri("/openapi/v2/dataset/share/authorize")
                .setMethod(HttpMethod.POST);
            request.addParameter("grantType", "false");
            request.addParameter("worksId", "a201c85c-*");
            request.addParameter("shareToUserIds", "f5698b***,6afccd9e434a***");
            String result = client.syncExecute(request);
            System.out.println(result);
        }

Revoke dataset authorization

  • API path: /openapi/v2/dataset/share/unAuthorize (POST)

  • API description: Revokes authorization for a dataset from its workspace or from specified users within the workspace.

  • Initial version: standalone deployment 3.12.1

  • Input parameters: (content-type:application/x-www-form-urlencoded;charset=UTF-8, submit parameters as form data)

    Parameter

    Type

    Description

    Required

    grantType

    boolean

    Authorization mode:

    • true: Revokes authorization from the workspace.

    • false: Revokes authorization from specified users in the workspace.

    Yes

    worksId

    String

    The ID of the dataset.

    Yes

    shareToUserIds

    String

    The IDs of users to revoke authorization from. Separate multiple IDs with a comma (,).

    No.

    This parameter is required only when grantType=false.

  • Response parameters (The SDK returns only the value of the data field.)

    Parameter

    Type

    Description

    traceId

    string

    The request ID.

    code

    string

    The error code. Valid values:

    • 0: The call succeeded.

    • Exception codes starting with AE or OE: The call failed.

    message

    string

    The error message. Valid values:

    • success: The call succeeded.

    • Other values: A message that describes the error.

    success

    boolean

    Indicates whether the request was successful. Valid values:

    • true: The request succeeded.

    • false: The request failed.

    data

    boolean

    Indicates whether the operation was successful. Valid values:

    • true: The operation succeeded.

    • false: The operation failed.

  • Response example:

    {
        "traceId": "ccc2c13b-fd40-****-bc33-1d66c30ec828",
        "code": null,
        "message": null,
        "data": true,
        "success": true
    }
  • Java SDK example:

        private static void testAuthorize() throws SDKException {
            HttpRequest request = HttpRequest.build()
                .setUri("/openapi/v2/dataset/share/unAuthorize")
                .setMethod(HttpMethod.POST);
            request.addParameter("grantType", "false");
            request.addParameter("worksId", "a201c85c-*");
            request.addParameter("shareToUserIds", "f5698b***,6afccd9e434a***");
            String result = client.syncExecute(request);
            System.out.println(result);
        }

Create a dataset

  • Endpoint: POST /openapi/v2/dataset/create

  • Description: Creates a dataset from a specified data source and physical table.

  • Available since: standalone deployment v4.3.1.1

  • Request parameters: Parameters are passed in the request body as a JSON object.

    Important

    If a dataset for the same data source and physical table already exists in the same workspace, this operation returns the cubeId of the existing dataset.

    Parameter

    Type

    Description

    Required

    dsId

    string

    The ID of the data source.

    Yes

    tableName

    string

    The name of the physical table.

    Yes

    userDefineCubeName

    string

    The name of the dataset.

    The name can contain Chinese characters, English letters, digits, and the following special characters: underscores (_), forward slashes (/), backslashes (\), vertical bars (|), parentheses (()), square brackets ([]), hyphens (-), and plus signs (+). The name must not exceed 100 bytes.

    Yes

    workspaceId

    string

    The ID of the workspace.

    Yes

    userId

    string

    The Quick BI user ID. If the user is in the workspace but lacks permission to create datasets, the workspace owner creates the dataset. Otherwise, the specified user creates the dataset.

    Yes

    targetDirectoryId

    string

    The ID of the target directory. If this parameter is omitted, the dataset is created in the root directory.

    No

  • Request body example

    {
      "dsId":"23d33abf-****-****-b7d7-d962d7a5f6f1",
      "tableName":"test",
      "userDefineCubeName":"Test_Dataset",
      "workspaceId":"87f73904-****-****-b1ee-5a3a03a8eb45",
      "userId":"fec074144320****b1905061e6a951a2",
      "targetDirectoryId":"388b865a-2df7-****-93f0-cb2ced724d70"
    }
  • Response parameters (Note: When calling this API via an SDK, the response contains only the data field.)

    Parameter

    Type

    Description

    traceId

    string

    The request ID.

    code

    string

    The error code. Valid values:

    • 0: The call succeeded.

    • Error codes that start with AE or OE: The call failed.

    message

    string

    The response message. If the request succeeds, this parameter returns the cubeId of the dataset. Otherwise, it returns an error message.

    • success: The call succeeded.

    • Other information: The message returned when the call fails.

    success

    boolean

    Indicates whether the request succeeded. Valid values:

    • true: The request was successful.

    • false: The request failed.

    data

    boolean

    Indicates whether the operation succeeded. Valid values:

    • true: The operation was successful.

    • false: The operation failed.

  • Response example

    {
      "traceId":"235c9fa8-d6f5-****-a6d4-38f07b2319ce",
      "code":"0",
      "message":"f441dad7-6878-****-9ad1-84ff92c7d971",
      "success":true,
      "data":true
    }
  • Java SDK example

    public static void create() throws SDKException {
        HttpRequest request = HttpRequest.build()
            .setUri("/openapi/v2/dataset/create")
            .setMethod(HttpMethod.POST);
        request.addParameter("dsId","xxx");
        request.addParameter("tableName","xxx");
        request.addParameter("userDefineCubeName","xxx");
        request.addParameter("workspaceId","xxx");
        request.addParameter("userId","xxx");
        request.addParameter("targetDirectoryId","388b865a-2df7-4b39-93f0-cb2ced724d70");
        String result = openApiClient.syncExecute(request);
        System.out.println(result);
    }

Create a data source

  • Endpoint: /openapi/v2/datasource/add (POST)

  • Description: Creates a new data source.

  • Available since: private deployment 4.3.1.1

  • Request parameters

    Note

    If a data source with the same connection details already exists in the workspace, this operation returns the dsId of the existing data source.

    Parameter

    Type

    Required

    Description

    userId

    String

    Yes

    The user ID.

    workspaceId

    String

    Yes

    The workspace ID.

    showName

    String

    Yes

    The display name for the data source.

    The name can be up to 50 bytes long and can include letters, numbers, Chinese characters, and the following symbols: _, /, \, |, (), and [].

    address

    String

    Yes

    The connection address for the database, such as a domain name or IP address.

    port

    String

    No

    The port number.

    schema

    String

    No

    The database schema. This parameter is required only for databases that support schemas.

    For example, SQL Server uses dbo by default, while MySQL does not support schemas.

    dsType

    String

    Yes

    The type of the data source.

    username

    String

    No

    The database username or AccessKey ID.

    password

    String

    No

    The database password or AccessKey Secret.

    instance

    String

    Yes

    The name of the database instance.

    project

    String

    No

    The project name. This parameter is required only for MaxCompute (odps) data sources.

    config

    Json

    No

    Additional database configuration parameters, provided in JSON format.

    noSasl

    boolean

    No

    For Impala data sources, specifies whether to disable SASL authentication. true: SASL authentication is disabled. false: SASL authentication is enabled (default).

    encoded

    boolean

    No

    Specifies whether credentials, such as username and password, are sent in an encoded format.

    parentDsType

    String

    No

    The primary data source type for a multi-engine data source. This parameter is optional. If omitted, the data source is treated as a standard, single-engine source.

    Valid value:

    • dataphin

    userAsOwner

    boolean

    No

    If true, sets the user specified in userId as the data source owner. Defaults to false.

    Request body examples

    • AnalyticDB for MySQL

      {
        "showName":"AnalyticDB for MySQL 3.0",
        "address":"",
        "port": 3306,
        "dsType":"adb",
        "username":"xxx",
        "password":"xxx",
        "schema": null,
        "instance":"test",
        "workspaceId":"xxx",
        "userId":"xxx",
      }
    • MaxCompute

      {
        "showName":"maxcompute",
        "address":"http://service.xxx.xxx.com/api",
        "port": null,
        "dsType":"odps",
        "username":"LTAI****************", // Corresponds to AccessKey ID
        "password":"yourAccessKeySecret", // Corresponds to AccessKey Secret
        "schema": null,
        "instance": "your_project_name", // Corresponds to project
        "project": "your_project_name", // (New)
        "config": null,
        "workspaceId":"xxx",
        "userId":"xxx",
      }
    • Hive

      {
      		"showName": "test",  
          "address": "192.168.0.1",
          "port": "10000",
        	"dsType": "hive",
          "instance": "hive", // Corresponds to the database name
          "username": "xxx",
          "password": "xxx",
          "config": {
              "category": "local"
          }
      }
    • Gbase

      {
          "showName": "test",
          "address": "192.168.0.1",
          "port": "5258",
          "dsType": "gbase",
          "instance": "quickbi_test",
          "username": "root",
          "password": "root",
          "config": {
              "category": "local"
          },
          "workspaceId": "xxx",
          "userId": "xxx"
      }
    • rds-mysql

      {
        "showName":"mysql",
        "address":"",
        "port": 3306,
        "dsType":"mysql",
        "username":"xxx",
        "password":"xxx",
        "schema": null,
        "instance":"test",
        "workspaceId":"xxx",
        "userId":"xxx",
      }
    • Hologres

      {
          "showName": "Hologres_Data_Source",
          "address": "hgprecn-cn-******-cn-shanghai.hologres.aliyuncs.com",
          "instance": "quickbi_test",
          "schema": "public",
          "port": "80",
          "dsType": "hologres",
          "userId": "fec0741*****061e6a951a2",
          "config": {
              "initialSql": "Set timezone = '-10'"  // The initialSql parameter is supported in private deployment 4.4.x and later.
          },
          "workspaceId": "87f73904-****-****-b1ee-5a3a03a8eb45",
          "username": "LTAI****************", // Corresponds to AccessKey ID
          "password": "yourAccessKeySecret" // Corresponds to AccessKey Secret
      }
    • Impala (LDAP authentication)

      {
          "workspaceId": "87f73904-****-****-b1ee-5a3a03a8eb45",
          "userId": "fec0741*****061e6a951a2",
          "dsType":  "impala",
          "config":  {
              "category":  "local",
              "resource":  "ecs",
              "ssl":  false
          },
          "showName":  "impala-ldap",
          "address":  "xx.xx.xx.xx",
          "port":  "xxxx",
          "instance":  "default",
          "dsVersion":  "3.x",
          "username":  "xxxxx",
          "password":  "xxxxxxxxx",
          "instanceId":  "i-uf6fxxxxxbt3eh6lb",
          "noSasl":  true,
          "encoded":  true
      }
    • Dataphin (Connection method: Dataphin service data source; Engine type: odps)

      {
          "workspaceId": "87f73904-****-****-b1ee-5a3a03a8eb45",
          "userId": "fec0741*****061e6a951a2",
          "dsType":  "dataphin_odps",
          "address":  "f6c64214dc27400xxxxxx-cn-shanghai.alicloudapi.com",
          "username":  "20xxx18",
          "password":  "33paqqexxxxg07qzj28",
          "instance":  "test_ds",
          "showName":  "1_1_dataphin_odps",
          "config":  {
              "category":  "application",
              "engineType":  "odps"
          }
      }
    • Dataphin (Connection method: Dataphin service data source; Engine type: hive)

      {
          "workspaceId": "87f73904-****-****-b1ee-5a3a03a8eb45",
          "userId": "fec0741*****061e6a951a2",
          "dsType":  "dataphin_hive",
          "address":  "f6c64214dc27400xxxxxx-cn-shanghai.alicloudapi.com",
          "username":  "20xxx18",
          "password":  "33paqqexxxxg07qzj28",
          "instance":  "test_ds",
          "showName":  "1_1_dataphin_odps",
          "config":  {
              "category":  "application",
              "engineType":  "hive"
          }
      }
    • Dataphin (Connection method: JDBC connection; AccessKey type: Dataphin platform)

      {
          "workspaceId": "87f73904-****-****-b1ee-5a3a03a8eb45",
          "userId": "fec0741*****061e6a951a2",
          "dsType":  "odps",
          "config":  {
              "engineType":  "hive",
              "category":  "application",
              "dataphinConfig":  {
                  "tenantId":  "305xxx306",
                  "delegationUid":  "@dataphin",
                  "accountType":  "ACCOUNT_NAME",
                  "authMode":  "DELEGATION"
              },
              "resource": "clb",
              "initialSql": "Set timezone = '-10'"
          },
          "showName":  "DataPhin_JDBC_public",
          "connectType": "dataphin_v2",
          "address": "47.xxx.xxx.124",
          "port":  "80",
          "project": "bbb",
          "instance":  "fxxxk_test",
          "username":  "OIYtGZxxx7zmRpgQpB",
          "password":  "lDbQDnUuxxxxxGsxOd1",
          "parentDsType": "dataphin",
          "accessId": "[3eo[x>>",
          "accessKey": "bHipbB>>",
          "instanceId": "nnnn",
          "region": "cn-qingdao"
      }
    • Dataphin (Connection method: JDBC connection; AccessKey type: Personal user)

      {
          "workspaceId": "87f73904-****-****-b1ee-5a3a03a8eb45",
          "userId": "fec0741*****061e6a951a2",
          "dsType":  "dataphin_v2",
          "config":  {
              "engineType":  "hive",
              "category":  "application",
              "dataphinConfig":  {
                  "tenantId":  "30xxxx6",
                  "authMode":  "SIMPLE"
              },
              "resource": "clb",
              "initialSql": "Set timezone = '-10'"
          },
          "showName":  "Dataphin-jdbc-private",
          "connectType":  "dataphin_v2",
          "address":  "47.xxx.x4x.124",
          "port":  "80",
          "project": "bbb",
          "instance":  "fxxx_test",
          "username":  "kItowxxxxxxx2ZJr0",
          "password":  "kSlPkmS1xxxxxx61zd4SDX",
          "parentDsType": "dataphin",
          "accessId": "[3eo[x>>",
          "accessKey": "bHipbB>>",
          "instanceId": "nnnn",
          "region": "cn-qingdao"
      }
    • Dataphin (Connection method: JDBC connection; AccessKey type: Personal user; Engine type: AnalyticDB for PostgreSQL)

      {
          "workspaceId": "87f73904-****-****-b1ee-5a3a03a8eb45",
          "userId": "fec0741*****061e6a951a2",
          "dsType":  "greenplum",
          "config":  {
              "engineType":  "greenplum",
              "category":  "application",
              "dataphinConfig":  {
                  "tenantId":  "30xxxx6",
                  "authMode":  "SIMPLE"
              },
              "initialSql": "Set timezone = '-10'"
          },
          "showName":  "Dataphin-jdbc-private",
          "connectType":  "dataphin_v2",
          "address":  "47.xxx.x4x.124",
          "port":  "80",
          "project": "bbb",
          "instance":  "fxxx_test",
          "username":  "kItowxxxxxxx2ZJr0",
          "password":  "kSlPkmS1xxxxxx61zd4SDX",
          "parentDsType": "dataphin"
      }
  • Response example

    {
      "traceId":"235c9fa8-d6f5-****-a6d4-38f07b2319ce",
      "code":"0",
      "message":"f441dad7-6878-****-9ad1-84ff92c7d971",
      "success":true,
      "data":{
        "dsId":"xxx"
      }
    }
  • Java SDK example

    public static void add() throws SDKException {
        HttpRequest request = HttpRequest.build()
            .setUri("/openapi/v2/datasource/add")
            .setMethod(HttpMethod.POST);
        // request.addParameter("showName","xxx");
        // request.addParameter("dsType","xxx");
        // request.addParameter("dsCreateOriginType","xxx");
        // request.addParameter("username","xxx");
        // request.addParameter("password","xxx");
        // request.addParameter("instance","xxx");
        // request.addParameter("address","xxx");
        // request.addParameter("port","xxx");
        // request.addParameter("userId","xxx");
        // request.addParameter("workspaceId","xxx");
        // request.addParameter("parentDsType","xxx");
        // Manually construct array parameters.
        // JSONArray array = new JSONArray();
        // JSONObject jsonObject = new JSONObject();
        // jsonObject.put("xxx","xxx");
        // request.addParameter("config","xxx");
        // request.addParameter("schema","xxx");
        // request.addParameter("project","xxx");
        // request.addParameter("dsVersion","xxx");
        String result = openApiClient.syncExecute(request);
        System.out.println(result);

Update data source properties

  • API path: PUT /openapi/v2/datasource/properties

  • Description: Updates the basic properties of a data source.

  • Available since: standalone deployment 6.0.1

  • Request parameters: Submit a JSON object in the request body.

    Parameter

    Type

    Required

    Description

    dsId

    String

    Yes

    The ID of the data source.

    showName

    String

    No

    The display name of the data source.

    description

    String

    No

    The description of the data source.

    ownerId

    Integer

    No

    The Quick BI user ID of the data source owner.

  • Response parameters: (Note: When calling this API with an SDK, only the data object is returned.)

    Parameter

    Type

    Description

    traceId

    string

    The request ID.

    code

    string

    The error code. Valid values:

    • 0: The call was successful.

    • An error code starting with AE or OE: The call failed.

    message

    string

    The response message. Valid values:

    • success: The call was successful.

    • Other values: An error message if the call fails.

    success

    boolean

    Indicates whether the request was successful. Valid values:

    • true: The request was successful.

    • false: The request failed.

    data

    boolean

    Indicates whether the update was successful. Valid values:

    • true: The update was successful.

    • false: The update failed.

  • Response example:

    {
        "traceId": "626b80*********************4e5893f63",
        "code": "0",
        "message": "success",
        "data": true,
        "success": true
    }
  • Java SDK example:

    @Test
    public void updateProperties() throws Exception {
        HttpRequest request = HttpRequest.build()
                .setUri("/openapi/v2/datasource/properties")
                .setMethod(HttpMethod.PUT).setHttpContentType(FormatType.JSON)
                .addParameter("dsId","086344************d9a62236c")
                .addParameter("showName", "1")
                .addParameter("description", "WLB")
                .addParameter("ownerId", "10");
        String response = getOpenApiClient("test").syncExecute(request);
        System.out.println(response);
    }

Update data source

  • API path: PUT /openapi/v2/datasource/update

  • Description: Updates the basic information of a data source.

  • Available since: standalone deployment 4.3.1.1

  • Input parameters:

    Parameter

    Type

    Required

    Description

    dsId

    String

    Yes

    The ID of the data source.

    userId

    String

    No

    The ID of the Quick BI user performing the update. If you provide this ID, the API performs the update on behalf of this user.

    dsType

    String

    Yes

    The type of the data source.

    showName

    String

    No

    The display name for the data source.

    Can contain Chinese characters, English letters, digits, and the following special characters: underscores (_), forward slashes (/), backslashes (\), vertical bars (|), parentheses (), and square brackets []. The maximum length is 50 bytes.

    address

    String

    Yes

    The database endpoint, specified as a domain name or an IP address.

    port

    String

    No

    The port number.

    schema

    String

    No

    The database schema. This parameter is required only for schema-aware databases.

    Example: SQL Server uses dbo by default, while MySQL does not support schemas.

    instance

    The database instance.

    username

    String

    No

    The database username or AccessKey ID.

    password

    String

    Yes

    The database password or AccessKey Secret.

    noSasl

    boolean

    No

    For Impala data sources, specifies whether authentication is required. If omitted, the default is false.

    Valid values:

    true: Requires username and password authentication. false: Does not require authentication (default).

    config

    Json

    No

    Additional configuration for the data source.

    Important

    Note: The structure of the config object must match the one used for the specific data source type during creation. You only need to provide the fields you want to update. Provided fields are updated to the specified value, including an empty string. Omitted fields remain unchanged.

    Request body example

    {
        "schema": "schema",
        "password": "******",
        "showName": "Test_Update_DisplayName",
        "address": "118.xx.xx.xx",
        "instance": "quickbi_test",
        "dsId": "34d6d5ec-e5c4-****-b925-d0a3ca8ac267",
        "port": "3306",
        "dsType": "mysql",
        "username": "root",
        "config":  {
            "initialSql": "Set timezone = '-10'"
        }
    }
  • Response parameters (Note: When using an SDK, this call returns only the value of the data field.)

    Parameter

    Type

    Description

    traceId

    string

    The ID of the request.

    code

    string

    The error code.

    • 0: The call was successful.

    • An error code starting with AE or OE: The call failed.

    message

    string

    The response message.

    • success: Indicates that the call was successful.

    • Other values: An error message that describes the failure.

    success

    boolean

    Indicates whether the request was successful.

    • true: The request was successful.

    • false: The request failed.

    data

    boolean

    Indicates whether the update was successful.

    • true: The update was successful.

    • false: The update failed.

  • Response example:

    {
      "traceId":"235c9fa8-d6f5-****-a6d4-38f07b2319ce",
      "code":"0",
      "message":"f441dad7-6878-****-9ad1-84ff92c7d971",
      "success":true,
    	"data":true
    }
  • Java SDK example:

    public static void update() throws SDKException {
        HttpRequest request = HttpRequest.build()
            .setUri("/openapi/v2/datasource/update")
            .setMethod(HttpMethod.POST);
        request.addParameter("showName","xxx");
        request.addParameter("dsType","xxx");
        request.addParameter("dsCreateOriginType","xxx");
        request.addParameter("username","xxx");
        request.addParameter("password","xxx");
        request.addParameter("instance","xxx");
        request.addParameter("address","xxx");
        request.addParameter("port","xxx");
        request.addParameter("workspaceId","xxx");
        request.addParameter("schema","xxx");
        request.addParameter("project","xxx");
        request.addParameter("dsVersion","xxx");
        request.addParameter("userId","ssss342353453423");
        String result = openApiClient.syncExecute(request);
        System.out.println(result);
    }

Delete data source

  • API path: DELETE /openapi/v2/datasource/delete

  • Description: Deletes a data source. This operation supports force delete.

  • Available since: standalone deployment v4.3.1.1

  • Request parameters: (Content-Type: application/x-www-form-urlencoded; charset=UTF-8. Parameters are submitted as form data.)

    Parameter

    Type

    Required

    Description

    dsId

    String

    Yes

    The data source ID.

    forceDelete

    Boolean

    No

    Specifies whether to force delete the data source. The default value is false. If a data source has associated datasets, you must set this parameter to true to delete it; otherwise, the operation fails.

    Request body example

    {
        "dsId": "00119445-86bc-****-911c-a34e23587cca",
         "forceDelete": false,
    }
  • Response parameters (SDK calls return only the data field.)

    Parameter

    Type

    Description

    traceId

    string

    The request ID.

    code

    string

    The error code. Valid values:

    • 0: The request was successful.

    • Error codes that start with AE or OE: The request failed.

    message

    string

    The response message. Valid values:

    • success: The request was successful.

    • Other values: An error message is returned if the request fails.

    success

    boolean

    Indicates whether the request was successful. Valid values:

    • true: The request was successful.

    • false: The request failed.

    data

    boolean

    Indicates whether the operation was successful. Valid values:

    • true: The operation was successful.

    • false: The operation failed.

  • Response example:

    {
      "traceId":"235c9fa8-d6f5-****-a6d4-38f07b2319ce",
      "code":"0",
      "message":"f441dad7-6878-****-9ad1-84ff92c7d971",
      "success":true,
    	"data":true, // Indicates whether the deletion was successful.
    }
  • Java SDK example:

    public static void delete() throws SDKException {
        HttpRequest request = HttpRequest.build()
            .setUri("/openapi/v2/datasource/delete")
            .setMethod(HttpMethod.DELETE)
            .setHttpContentType(FormatType.FORM);
        request.addParameter("dsId","xxx");
        // Optional parameter
        // request.addParameter("forceDelete","xxx");
        String result = openApiClient.syncExecute(request);
        System.out.println(result);
    }

Batch clear dataset cache

  • Endpoint: POST /openapi/v2/dataset/batchCleanCache

  • Description: Clears the query result cache for one or more datasets in an organization. On success, the data field in the response is true.

  • Available since: standalone deployment v4.4.3

  • Request parameters:

    Parameter

    Type

    Description

    Required

    cubeIds

    String

    A comma-separated string of dataset IDs. The parameter is named cubeIds for historical reasons.

    Yes

  • Response parameters (SDK calls to this API return only the data field.):

    Parameter

    Type

    Description

    traceId

    string

    The request ID.

    code

    string

    The error code. Valid values:

    • 0: The call was successful.

    • Codes starting with AE or OE: The request failed.

    message

    string

    The error message. Valid values:

    • success: The call was successful.

    • Other values: An error message describing why the request failed.

    success

    boolean

    Indicates whether the request was successful. Valid values:

    • true: The request succeeded.

    • false: The request failed.

    data

    boolean

    Indicates whether the cache clearing operation was successful. Valid values:

    • true: The operation succeeded.

    • false: The operation failed.

  • Response example:

    {
        "traceId":"9bbd2088-6aeb-****-9ef3-082cc5a4f8f3",
        "code":null,
        "message":null,
        "data":true,
        "success":true
    }
  • Java SDK example:

    public static void batchCleanCache() throws SDKException {
        HttpRequest request = HttpRequest.build()
            .setUri("/openapi/v2/dataset/batchCleanCache")
            .setMethod(HttpMethod.POST)
            .setHttpContentType(FormatType.FORM);
        request.addParameter("cubeIds","xxx");
        String result = openApiClient.syncExecute(request);
        System.out.println(result);
    }

Accelerate dataset extraction

  • API path: POST /openapi/v2/dataset/task/quickindex/allot

  • API description: Accelerates data extraction for the specified dataset by using the Quick engine.

  • Available since: standalone deployment v4.5

  • Parameters: Parameters are submitted as form data with a content type of application/x-www-form-urlencoded;charset=UTF-8.

    Parameter

    Type

    Description

    Required

    cubeId

    String

    The dataset id.

    Yes

  • Response parameters: (Note: When using an SDK, only the data field is returned.):

    Parameter

    Type

    Description

    traceId

    string

    The request id.

    code

    string

    The error code. Valid values:

    • 0: The call was successful.

    • An error code starting with AE or OE: The call failed.

    message

    string

    The error message. Valid values:

    • success: The call was successful.

    • Other messages: An error message is returned if the call fails.

    success

    boolean

    Indicates whether the API call was successfully received and processed. Valid values:

    • true: The request was successful.

    • false: The request failed.

    data

    boolean

    Indicates whether the dataset acceleration was successfully triggered. Valid values:

    • true: The operation was successful.

    • false: The operation failed.

  • Response example:

    {
        "traceId":"9bbd2088-6aeb-****-9ef3-082cc5a4f8f3",
        "code":null,
        "message":null,
        "data":true,
        "success":true
    }
  • Java SDK example:

    public static void allotDatasetAccelerationTask() throws SDKException {
        HttpRequest request = HttpRequest.build()
            .setUri("/openapi/v2/dataset/task/quickindex/allot")
            .setMethod(HttpMethod.POST)
            .setHttpContentType(FormatType.FORM);
        request.addParameter("cubeId","xxx");
        String result = openApiClient.syncExecute(request);
        System.out.println(result);
    }

Query dataset performance

  • Endpoint: GET /openapi/v2/dataset/analytic/queryCubePerformance

  • Description: Retrieves performance metrics for one or more datasets.

  • Available since: standalone deployment v5.2

  • Request parameters:

    Parameter

    Type

    Description

    Required

    queryType

    String

    The query type.

    Yes

    workspaceId

    String

    The ID of the workspace.

    Yes

    cubeId

    String

    The ID of the dataset.

    No

    costTimeAvgMin

    String

    The minimum average query time.

    No

    pageSize

    Integer

    The page size.

    Yes

    pageNum

    Integer

    The page number.

    Yes

  • Response parameters (Note: SDK calls return only the data object.)

    Parameter

    Type

    Description

    traceId

    string

    The request ID.

    code

    string

    The error code. Valid values:

    • 0: The request succeeded.

    • Error codes starting with AE or OE: The request failed.

    message

    string

    The error message. Valid values:

    • success: The request succeeded.

    • Other values: An error message for a failed request.

    success

    boolean

    Indicates whether the request was successful. Valid values:

    • true: The request succeeded.

    • false: The request failed.

    data

    object [ ]

    A list of performance metrics for datasets.

    • cubeId

    string

    The ID of the dataset.

    • cubeName

    string

    The name of the dataset.

    • workspaceId

    string

    The ID of the workspace.

    • workspaceName

    string

    The name of the workspace.

    • queryTimeoutCount

    integer

    The number of timed-out chart queries.

    • repeatSqlQueryPercent

    string

    The percentage of repeated SQL queries.

    • repeatQueryPercentNum

    double

    The number of repeated queries.

    • repeatQueryPercent

    string

    The percentage of repeated queries.

    • quickIndexCostTimeAvg

    double

    The average query time for Quick Engine cache hits.

    • quickIndexQueryCount

    integer

    The number of Quick Engine cache hits.

    • cacheCostTimeAvg

    double

    The average query time for cache hits.

    • cacheQueryCount

    string

    The number of cache hits.

    • repeatSqlQueryCount

    string

    The number of repeated SQL queries.

    • costTimeAvg

    double

    The average query time.

    • queryCountAvg

    double

    The average number of queries.

    • queryCount

    string

    The total number of queries.

    • queryTimeoutCountPercent

    string

    The percentage of timed-out chart queries.

    • queryOverTenSecPercentNum

    string

    The number of queries that took longer than 10 seconds.

    • queryOverFivePercentNum

    string

    The number of queries that took longer than 5 seconds.

    • queryOverTenSecPercent

    string

    The percentage of queries that took longer than 10 seconds.

    • queryOverFiveSecPercent

    string

    The percentage of queries that took longer than 5 seconds.

  • Response example

    {
        "traceId": "b442c4c5-0f97-****-b397-0cf98b2febcd",
        "code": "0",
        "message": "success",
        "data": [
        {
          "CubeId": "7c7223ae-****-3c744528014b",
          "CubeName": "test",
          "QueryTimeoutCount": 1,
          "RepeatSqlQueryPercent": "1",
          "WorkspaceName": "Test workspace",
          "WorkspaceId": "87c6b145-090c-****-9426-8f93be23****",
          "RepeatQueryPercentNum": 1,
          "RepeatQueryPercent": "0.3",
          "QuickIndexCostTimeAvg": 1,
          "QuickIndexQueryCount": 1,
          "CacheCostTimeAvg": 1,
          "CacheQueryCount": 1,
          "RepeatSqlQueryCount": 1,
          "CostTimeAvg": 1,
          "QueryCountAvg": 1,
          "QueryCount": 50,
          "QueryTimeoutCountPercent": 1,
          "QueryOverTenSecPercentNum": 1,
          "QueryOverFivePercentNum": 1,
          "QueryOverTenSecPercent": "1.0",
          "QueryOverFiveSecPercent": "1.0"
        }
      ],
        "success": true,
        "httpCode": 200,
        "dynamicMessage": null
    }
  • Java SDK example

public static void queryReportPerformance() throws SDKException {
    HttpRequest request = HttpRequest.build()
        .setUri("/openapi/v2/dataset/analytic/queryCubePerformance")
        .setMethod(HttpMethod.GET);
    request.addParameter("queryType","xxx");
    request.addParameter("workspaceId","xxx");
    request.addParameter("cubeId","xxx");
    request.addParameter("costTimeAvgMin","xxx");
    request.addParameter("pageSize","10");
    request.addParameter("pageNum","1");
    String result = openApiClient.syncExecute(request);
    System.out.println(result);
}

List datasets by data source

  • API: GET /openapi/v2/dataset/dataSourceBlood

  • Description: Retrieves the IDs of datasets that reference a specified data source.

  • Available since: standalone deployment v5.1.2

  • Request parameters:

    Parameter

    Type

    Description

    Required

    dataSourceId

    string

    The ID of the data source.

    Yes

  • Response parameters (Note: SDK calls return only the data object.):

    Parameter

    Type

    Description

    traceId

    string

    The request ID.

    code

    string

    The error code. Valid values:

    • '0': The call was successful.

    • Exception codes starting with 'AE' or 'OE': The call failed.

    message

    string

    The error message. Valid values:

    • 'success': The call was successful.

    • Other values: The error message if the call fails.

    success

    boolean

    Specifies if the request succeeded. Valid values:

    • 'true': The request succeeded.

    • 'false': The request failed.

    data

    object

    The response payload.

    • datasetIds

    list<string>

    An array of dataset IDs.

  • Response example:

    {
        "traceId": "f09d9c36-4dc7-****-9ab4-f4dd10a80602",
        "code": "0",
        "message": "success",
        "data": [
                  "52d11adc-2512-****-b64c-42bdab357d80",
                  "4eed0ef6-4e3b-****-ac4d-bb9f8b685cd7",
                  "e74fdfe8-216e-****-90db-99b2828df70e",
                  "6939c0b2-9ce2-****-9530-cf764a553472"
                ],
        "success": true
    }
  • Java SDK example:

    @Test
    public void dataSourceBlood() throws SDKException {
        HttpRequest request = HttpRequest.build()
                .setUri("/openapi/v2/dataset/dataSourceBlood")
                .setMethod(HttpMethod.GET)
                .setHttpContentType(FormatType.FORM);
       request.addParameter("dataSourceId","485bf770-3edd-4af1-b79d-11d8dcf83119");
       String result = getOpenApiClient("daliy").syncExecute(request);
       System.out.println(result);
    }

Query works by dataset

  • Endpoint: GET /openapi/v2/dataset/dataSetBlood

  • Description: Retrieves a list of works, such as dashboards and spreadsheets, that use a specified dataset.

  • Available since: standalone deployment v5.1.2

  • Request parameters:

    Parameter

    Type

    Description

    Required

    dataSetIds

    string

    A comma-separated list of dataset IDs.

    Yes

    userId

    string

    The user ID of the work's owner.

    No

    worksType

    string

    Specifies the type of work. Valid values:

    • REPORT: spreadsheet

    • dashboardOfflineQuery: ad-hoc query

    • DASHBOARD: dashboard

    • ANALYSIS: ad-hoc analysis

    • SCREEN: data screen

    • PAGE: legacy dashboard

    No

  • Response parameters (Note: When using the SDK, the call returns only the data field.)

    Parameter

    Type

    Description

    traceId

    string

    The request ID.

    code

    string

    The error code. Valid values:

    • 0: The call was successful.

    • Error codes starting with AE or OE: The call failed.

    message

    string

    The error message. Valid values:

    • success: The call was successful.

    • Other values: An error message is returned if the call fails.

    success

    boolean

    Indicates if the request was successful. Valid values:

    • true: The request was successful.

    • false: The request failed.

    data

    object[]

    A list of objects, where each object represents a work that uses the specified dataset(s).

    • worksType

    string

    The type of the work. Valid values:

    • REPORT: spreadsheet

    • dashboardOfflineQuery: ad-hoc query

    • DASHBOARD: dashboard

    • ANALYSIS: ad-hoc analysis

    • SCREEN: data screen

    • PAGE: legacy dashboard

    • worksId

    string

    The ID of the work.

  • Response example:

    {
        "traceId": "f09d9c36-4dc7-****-9ab4-f4dd10a80602",
        "code": "0",
        "message": "success",
        "data": [
            {
                "worksType": "DASHBOARD",
                "worksId": "52d11adc-2512-****-b64c-42bdab357d80"
            },
            {
                "worksType": "REPORT",
                "worksId": "4eed0ef6-4e3b-****-ac4d-bb9f8b685cd7"
            }
        ],
        "success": true
    }
  • JAVA SDK example:

    @Test
    public void dataSourceBlood() throws SDKException {
        HttpRequest request = HttpRequest.build()
                .setUri("/openapi/v2/dataset/dataSetBlood")
                .setMethod(HttpMethod.GET)
                .setHttpContentType(FormatType.FORM);
       request.addParameter("dataSetIds","485bf770-3edd-4af1-b79d-11d8dcf83119");
       String result = getOpenApiClient("daliy").syncExecute(request);
       System.out.println(result);
    }

List data sources in a workspace

  • API: GET /openapi/v2/datasource/list

  • Description: Retrieves basic information for all data sources in a specified workspace.

    Note

    This API excludes data sources created from tags, data sources in exploration spaces, and API data sources.

  • Available since: standalone deployment v5.3.1

  • Request parameters

    Parameter

    Type

    Description

    Required

    workspaceId

    string

    The ID of the workspace.

    Yes

    dsType

    string

    The type of the data source.

    No

Data source type codes:

garuda            --   Garuda data source
adb               --   AnalyticDB for MySQL
oracle            --   Oracle data source
mysql             --   MySQL data source
mysql_hybrid      --   HybridDB for MySQL data source
odps              --   MaxCompute data source
sqlserver         --   SQL Server data source
greenplum         --   Greenplum data source
postgresql        --   PostgreSQL data source
ppas              --   RDS PPAS data source
oscar             --   Oscar data source
hive              --   Hive data source
vertica           --   Vertica data source
db2               --   IBM DB2 data source (LUW)
sybase            --   SAP SYBASE IQ data source
hana              --   SAP HANA data source
dla               --   Data Lake Analytics data source
oss               --   OSS data source
drds              --   DRDS data source
clivia            --   super-engine data source
presto            --   Presto data source
polardb           --   PolarDB data source
tsdb              --   TSDB data source
lindorm_tsdb      --   Lindorm TSDB data source
lindorm_wide_table_engine  --   Lindorm wide table engine data source
lindorm_multi_mode  --   Lindorm multi-mode SQL data source
hbase             --   HBase data source
phoenix_thin      --   PHOENIX THIN data source
dataphin          --   DataPhin data source (multi-engine)
dataphin_odps     --   DataPhin data source (MaxCompute engine)
dataphin_hive     --   DataPhin data source (Hive engine)
dataphin_v2_odps  --   New DataPhin data source (MaxCompute engine)
dataphin_v2_hive  --   New DataPhin data source (Hive engine)
kbase             --   KingBase data source
clickhouse        --   ClickHouse data source
tdsql             --   TDSQL-H data source
gbase             --   Gbase data source
polardb_pg        --   PolarDB for PostgreSQL data source
hologres          --   Hologres data source
impala            --   Impala data source
impala_v3         --   Impala 3.x data source
dingtalk          --   DingTalk intelligent report data source
snowflake         --   Snowflake data source
kylin             --   Kylin data source
multiDatasource   --   cross-source data source
oceanbase_mysql   --   OceanBase data source (MySQL mode)
oceanbase_oracle  --   OceanBase data source (Oracle mode)
spark_sql         --   Spark SQL data source
starrocks         --   StarRocks data source
apache_doris      --   Apache Doris data source
selectdb          --   SelectDB data source
mongodb           --   MongoDB data source
dm                --   DM data source (DAMENG)
unicorn           --   Unicorn data source
sls               --   SLS data source
gaussdb_dws       --   GaussDB_DWS data source
gaussdb           --   GaussDB data source
elasticsearch     --   Elasticsearch data source
dms               --   DMS logical data warehouse
yida              --   Yida application data source
relyt             --   Relyt data source
feishu_bitable    --   Feishu Bitable data source
feishu_spreadsheet  --   Feishu Spreadsheet data source
tidb              --   TiDB data source
mariadb           --   MariaDB data source
adb_spark         --   AnalyticDB for MySQL data source (Spark engine)
  • Response parameters (Note: An SDK call to this API returns only the data object.)

    Parameter

    Type

    Description

    traceId

    string

    The request ID.

    code

    string

    The error code. Valid values:

    • 0: The request was successful.

    • Error codes that start with AE or OE: The request failed.

    message

    string

    The error message. Valid values:

    • success: The request was successful.

    • Other values: An error message is returned if the request fails.

    success

    boolean

    Indicates whether the request was successful. Valid values:

    • true: The request was successful.

    • false: The request failed.

    data

    object[]

    A list of data source metadata.

    • showName

    string

    The display name of the data source.

    • datasourceId

    string

    The ID of the data source.

    • dsType

    string

    The type of the data source.

    • parentDsType

    string

    The primary data source type for a multi-engine data source. This field is only returned for some data sources.

    • gmtCreate

    string

    The time the data source was created, in YYYY-MM-DD HH:mm:ss format.

    • creatorId

    string

    The Quick BI user ID of the creator.

    • creatorName

    string

    The nickname of the creator.

    • gmtModified

    string

    The time the data source was last modified.

  • Response example

    {
        "traceId": "f09d9c3*********************f4dd10a80602",
        "code": "0",
        "message": "success",
        "data": [
            {
                "gmtModified": "2024-09-18 10:00:24",
                "showName": "mysql",
                "datasourceId": "183d4*********************cb7096f",
                "dsType": "mysql",
                "creatorId": "2dc8aa2*********************e2252276f9",
                "creatorName": "sss",
                "gmtCreate": "2024-09-18 10:00:24"
            }
        ],
        "success": true
    }
  • Java SDK example

    @Test
    public void listDataSource() throws SDKException {
        HttpRequest request = HttpRequest.build()
                 .setUri("/openapi/v2/datasource/list")
                 .setMethod(HttpMethod.GET);
        request.addParameter("workspaceId","81818-xxxxx-xxx-xx-2323");
        String result = getOpenApiClient("test").syncExecute(request);
        System.out.println(result);
    }

Get data source configuration

  • Endpoint: GET /openapi/v2/datasource/{dsId}

  • Description: Retrieves the configuration of a data source.

  • Available since: standalone deployment v5.3.1

  • Request parameters:

Parameter

Type

Description

Required

dsId

String

The ID of the data source.

Yes

Data source type codes:

garuda            --   Garuda data source
adb               --   AnalyticDB (ADB) 3.0 data source
oracle            --   Oracle data source
mysql             --   MySQL data source
mysql_hybrid      --   HybridDB for MySQL data source
odps              --   MaxCompute data source
sqlserver         --   SQL Server data source
greenplum         --   Greenplum data source
postgresql        --   PostgreSQL data source
ppas              --   RDS PPAS data source
oscar             --   Oscar data source
hive              --   Hive data source
vertica           --   Vertica data source
db2               --   IBM DB2 data source (LUW)
sybase            --   SAP SYBASE IQ data source
hana              --   SAP HANA data source
dla               --   Data Lake Analytics data source
oss               --   OSS (Object Storage Service) data source
drds              --   DRDS (Distributed Relational Database Service) data source
clivia            --   super-engine
presto            --   Presto data source
polardb           --   PolarDB data source
tsdb              --   TSDB data source
lindorm_tsdb      --   LindormTSDB data source
lindorm_wide_table_engine  --   Lindorm Wide Table Engine data source
lindorm_multi_mode  --   Lindorm Multi-mode SQL data source
hbase             --   HBase data source
phoenix_thin      --   Phoenix Thin data source
dataphin          --   DataPhin multi-engine data source
dataphin_odps     --   DataPhin data source (MaxCompute engine)
dataphin_hive     --   DataPhin data source (Hive engine)
dataphin_v2_odps  --   New DataPhin data source (MaxCompute engine)
dataphin_v2_hive  --   New DataPhin data source (Hive engine)
kbase             --   KingBase data source
clickhouse        --   ClickHouse data source
tdsql             --   TDSQL-H data source
gbase             --   Gbase data source
polardb_pg        --   PolarDB for PostgreSQL data source
hologres          --   Hologres data source
impala            --   Impala data source
impala_v3         --   Impala 3.x data source
dingtalk          --   DingTalk intelligent report data source
snowflake         --   Snowflake data source
kylin             --   Kylin data source
multiDatasource   --   cross-source
oceanbase_mysql   --   OceanBase data source (MySQL mode)
oceanbase_oracle  --   OceanBase data source (Oracle mode)
spark_sql         --   Spark SQL data source
starrocks         --   StarRocks data source
apache_doris      --   Apache Doris data source
selectdb          --   SelectDB data source
mongodb           --   MongoDB data source
dm                --   DM7 data source (Dameng)
unicorn           --   Unicorn data source
sls               --   Log Service (SLS) data source
gaussdb_dws       --   GaussDB DWS data source
gaussdb           --   GaussDB data source
elasticsearch     --   Elasticsearch data source
dms               --   DMS (Data Management) logical data warehouse
yida              --   Yida application data source
relyt             --   Relyt data source
feishu_bitable    --   Feishu Bitable data source
feishu_spreadsheet  --   Feishu Spreadsheet data source
tidb              --   TiDB data source
mariadb           --   MariaDB data source
adb_spark         --   AnalyticDB (ADB) data source (Spark engine)
  • Response parameters (Note: When you call this API by using an SDK, only the data object is returned.)

    Parameter

    Type

    Description

    traceId

    string

    The request ID.

    code

    string

    The error code. Valid values:

    • 0: The call was successful.

    • Error codes starting with AE or OE: The call failed.

    message

    string

    The response message. Valid values:

    • success: The call was successful.

    • Other values: An error message for a failed call.

    success

    boolean

    Indicates whether the request was successful. Valid values:

    • true: The request was successful.

    • false: The request failed.

    data

    object

    The configuration of the data source.

    • dsId

    string

    The ID of the data source.

    • creatorId

    string

    The Quick BI user ID of the creator.

    • modifyUser

    string

    The Quick BI user ID of the user who last modified the data source.

    • workspaceId

    String

    The ID of the workspace to which the data source belongs.

    • address

    String

    The database connection address, which can be a domain name or an IP address.

    • port

    String

    The port number.

    • dsType

    String

    The type of the data source. For a list of type codes, see the Data source type codes section above.

    • schema

    String

    The database schema. This parameter is required only for databases that support schemas.

    • instance

    String

    The database instance, which corresponds to the database name. For MaxCompute data sources, this parameter specifies the project.

    • project

    String

    For MaxCompute data sources, this parameter is used for display purposes when retrieving connection details.

    • showName

    String

    The display name of the data source.

    • authLevel

    Integer

    The permission level. Valid values:

    • 0: Private

    • 1: Collaborative Edit (Legacy)

    • 11: Collaborative Edit - Workspace Members

    • 12: Collaborative Edit - Specific Users

    • instanceId

    String

    The ID of the instance.

    • dsVersion

    String

    The version of the data source.

    • noSasl

    boolean

    For Impala data sources, this parameter specifies whether to disable SASL authentication. true disables authentication; false (default) enables it.

    • parentDsType

    String

    For multi-engine data sources, this parameter specifies the primary data source type.

    • config

    object

    Additional configuration for the data source.

  • Response example

    {
        "traceId": "626b80*********************4e5893f63",
        "code": "0",
        "message": "success",
        "data": {
            "dsId": "85be*********************61440", // The ID of the data source
            "creatorId": "74f55*********************aaaaaaaaa", // The ID of the creator
            "modifyUser": null, // The ID of the user who last modified the data source
            "workspaceId": "8b8e0e5*********************aaaaaaa6666", // The ID of the workspace
            "address": "example.aliyuncs.com", // The address of the data source
            "port": "3306", // The port of the database
            "dsType": "mysql", // The type of the data source
            "userName": "test_username", // The username for the database connection
            "schema": null, // The schema
            "instance": "test", // The database
            "project": null,
            "showName": "mysql_copy", // The name of the data source
            "config": {
                "resource": null, 
                "category": "cloud", // The data source category, for example, "cloud"
                "netType": null,
                "vpcId": null, // The ID of the VPC (Virtual Private Cloud)
                "vpcIp": null,// The IP address of the VPC data source
                "vpcPort": null,// The port of the VPC data source
                "onEcsMappingIp": null,// The mapped IP address for the ECS instance
                "onEcsMappingPort": null,// The mapped port for the ECS instance
                "instanceIp": null,// The IP address of the instance
                "engine": null,// The engine
                "instanceId": null,// The ID of the instance
                "region": null,// The region
                "endPointDomain": null,// The endpoint domain
                "ssl": null,
                "verifyServerCertificate": null,// Indicates whether to verify the server certificate
                "requireSSL": null,// Indicates whether an SSL connection is required
                "ssh": null,
                "hostConfig": {
                    "hostAddress": "example.aliyuncs.com",// The hostname
                    "hostPort": "3306"// The host port
                },
                "kerberosEnable": null,// Indicates whether Kerberos authentication is enabled
                "hiveConnectionType": null,// The Hive connection type
                "hiveMetastoreUri": null,// The Hive metastore URI
                "engineType": null,// The engine type
                "envType": "public_cloud",// The environment type
                "characterEncoding": null,// The character encoding
                "mcqa": null,// MaxCompute MCQA
                "fallbackQuota": null,
                "initialSql": null,// The initial SQL
                "sparkDetect": "true",// Indicates if Spark detection is enabled
                "timeZone": null// The time zone
            },
            "authLevel": null,
            "accessId": null,
            "accessKey": null,
            "instanceId": null,
            "region": null,
            "loginTicket": null,
            "dsVersion": null, // The data source version
            "dsCreateOrigin": null,
            "noSasl": false, // Whether to disable SASL authentication
            "belongType": 0,
            "organizationId": null
        },
        "success": true,
        "httpCode": 200,
        "dynamicMessage": null
    }
  • Java SDK example

    public static void getDataSource() throws SDKException {
        HttpRequest request = HttpRequest.build()
                .setUri("/openapi/v2/datasource/{dsId}")
                .setMethod(HttpMethod.GET);
        request.addParameter("dsId","xxx");
        String result = openApiClient.syncExecute(request);
        System.out.println(result);
    }

Query latest acceleration job by cubeId

  • API: GET /openapi/v2/dataset/query/accelerationJob

  • Description: Retrieves information about the latest acceleration job for a specified dataset.

  • Available since: standalone deployment v6.0

  • Input parameters:

    Parameter

    Type

    Description

    Required

    cubeId

    String

    The dataset ID.

    Yes

  • Return parameters: (Note: SDK calls return only the data object.)

    Parameter

    Type

    Description

    traceId

    string

    The request ID.

    code

    string

    The error code. Possible values:

    • 0: The request was successful.

    • Error codes starting with AE or OE: The request failed.

    message

    string

    The error message. Possible values:

    • success: The request was successful.

    • Other values: A message that describes the error.

    success

    boolean

    Indicates whether the request was successful. Possible values:

    • true: The request was successful.

    • false: The request failed.

    data

    object

    The acceleration job model.

    • jobHistoryId

    string

    The acceleration job ID.

    • status

    string

    The job status. Possible values:

    • TODO: Pending

    • RUNNING: Running

    • SUCCESS: Success

    • FAILURE: Failure

    • CANCELED: Canceled

    • CHECK_DEPENDENCY: Checking Dependencies

    • gmtCreate

    date

    The time the job was created, in YYYY-MM-DD hh:mm:ss format.

    • gmtModified

    date

    The time the job finished, in YYYY-MM-DD hh:mm:ss format.

  • Response example:

    {
        "traceId": "626b80*********************4e5893f63",
        "code": "0",
        "message": "success",
        "data": {
                "jobHistoryId": "720623d7-b81b-42c3-a983-3606058a463a",
                "gmtModified": "2025-06-18 17:07:43",
                "gmtCreate": "2025-06-18 17:07:26",
                "status": "SUCCESS"
            },
        "success": true,
    }
  • Java SDK example:

     @Test
    public void queryLastAccelerationEngineJob() throws Exception {
        HttpRequest request = HttpRequest.build()
                .setUri("/openapi/v2/dataset/query/accelerationJob")
                .setMethod(HttpMethod.GET)
                .addParameter("cubeId","a1e7e9***********1d1a4a2a");
        String response = getOpenApiClient("test").syncExecute(request);
        System.out.println(response);
    }

Check dataset existence by cubeId

  • API: GET /openapi/v2/dataset/existed

  • Description: Checks if a dataset exists based on its cubeId.

  • Availability: Available to all users since standalone deployment version 6.0.

  • Request parameters:

    Parameter

    Type

    Required

    Description

    cubeId

    String

    Yes

    The ID of the dataset.

  • Response parameters (Note: The SDK returns only the value of the data field.):

    Parameter

    Type

    Description

    traceId

    string

    The request ID.

    code

    string

    The error code. Valid values:

    • 0: The call was successful.

    • Error codes starting with AE or OE: The call failed.

    message

    string

    The error message. Valid values:

    • success: The call was successful.

    • Other values: The error message for a failed call.

    success

    boolean

    Indicates whether the request was successful. Valid values:

    • true: The request was successful.

    • false: The request failed.

    data

    boolean

    Indicates whether the dataset exists.

    • true: The dataset exists.

    • false: The dataset does not exist.

  • Response example:

    {
      "traceId":"235c9*********8f07b2319ce",
      "code":"0",
      "message":"success",
      "success":true,
      "data":true
    }
  • Java SDK example:

    public static void existedDataset() throws SDKException {
        HttpRequest request = HttpRequest.build()
            .setUri("/openapi/v2/dataset/existed")
            .setMethod(HttpMethod.GET);
         request.addParameter("cubeId","xxx");
      
        String result = openApiClient.syncExecute(request);
        System.out.println(result);
    }

Create a dataset from a custom SQL query

  • API path: POST /openapi/v2/dataset/createBySql

  • Description: Creates a dataset from a custom SQL query.

  • Available since: standalone deployment 6.0

  • Request parameters: (Content-Type: application/json)

    Parameter

    Type

    Description

    Required

    dsId

    String

    The ID of the data source.

    Yes

    workspaceId

    String

    The ID of the workspace.

    Yes

    userId

    String

    The ID of the currently logged-in user.

    Yes

    customSql

    String

    The custom SQL statement.

    Yes

    caption

    String

    The name of the custom SQL table.

    Yes

    placeholders

    List<PlaceholderModel>

    A list of placeholders. This parameter is required if the custom SQL contains placeholders.

    No

    • PlaceholderModel structure

      Parameter

      Type

      Description

      Required

      Notes

      uniqueId

      String

      The unique ID of the placeholder.

      No

      Used for updates. The system ignores this parameter during creation.

      name

      String

      The name of the placeholder.

      Yes

      Must be unique.

      style

      String

      Expression placeholder: param

      Value placeholder: placeholder

      Conditional placeholder: condition

      Yes

      You must specify one of the three supported types.

      type

      String

      The variable type of the placeholder.

      Text: string

      Number: number

      Date: See the tables below.

      Yes

      For rules on setting the type and format parameters for different placeholder styles, see the tables below.

      useInGlobal

      Boolean

      Specifies whether the placeholder has a global scope.

      true: Yes

      false: No

      No

      The default value is false if omitted.

      defaultValue

      List<String>

      The default value.

      No

      For date range placeholders, you can specify either 0 or 2 default values.

      For all other placeholder types, you can specify either 0 or 1 default value.

      format

      String

      The format for date types. See the tables below for details.

      No

      For rules on setting the type and format parameters for different placeholder styles, see the tables below.

      originalType

      String

      Specifies the type for special cases, such as date ranges.

      No

      Set this to dateRange if the value placeholder is a date range type. For all other cases, this parameter is not required.

      conditionPlaceHolderFields

      List<ConditionPlaceHolderFields>

      The fields for a conditional placeholder.

      No

      This parameter is required only for conditional placeholders.

    • ConditionPlaceHolderFields structure

      Parameter

      Type

      Description

      Required

      Notes

      uniqueId

      String

      The unique ID of the conditional placeholder field.

      No

      Not required for creation. The system generates it automatically.

      column

      String

      The column name.

      Yes

    • Mapping of style, type, and format for expression placeholders

      Variable type

      type

      format

      Text

      string

      Number

      number

      Date - Year

      yearRegion

      Date - Year-Quarter

      quarterRegion

      Date - Year-Month

      monthRegion

      Date - Year-Week

      weekRegion

      Date - Year-Month-Day

      dateRegion

      Date - Year-Month-Day Hour:Minute:Second

      ymdHmsRegion

    • Mapping of style, type, and format for value placeholders

      Variable type

      type

      format

      Notes

      Text

      string

      Not supported for date range placeholders.

      Number

      number

      Not supported for date range placeholders.

      Date - Year

      yearRegion

      Date - Year-Quarter

      quarterRegion

      Date - Year-Month

      monthRegion

      YYYY-MM

      YYYYMM

      YYYY/MM

      Choose one of the three formats.

      Date - Year-Week

      weekRegion

      Date - Year-Month-Day

      dateRegion

      YYYY-MM-DD

      YYYYMMDD

      YYYY/MM/DD

      Choose one of the three formats.

      Date - Year-Month-Day Hour:Minute:Second

      ymdHmsRegion

      YYYY-MM-DD HH:MI:SS

      YYYYMMDD HH:MI:SS

      YYYY/MM/DD HH:MI:SS

      YYYYMMDDHHMISS

      Choose one of the four formats.

    • Mapping of style, type, and format for conditional placeholders

      Variable type

      type

      format

      Notes

      Text

      string

  • Response parameters (Note: When using the SDK, this API call returns only the value of the data field.)

    Parameter

    Type

    Description

    traceId

    string

    The request ID.

    code

    string

    The error code. Valid values:

    • 0: The call was successful.

    • Error codes that start with AE or OE: The call failed.

    message

    string

    The error message. Valid values:

    • success: The call was successful.

    • Other values: An error message describing the failure.

    success

    boolean

    Indicates whether the request was successful. Valid values:

    • true: The request was successful.

    • false: The request failed.

    data

    string

    The ID of the dataset.

  • Response example:

    {
        "traceId":"5afa********************97dbea",
        "code":null,
        "message":null,
        "success":true,
        "data":"dafaew3**********gf54w"
    }
  • Java SDK example:

    @Test
    public void sql() throws SDKException {
        HttpRequest request = HttpRequest.build()
                .setUri("/openapi/v2/dataset/createBySql")
                .setMethod(HttpMethod.POST);
        request.addParameter("userId", "74f5527****ebf278c8");
        request.addParameter("customSql", "SELECT  * FROM `0012` where '$VAL{WKB}' = '1'");
        request.addParameter("caption", "sssss");
        request.addParameter("dsId", "601a****e663bac8507");
        request.addParameter("workspaceId", "08634****9a62236c");
        List<Map<Object,Object>> placeholders =new ArrayList<>();
        Map<Object,Object> placeholder =new HashMap<>();
        placeholder.put("uniqueId","test");
        placeholder.put("name","WKB");
        placeholder.put("style","placeholder");
        placeholder.put("type","string");
        placeholder.put("useInGlobal","true");
        placeholder.put("defaultValue",null);
        placeholders.add(placeholder);
        request.addParameter("placeholders", placeholders);
        String result = getOpenApiClient("test").syncExecute(request);
        System.out.println(result);
    }

Update custom SQL dataset

  • API: POST /openapi/v2/dataset/updateBySql

  • Description: Updates a custom SQL dataset.

  • Available since: standalone deployment 6.0

  • Request parameters: (Content-Type: application/json. The request body must be in JSON format.)

    Parameter

    Type

    Description

    Required

    cubeId

    string

    The ID of the dataset to update.

    Yes

    customSql

    string

    The new custom SQL statement.

    Yes

    workspaceId

    string

    The ID of the workspace.

    Yes

    userId

    string

    The ID of the user. This ID is used for permission verification.

    Yes

    dsId

    string

    The ID of the data source referenced by the dataset.

    Yes

    placeholders

    List<PlaceholderModel>

    A collection of placeholders. This parameter is required if the custom SQL contains placeholders. For parameter details, see "Create a dataset from a custom SQL".

    No

  • Response parameters (Note: The SDK returns only the data field.)

    Parameter

    Type

    Description

    traceId

    string

    The request ID.

    code

    string

    The error code. Possible values:

    • 0: The request was successful.

    • An error code starting with AE or OE: The request failed.

    message

    string

    The response message. Possible values:

    • success: The request was successful.

    • Other values: An error message.

    success

    boolean

    Indicates whether the request was successful. Possible values:

    • true: The request was successful.

    • false: The request failed.

    data

    boolean

    The result of the API operation. Possible values:

    • true: The operation was successful.

    • false: The operation failed.

  • Response example:

    {
        "traceId":"308d*************bec3",
        "code":null,
        "message":null,
        "data": true,
        "httpCode": 200,
        "success":true
    }
  • Java SDK example:

    private static void updateDataset() throws SDKException {
        HttpRequest request = HttpRequest.build()
                .setUri("/openapi/v2/dataset/updateBySql")
                .setMethod(HttpMethod.POST);
        request.addParameter("cubeId", "XXX");
        request.addParameter("customSql", "XXX,XXX");
        request.addParameter("workspaceId", "XXX,XXX");
        request.addParameter("userId", "XXX,XXX");
        request.addParameter("dsId", "XXX,XXX");
        String result = openApiClient.syncExecute(request);
        System.out.println(result);
    }

Get acceleration job runtime logs

  • API: GET /openapi/v2/dataset/query/accelerationLog

  • Description: Gets the runtime logs of acceleration jobs for a specified dataset.

  • Available since: standalone deployment v6.0.1

  • Input parameters:

    Parameter

    Type

    Description

    Required

    cubeId

    String

    The dataset ID.

    Yes

    startDate

    String

    The start time for the query. Format: yyyy-MM-dd HH:mm:ss.

    Yes

    endDate

    String

    The end time for the query. Format: yyyy-MM-dd HH:mm:ss.

    Yes

    pageNo

    Integer

    The page number. Default: 1.

    No

    pageSize

    Integer

    The page size. Default: 10.

    No

  • Response parameters (Note: SDK calls return only the contents of the data object):

    Parameter

    Type

    Description

    traceId

    string

    The request ID.

    code

    string

    The error code:

    • 0: Indicates success.

    • An error code starting with AE or OE indicates failure.

    message

    string

    The error message:

    • success: Returned for successful requests.

    • Other messages: Provides a message detailing the failure.

    success

    boolean

    Indicates whether the request was successful. Possible values:

    • true: The request was successful.

    • false: The request failed.

    data

    object

    Contains the acceleration job runtime logs.

    • next

    Integer

    The next page number. A value of null or 0 indicates no more pages.

    • pre

    Integer

    The previous page number. A value of null or 0 indicates no previous page.

    • totalNum

    Integer

    The total number of records.

    • totalPages

    Integer

    The total number of pages.

    • pageNum

    Integer

    The current page number.

    • pageSize

    Integer

    The number of records on the current page.

    • data

    object[]

    An array of acceleration job runtime logs.

    • jobId

    String

    The acceleration job ID.

    • jobHistoryId

    String

    The job history ID.

    • jobStartDate

    String

    The job start time.

    • jobStatus

    Integer

    The job status:

    • 0: Pending

    • 1: Running

    • 2: Succeeded

    • 3: Failed

    • 4: Canceled

    • 5: Warning

    • duration

    String

    The job duration, in seconds.

    • log

    String

    The log content.

  • Response example:

    {
        "traceId": "626b80*********************4e5893f63",
        "code": "0",
        "message": "success",
        "data": {
                  "next": null,
                  "pre": null,
                  "data":
                  [
                      {
                          "duration": "16",
                          "jobId": "CUBE_OF*****b74-5d9b298c2ca5",
                          "jobStartDate": "2025/09/10 13:59:19",
                          "jobHistoryId": "010ab44******b16cf45a4",
                          "jobStatus": 2,
                          "log": "2025*******cess."
                      }
                  ],
                  "totalNum": 1,
                  "totalPages": 1,
                  "start": 0,
                  "pageSize": 10,
                  "orderBy": null,
                  "pageNum": 1,
                  "orderString": null
              },
        "success": true
    }
  • Java SDK example:

     @Test
    public void accelerationLog() throws Exception {
        HttpRequest request = HttpRequest.build()
                .setUri("/openapi/v2/dataset/query/accelerationLog")
                .setMethod(HttpMethod.GET).setHttpContentType(FormatType.FORM)
                .addParameter("cubeId","c47b********b298c2ca5")
                .addParameter("startDate","2025-09-09 10:00:00")
                .addParameter("endDate","2025-09-11 23:00:00")
    //                .addParameter("pageNo", "1")
    //                .addParameter("pageSize", "10")
                ;
        String response = getOpenApiClient("test").syncExecute(request);
        System.out.println(response);
    }

List acceleration jobs in a workspace

  • Endpoint: GET /openapi/v2/dataset/analytic/list

  • Description: Lists the acceleration engine jobs in a specified workspace.

  • Available since: standalone deployment v6.0.1

  • Input parameters:

    Parameter

    Type

    Description

    Required

    workspaceId

    String

    The ID of the workspace.

    Yes

    creatorId

    String

    The user ID of the creator.

    No

    cubeName

    String

    The name of the dataset.

    No

    pageNo

    Integer

    The page number. The default value is 1.

    No

    pageSize

    Integer

    The number of entries per page. The default value is 10.

    No

  • Response parameters (Note: When you call this API with an SDK, the SDK returns only the data object.)

    Parameters

    Type

    Description

    traceId

    string

    The request ID.

    code

    string

    The error code. Valid values:

    • 0: The call was successful.

    • Error codes that start with AE or OE: The call failed.

    message

    string

    The error message. Valid values:

    • success: The call succeeded.

    • Other values: An error message if the call fails.

    success

    boolean

    Indicates whether the request was successful. Valid values:

    • true: The request succeeded.

    • false: The request failed.

    data

    object

    An object that contains the acceleration jobs.

    • next

    Integer

    The next page number. If this parameter is null or 0, there are no more pages.

    • pre

    Integer

    The previous page number. If this parameter is null or 0, there is no previous page.

    • totalNum

    Integer

    The total number of entries.

    • totalPages

    Integer

    The total number of pages.

    • pageNum

    Integer

    The current page number.

    • pageSize

    Integer

    The number of entries on the current page.

    • data

    object[]

    An array of objects, where each object represents an acceleration job.

    • cubeId

    String

    The ID of the dataset.

    • cubeName

    String

    The name of the dataset.

    • creatorName

    String

    The name of the creator.

    • size

    Integer

    The size of the accelerated data.

    • lastModifyTime

    String

    The time when the job was last modified.

    • enableQuickindexTime

    String

    The time when acceleration was enabled.

    • jobId

    String

    The ID of the acceleration job.

    • jobStatus

    String

    The status of the job.

    • 0: Pending

    • 1: Running

    • 2: Succeeded

    • 3: Failed

    • 4: Canceled

    • 5: Warning

    • jobHistoryId

    String

    The job history ID.

  • Response example:

    {
        "traceId": "626b80*********************4e5893f63",
        "code": "0",
        "message": "success",
        "data": {
                  "next": null,
                  "pre": null,
                  "data":
                  [
                      {
                          "duration": "16",
                          "jobId": "CUBE_OF*****b74-5d9b298c2ca5",
                          "jonStartDate": "2025/09/10 13:59:19",
                          "jobHistoryId": "010ab44******b16cf45a4",
                          "jobStatus": 2,
                          "log": "2025*******cess."
                      }
                  ],
                  "totalNum": 1,
                  "totalPages": 1,
                  "start": 0,
                  "pageSize": 10,
                  "orderBy": null,
                  "pageNum": 1,
                  "orderString": null
              }
        "success": true,
    }
  • Java SDK example:

    @Test
    public void analytic() throws Exception {
        HttpRequest request = HttpRequest.build()
                .setUri("/openapi/v2/dataset/analytic/list")
                .setMethod(HttpMethod.GET).setHttpContentType(FormatType.FORM)
                .addParameter("workspaceId","086344************d9a62236c")
                .addParameter("pageNo", "1")
                .addParameter("pageSize", "10");
        String response = getOpenApiClient("test").syncExecute(request);
        System.out.println(response);
    }