This topic describes the APIs for managing datasets.
List workspace datasets
Endpoint:
GET /openapi/v2/dataset/listDescription: Retrieves a paginated list of datasets in a specified workspace. The results are sorted by creation time in descending order.
Availability: This API is available in standalone deployments v3.8.3 and later.
Input 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 API returns all datasets in this directory.
No
withChildren
boolean
Specifies whether to recursively retrieve datasets from subdirectories.
true: Returns datasets from the specified directory and all its subdirectories.
false: Returns datasets from the specified directory only.
No
keyword
string
A keyword to search for datasets by name.
No
pageNum
int
The page number. Default: 1.
No
pageSize
int
The number of entries per page. Default: 10.
No
Response parameters (The Java SDK returns only the
dataobject):Parameter
Type
Description
requestId
string
The request ID.
code
string
The error code. Valid values:
0: The request was successful.
Error codes starting 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 for a failed request.
success
boolean
Indicates whether the request was successful. Valid values:
true: The request was successful.
false: The request failed.
data
object
The paginated results. The
dataarray contains the detailed list of datasets.totalNum
int
The total number of entries.
totalPages
int
The total number of pages.
pageSize
int
The number of entries per page, as specified in the request.
pageNum
int
The page number.
data
array
An array of dataset models.
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
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
createTime
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****
modifyTime
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 dataset's data source.
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 that contains the dataset.
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
name
string
The name of the directory.
Example: My Datasets
id
string
The ID of the directory.
Example: schemaad8aad00-9c55-4984-a767-b4e0ec60****
Response example
{ "requestId": "7F820282-DC21-****-8256-6D177EFF9CE1", "result": { "data": [{ "createTime": "2024-02-27 09:42:47", "dataSource": { "dsId": "dae6c49f-9f3a-****-9a61-403f0531bca1", "dsType": "api_datasource" }, "datasetId": "758add3e-33a1-****-8086-a25a07739ae3", "datasetName": "API_test", "directory": { "id": "3ce1c251-1d10-****-8fe1-093d25be135a", "name": "Important Datasets", "pathId": "3ce1c251-1d10-****-8fe1-093d25be135a", "pathName": "Important Datasets" }, "modifyTime": "2024-02-27 09:44:52", "openOfflineAcceleration": false, "ownerId": "74f55****6d14e9892245320ebf27***", "ownerName": "John Doe", "rowLevel": false, "workspaceId": "a1c8ab4d-74ab-****-8f63-9fec14d810d0", "workspaceName": "Marketing Team Workspace" }], "pageNum": 1, "pageSize": 10, "totalNum": 18, "totalPages": 2 }, "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); }
Dataset details
Endpoint: GET
/openapi/v2/dataset/infoNewDescription: Retrieves the details of a specified dataset, including its data source, directory, and data model (which contains dimensions, measures, physical fields, custom SQL, relationships, and other information).
Availability: Available since private deployment v4.0.2.
Query Parameters:
Parameter
Type
Description
Required
datasetId
string
The ID of the dataset.
Yes
Response parameters (For SDK calls, only the
dataobject is returned.)Parameter
Type
Description
traceId
string
The request ID.
code
string
The error code. Valid values:
0: The request was successful.
Error codes starting with AE or OE: The request failed.
message
string
The error message. Valid values:
success: The request was successful.
Other values: An error message that describes the failure.
success
boolean
Indicates whether the request succeeded. Valid values:
true: The request succeeded.
false: The request failed.
data
object
The dataset details.
datasetId
string
The dataset ID.
datasetName
string
The dataset name.
cubeTableList
object [ ]
A list of physical tables associated with the dataset.
datasourceId
string
The data source ID.
dsType
string
The data source type.
uniqueId
string
The unique ID.
caption
string
The caption (display name).
tableName
string
The physical table name.
factTable
boolean
Indicates whether the table is a fact table.
isCustomsql
boolean
Indicates whether the dataset is based on custom SQL.
sql
string
The SQL statement for the custom SQL-based dataset.
measureList
object [ ]
A list of measure fields.
tableUniqueId
string
The unique ID of the corresponding table.
uid
string
The unique ID of the measure.
caption
string
The caption (display name).
dataType
string
The data type. Valid values:
string: A string.
number: A number.
datetime: A date or time value.
measureType
string
The measure type. Valid values:
STANDARD_MEASURE: A standard measure.
CALCULATE_MEASURE: A calculated measure.
expression
string
The expression for a calculated measure.
expressionV2
string
The flattened expression for the calculated measure.
factColumn
string
The physical field.
fieldDescription
string
The field description.
dimensionList
object [ ]
A list of dimension fields.
tableUniqueId
string
The unique ID of the corresponding table.
uid
string
The unique ID of the dimension.
caption
string
The caption (display name).
dataType
string
The data type. Valid values:
string: A string.
number: A number.
datetime: A date or time value.
refUid
string
For a group dimension, this is the unique ID of the referenced field.
granularity
string
The granularity of date and geographic dimensions.
expression
string
The expression for a calculated dimension.
expressionV2
string
The flattened expression for the calculated dimension.
factColumn
string
The physical field.
dimensionType
string
The dimension type.
STANDARD_DIMENSION: A standard dimension.
CALCULATE_DIMENSION: A calculated dimension.
GROUP_DIMENSION: A group dimension.
dsId
string
The data source ID.
gmtCreate
string
The timestamp when the dataset was created.
ownerName
string
The name of the dataset owner.
ownerId
string
The user ID of the dataset owner.
dsName
string
The data source name.
directory
string
Details of the dataset's directory.
id
string
The directory ID.
name
string
The directory name.
pathId
string
The directory ID path. For example:
aa/bb/cc/dd.pathName
string
The directory name path. For example:
First-level Directory/Second-level Directory.dsType
string
The data source type.
workspaceName
string
The name of the workspace.
workspaceId
string
The ID of the workspace.
custimzeSql
boolean
Indicates whether custom SQL is used.
modifierName
string
The name of the user who last modified the dataset.
modifierId
string
The ID of the user who last modified the dataset.
rowLevel
boolean
Indicates whether row-level security is enabled.
gmtModify
string
The timestamp when the dataset was last modified.
OpenOfflineAcceleration
boolean
Indicates whether extraction acceleration is enabled.
true: Enabled
false: Disabled
Example:
trueExample Response:
{ "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); }
List users authorized for a dataset
Endpoint:
GET /openapi/v2/dataset/share/grantedListDescription: Retrieves a list of authorized or unauthorized users for a dataset within its workspace.
Initial version: private deployment 3.12.1
Input parameters:
Parameter
Type
Description
Required
grantType
boolean
Specifies whether to list authorized or unauthorized users:
true: Lists authorized users.
false: Lists unauthorized users.
Yes
worksId
String
The ID of the dataset.
Yes
keyword
String
A keyword for a fuzzy search of the
accountNameandnickNamefields.No
pageNum
int
The page number.
Default: 1.
No
pageSize
int
The number of items to return on each page.
Default: 10.
No
Response parameters (The SDK returns only the
dataobject):Parameter
Type
Description
traceId
string
The request ID.
code
string
The error code. Valid values:
0: The API call was successful.
Codes starting with AE or OE indicate that the API call failed.
message
string
The error message. Valid values:
success: The API call was successful.
Other values: An error message if the API call fails.
success
boolean
Indicates if the request was successful. Valid values:
true: The request was successful.
false: The request failed.
data
object
The paginated list of users.
totalNum
int
The total number of users.
totalPages
int
The total number of pages.
pageSize
int
The page size specified in the request.
pageNum
int
The page number.
data
array of objects
A list of users.
nickname
string
The nickname of the user.
worksId
string
The ID of the dataset.
userId
string
The ID of the user.
Response example:
{ "data": [ { "worksId": "539c5512-*****9", // The ID of the dataset "nickname": "The-Analyst-Master", // The nickname of the authorized user "userId": "de4bc5f9*****5" // The Quick BI user ID of the authorized user } ], "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 access to a dataset
Endpoint:
/openapi/v2/dataset/share/authorize(POST)Description: Grants access to a dataset for an entire workspace or for specific users within the workspace. This operation supports batch authorization.
Initial version: standalone deployment 3.12.1
Request parameters: (content-type:application/x-www-form-urlencoded;charset=UTF-8. Parameters are submitted as form data.)
Parameter
Type
Description
Required
grantType
String
The grant type. Valid values are the strings "true" and "false":
true: Grants access to the entire workspace.
false: Grants access to specific users in the workspace.
Yes
worksId
String
The ID of the dataset.
Yes
shareToUserIds
String
The IDs of users to grant access to. For batch authorization, separate multiple user IDs with a comma (,).
Optional
Required only when
grantTypeisfalse.Response parameters (Note: SDK calls return only the value of the "data" field.)
Parameter
Type
Description
traceId
string
The request ID.
code
string
The error code. Possible values:
0: The call succeeded.
An exception code starting with AE or OE: The call failed.
message
string
The response message. Possible values:
success: The call succeeded.
Other messages: An error message that describes the failure.
success
boolean
Indicates whether the request succeeded. Possible values:
true: The request succeeded.
false: The request failed.
data
boolean
Indicates whether the operation succeeded. Possible 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/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 (batch supported)
Endpoint:
/openapi/v2/dataset/share/unAuthorize(POST)Description: Revokes authorization for a dataset from an entire workspace or from specific users. Batch operations are supported.
Available since: standalone deployment 3.12.1
Input parameters: (content-type:application/x-www-form-urlencoded;charset=UTF-8; parameters are submitted as form data)
Parameter
Type
Description
Required
grantType
boolean
The authorization mode. Possible values:
true: Revoke authorization from the entire workspace.
false: Revoke authorization from specific users in the workspace.
Yes
worksId
String
The ID of the dataset.
Yes
shareToUserIds
String
The IDs of users whose authorization is to be revoked. For batch operations, separate multiple IDs with a comma (,).
No.
Required when
grantType=false.Response parameters (SDK calls return only the content of the data field)
Parameter
Type
Description
traceId
string
The request ID.
code
string
The exception code. Possible values:
0: The call was successful.
Exception codes starting with AE or OE: The call failed.
message
string
The response message. Possible values:
success: The call was successful.
Other values: The error message if the call fails.
success
boolean
Indicates whether the request was successful. Possible values:
true: The request was successful.
false: The request failed.
data
boolean
Indicates whether the operation was successful. Possible 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 testUnauthorize() 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 from a data source and table
Endpoint:
POST /openapi/v2/dataset/createDescription: Creates a dataset based on a specified data source and physical table name.
Available Since: On-premises deployment v4.3.1.1
Request Parameters: Send the following parameters in the request body in JSON format (
Content-Type: application/json;charset=UTF-8).ImportantNote: If a dataset with the same data source and physical table already exists in the same workspace, the
cubeIdof the existing dataset is returned.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 for the dataset.
The name can contain Chinese characters, letters, digits, and the following special characters: _, /, \, |, (), [], -, and +. The maximum length is 100 bytes.
Yes
workspaceId
string
The ID of the workspace to which the dataset belongs.
Yes
userId
string
The Quick BI user ID. If this user is a workspace member but lacks dataset creation permissions, the system creates the dataset as the workspace owner. Otherwise, the system creates the dataset as the specified user.
Yes
targetDirectoryId
string
The ID of the target directory for the dataset. If this parameter is omitted, the dataset is created in the root directory.
No
Example Request:
{ "dsId":"23d33abf-****-****-b7d7-d962d7a5f6f1", "tableName":"test", "userDefineCubeName":"Test Dataset", "workspaceId":"87f73904-****-****-b1ee-5a3a03a8eb45", "userId":"fec074144320****b1905061e6a951a2", "targetDirectoryId":"388b865a-2df7-****-93f0-cb2ced724d70" }Response Parameters
Parameter
Type
Description
traceId
string
The request ID.
code
string
The error code. Valid values:
0: The request succeeded.Codes starting with
AEorOE: The request failed.
message
string
The response message. On success, this field contains the
cubeIdof the dataset. On failure, it contains an error message.success
boolean
Indicates whether the request succeeded. Valid values:
true: The request succeeded.false: The request failed.
data
boolean
Indicates whether the operation succeeded. Valid values:
true: The operation succeeded.false: The operation failed.
Example Response:
{ "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: POST /openapi/v2/datasource/add
Description: Creates a new data source.
Availability: Available for on-premises deployments in version 4.3.1.1 and later.
Request body:
NoteIf a data source with the same connection information already exists in the workspace, this operation returns the
dsIdof the existing data source instead of creating a new one.Parameter
Type
Required
Description
userId
String
Yes
The ID of the user.
workspaceId
String
Yes
The ID of the workspace.
showName
String
Yes
The display name for the data source.
The name can contain Chinese characters, English letters, digits, underscores (_), slashes (/), backslashes (\), vertical bars (|), parentheses (()), and square brackets ([]). The maximum length is 50 bytes.
address
String
Yes
The database connection string, which can be 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 databases that support schemas.
Example: SQL Server uses
dboby default; MySQL does not support schemas.dsType
String
Yes
The type of the data source.
username
String
No
The username for the database account or the Access Key ID.
password
String
No
The password for the database account or the Access Key Secret.
instance
String
Yes
The database instance name.
project
String
No
The name of the project. This parameter is required only for ODPS data sources.
config
Json
No
Additional configuration for the data source, in JSON format.
noSasl
boolean
No
Specifies the authentication method for an Impala data source.
-true: Use non-SASL authentication (username and password).
-false(default): Use SASL-based authentication.encoded
boolean
No
Specifies whether the username and password are encrypted during transmission.
parentDsType
String
No
The parent data source type for a multi-engine data source. If you omit this parameter, a standard data source is created.
Valid value:
dataphin
Request body examples:
AnalyticDB
{ "showName":"AnalyticDB adb3.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 the Access Key ID "password":"yourAccessKeySecret", // Corresponds to the Access Key Secret "schema": null, "instance": "Your Project Name", // Corresponds to the project name "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'" // Initial SQL is supported starting from v4.4.X.X. }, "workspaceId": "87f73904-****-****-b1ee-5a3a03a8eb45", "username": "LTAI****************", // Corresponds to the Access Key ID "password": "yourAccessKeySecret" // Corresponds to the Access Key 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; AcccessKey type: personal user; Engine type: AnalyticDB 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 body:
{ "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"); // List parameters must be constructed manually. // 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
API path:
/openapi/v2/datasource/update(PUT)Description: Updates an existing data source.
Available since: standalone deployment 4.3.1.1
Input parameters:
Parameter
Type
Required
Description
dsId
String
Yes
The data source ID.
userId
String
No
The ID of the Quick BI user performing the modification. If specified, the API performs the modification on this user's behalf.
dsType
String
Yes
The data source type.
showName
String
No
The display name of the data source.
Supports Chinese characters, letters, digits, and the following special characters:
_ / \ | () []. The maximum length is 50 bytes.address
String
Yes
The database connection address. This can be 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 databases that support schemas.
Example: SQL Server uses
dboby default, while MySQL does not support schemas.instance
The database instance.
username
String
No
The database username or Access Key (AK).
password
String
Yes
The database password.
noSasl
boolean
No
Specifies whether authentication is required for an Impala data source. If omitted, this parameter defaults to
false.Valid values:
true: Authentication is required.false: Authentication is not required. (Default)config
Json
No
Additional configuration items for the database.
ImportantNote: The structure of this JSON object must match the
configparameter used when creating the data source. Provide only the fields you want to update. Any provided fields, even those with empty strings, will overwrite existing values.Example request
{ "schema": "schema", "password": "******", "showName": "test_update_data_source_name", "address": "118.xx.xx.xx", "instance": "quickbi_test", "dsId": "34d6d5ec-e5c4-****-b925-d0a3ca8ac267", "port": "3306", "dsType": "mysql", "username": "root", "config": { "initialSql": "Set timezone = '-10'" } }Return parameters:
Parameter
Type
Description
traceId
string
The request ID.
code
string
The error code. Valid values:
0: The request was successful.Error codes starting with
AEorOE: 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
boolean
Indicates whether the operation was successful. Valid values:
true: The operation was successful.false: The operation failed.
Example response:
{ "traceId":"235c9fa8-d6f5-****-a6d4-38f07b2319ce", "code":"0", "message":"f441dad7-6878-****-9ad1-84ff92c7d971", "success":true, "data":true, // Indicates whether the update was successful. }Java SDK example:
public static void update() throws SDKException { HttpRequest request = HttpRequest.build() .setUri("/openapi/v2/datasource/update") .setMethod(HttpMethod.PUT); 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("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
Endpoint: DELETE /openapi/v2/datasource/delete
Description: Deletes a data source. This operation supports force delete.
Availability: This API is available in independent deployment 4.3.1.1 and later.
Request parameters: (content-type:
application/x-www-form-urlencoded;charset=UTF-8)Parameter
Type
Required
Description
dsId
String
Yes
The ID of the data source.
forceDelete
Boolean
No
Specifies whether to force delete the data source. Defaults to
false. To delete a data source that is associated with datasets, you must set this parameter totrue.Example request
{ "dsId": "00119445-86bc-****-911c-a34e23587cca", "forceDelete": false }Response parameters: (SDK methods for this API return only the value of the
datafield.)Parameter
Type
Description
traceId
string
The request ID.
code
string
The error code for the API call:
0: Indicates success.Codes starting with
AEorOE: The API call failed.
message
string
The returned message:
success: Indicates success.Any other value: An error message.
success
boolean
Indicates whether the API call was processed without errors:
true: The call was processed successfully.false: The call failed to be processed.
data
boolean
Indicates whether the data source was deleted:
true: The data source was deleted.false: The data source was not deleted.
Example response:
{ "traceId":"235c9fa8-d6f5-****-a6d4-38f07b2319ce", "code":"0", "message":"success", "success":true, "data":true // Indicates whether the deletion was successful. }Java SDK example:
public static void deleteDataSource() 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","false"); String result = openApiClient.syncExecute(request); System.out.println(result); }
Bulk clear dataset caches
Endpoint:
POST /openapi/v2/dataset/batchCleanCacheDescription: Clears the query result caches for datasets within an organization.
Available since: standalone deployment 4.4.3
Request parameters:
Parameter
Type
Description
Required
cubeIds
String
A comma-separated list of dataset IDs.
Yes
Response parameters: (When using an SDK, the call returns only the value of the
datafield.)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
AEorOE: The request failed.
message
string
The response message. Possible values:
success: The request was successful.Any other string: The error message if the request fails.
success
boolean
Indicates whether the request was successful. Possible values:
true: The request was successful.false: The request failed.
data
boolean
Indicates whether the operation was successful. Possible 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 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); }
Trigger dataset ingestion acceleration
API path: POST /openapi/v2/dataset/task/quickindex/allot
API description: Triggers ingestion acceleration for a dataset using the Quick Engine.
Initial version: standalone deployment 4.5
API parameters: (
content-type: application/x-www-form-urlencoded;charset=UTF-8)Parameter
Type
Description
Required
cubeId
String
The dataset ID.
Yes
Response parameters (The SDK returns only the value of the
datafield.)Parameter
Type
Description
traceId
string
The request ID.
code
string
The error code. Possible values:
0: The API call succeeded.An error code starting with AE or OE: The API call failed.
message
string
The error message. Possible values:
success: The API call succeeded.Other information: An error message that describes the failure.
success
boolean
Indicates if the request succeeded. Possible values:
true: The request succeeded.false: The request failed.
data
boolean
Indicates if the operation succeeded. Possible values:
true: The operation succeeded.false: The operation failed.
Example response
{ "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/queryCubePerformanceDescription: Retrieves performance metrics for datasets.
Availability: Available since standalone deployment version ind_5.2.
Query parameters:
Parameter
Type
Description
Required
queryType
String
The type of query.
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 number of items to return per page.
Yes
pageNum
Integer
The page number to retrieve.
Yes
Response parameters (SDKs return only the
dataobject):Parameter
Type
Description
traceId
string
The request ID.
code
string
The result code. Valid values:
0: The request was successful.
Error codes starting 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
object[]
A list of performance metrics for self-service data retrieval.
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 queries that hit the Quick engine.
QuickIndexQueryCount
integer
The number of queries that hit the Quick engine.
CacheCostTimeAvg
double
The average query time for queries that hit the cache.
CacheQueryCount
integer
The number of queries that hit the cache.
RepeatSqlQueryCount
integer
The number of repeated SQL queries.
CostTimeAvg
double
The average query time.
QueryCountAvg
double
The average number of queries.
QueryCount
integer
The total number of queries.
QueryTimeoutCountPercent
integer
The percentage of timed-out chart queries.
QueryOverTenSecPercentNum
integer
The number of queries that took longer than 10 seconds.
QueryOverFivePercentNum
integer
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 queryDatasetPerformance() 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);
}Query datasets by data source
Endpoint:
GET /openapi/v2/dataset/dataSourceBloodDescription: Lists the IDs of datasets that reference a specified data source.
Available since: standalone deployment v5.1.2
Input parameters:
Parameter
Type
Description
Required
dataSourceId
string
The ID of the data source.
Yes
Response parameters: (When using an SDK, the response body contains only the value of the
datafield.)Parameter
Type
Description
traceId
string
The request ID.
code
string
The error code. Valid values:
0: The request succeeded.
Codes starting with AE or OE: The request failed.
message
string
The response message. Valid values:
success: The request succeeded.
Other values: An error message if the request fails.
success
boolean
Indicates if the request succeeded. Valid values:
true: The request succeeded.
false: The request failed.
data
object
A data object containing a list of dataset IDs.
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("daily").syncExecute(request); System.out.println(result); }
Query assets by dataset
API:
GET /openapi/v2/dataset/dataSetBloodDescription: Gets a list of assets, such as dashboards and spreadsheets, that use one or more specified datasets.
Availability: Available in standalone deployment v5.1.2 and later.
Input parameters:
Parameter
Type
Description
Required
dataSetIds
String
A comma-separated list of dataset IDs.
Yes
userId
String
The user ID of the asset owner. Filters the results by owner.
No
worksType
String
The asset type. Valid values:
REPORT: spreadsheetdashboardOfflineQuery: ad-hoc queryDASHBOARD: dashboardANALYSIS: ad-hoc analysisSCREEN: data screenPAGE: legacy dashboard
No
Response parameters (Note: When using the SDK, the method returns only the value of the
datafield.):Parameter
Type
Description
traceId
String
The request ID.
code
String
The error code. Valid values:
0: The request succeeded.Codes starting with
AEorOE: The request failed.
message
String
The response message. Valid values:
success: The request succeeded.Other values: An error message indicating why the request failed.
success
Boolean
Indicates whether the request was successful. Valid values:
true: The request succeeded.false: The request failed.
data
Object[]
An array of objects, where each object represents an asset that uses one of the specified datasets.
worksType
String
The asset type. Valid values:
REPORT: spreadsheetdashboardOfflineQuery: ad-hoc queryDASHBOARD: dashboardANALYSIS: ad-hoc analysisSCREEN: data screenPAGE: legacy dashboard
worksId
String
The asset ID.
Response example:
{ "traceId": "f09d9c36-4dc7-****-9ab4-f4dd10a80602", "code": "0", "message": "success", "data": [ { "worksId": "52d11adc-2512-****-b64c-42bdab357d80", "worksType": "DASHBOARD" }, { "worksId": "4eed0ef6-4e3b-****-ac4d-bb9f8b685cd7", "worksType": "REPORT" } ], "success": true }Java SDK example:
@Test public void testDataSetBlood() throws SDKException { HttpRequest request = HttpRequest.build() .setUri("/openapi/v2/dataset/dataSetBlood") .setMethod(HttpMethod.GET) .setHttpContentType(FormatType.FORM); request.addParameter("dataSetIds","52d11adc-****,4eed0ef6-****"); String result = getOpenApiClient("daily").syncExecute(request); System.out.println(result); }
Query data sources
API: /openapi/v2/datasource/list (GET)
Description: Retrieves basic information about all data sources in a specified workspace.
NoteThis operation does not return data sources created from tags, exploration space data sources, or API-based data sources.
Available since: private 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 3.0
oracle -- Oracle data source
mysql -- MySQL data source
mysql_hybrid -- HybridDB for MySQL data source
odps -- ODPS 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 (LUW) data source
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
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-model SQL data source
hbase -- HBase data source
phoenix_thin -- Phoenix Thin data source
dataphin -- DataPhin data source (multi-engine)
dataphin_odps -- DataPhin data source (ODPS engine)
dataphin_hive -- DataPhin data source (Hive engine)
dataphin_v2_odps -- New DataPhin data source (ODPS 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 (MySQL mode) data source
oceanbase_oracle -- OceanBase (Oracle mode) data source
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
unicorn -- Unicorn data source
sls -- SLS data source
gaussdb_dws -- GaussDB DWS data source
gaussdb -- GaussDB data source
elasticsearch -- Elasticsearch data source
dms -- DMS data source
yida -- Yida application data source
relyt -- Relyt data source
feishu_bitable -- Lark Bitable data source
feishu_spreadsheet -- Lark Spreadsheet data source
tidb -- TiDB data source
mariadb -- MariaDB data source
adb_spark -- AnalyticDB for Spark data sourceResponse parameters (Note: SDKs return only the value of the
datafield):Parameter
Type
Description
traceId
string
The request ID.
code
string
The error code. Valid values:
0: The request was successful.
An error code that starts with AE or OE indicates a failed request.
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
object[]
The list of data source objects.
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 parent data source type for a multi-engine data source. This parameter is returned only for applicable data sources.
gmtCreate
string
The time the data source was created, in
yyyy-MM-dd HH:mm:ssformat.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
API: GET /openapi/v2/datasource/{dsId}
Description: Retrieves the configuration information for a data source.
Available since: standalone deployment v5.3.1
Path parameters:
Parameter | Type | Description | Required |
dsId | String | The ID of the data source. | Yes |
Data source type codes:
garuda -- Garuda data source
adb -- AnalyticDB for MySQL 3.0
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
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-model 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
oceanbase_mysql -- OceanBase (MySQL mode) data source
oceanbase_oracle -- OceanBase (Oracle mode) data source
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 data source
gaussdb_dws -- GaussDB(DWS) data source
gaussdb -- GaussDB data source
elasticsearch -- Elasticsearch
dms -- DMS logical data warehouse
yida -- Yida application data source
relyt -- Relyt
feishu_bitable -- Lark Base
feishu_spreadsheet -- Lark Sheets
tidb -- TiDB data source
mariadb -- MariaDB data source
adb_spark -- AnalyticDB for MySQL data source (Spark engine)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: Success
Error codes starting with AE or OE: The request failed.
message
string
The response message. Valid values:
success: The request was successful.
Other messages: 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
object
The data source configuration information.
dsId
string
The ID of the data source.
creatorId
string
The creator's Quick BI user ID.
modifyUser
string
The Quick BI user ID of the last modifier.
workspaceId
String
The ID of the workspace to which the data source belongs.
address
String
The connection address of the database (domain name or IP).
port
String
The port number.
dsType
String
The data source type. For valid values, see the preceding list of type codes.
schema
String
The database schema. This parameter is required only for databases that support schemas.
instance
String
The database instance, typically the database name. For MaxCompute, this is the project.
project
String
For MaxCompute data sources, this is a display-only parameter used in connection details.
showName
String
The display name of the data source.
authLevel
Integer
The permission level. Valid values:
0: Private
1: Collaborative editing (legacy)
11: Collaborative editing for workspace members
12: Collaborative editing for specified users
instanceId
String
The ID of the instance.
dsVersion
String
The version of the data source.
noSasl
boolean
For Impala data sources, specifies if authentication is required.
true: A username and password are required.false(default): Authentication is not required.parentDsType
String
The parent data source type for a multi-engine data source.
config
object
Additional configuration options for different types of data sources.
Response example
{ "traceId": "626b80*********************4e5893f63", "code": "0", "message": "success", "data": { "dsId": "85be*********************61440", // Data source ID "creatorId": "74f55*********************aaaaaaaaa", // Creator's user ID "modifyUser": null, // Modifier's user ID "workspaceId": "8b8e0e5*********************aaaaaaa6666", // Workspace ID "address": "example.aliyuncs.com", // Data source address "port": "3306", // Database port "dsType": "mysql", // Data source type "userName": "test_username", // Database username "schema": null, // Schema "instance": "test",// Database "project": null, "showName": "mysql_copy", // Data source name "config": { "resource": null, "category": "cloud", // Category "netType": null, "vpcId": null, // ID of the VPC "vpcIp": null,// IP address of the VPC "vpcPort": null,// Port of the VPC "onEcsMappingIp": null,// Mapped IP address on the ECS instance "onEcsMappingPort": null,// Mapped port on the ECS instance "instanceIp": null,// Instance IP address "engine": null,// Engine "instanceId": null,// Instance ID "region": null,// Region "endPointDomain": null,// 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",// Hostname "hostPort": "3306"// Host port }, "kerberosEnable": null,// Indicates whether Kerberos authentication is enabled "hiveConnectionType": null,// Hive connection type "hiveMetastoreUri": null,// Hive metastore address "engineType": null,// Engine type "envType": "public_cloud",// Environment type "characterEncoding": null,// Character encoding "mcqa": null,// MaxCompute MCQA "fallbackQuota": null, "initialSql": null,// Initial SQL "sparkDetect": "true",// Spark detection "timeZone": null// Time zone }, "authLevel": null, "accessId": null, "accessKey": null, "instanceId": null, "region": null, "loginTicket": null, "dsVersion": null, // Data source version "dsCreateOrigin": null, "noSasl": false, // `false` indicates that authentication is not required for Impala. "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 the most recent acceleration job
API:
GET /openapi/v2/dataset/query/accelerationJobDescription: Retrieves the most recent acceleration job by
cubeId.Available since: standalone deployment 6.0
Query parameters:
Parameter
Type
Description
Required
cubeId
String
The ID of the dataset.
Yes
Response parameters (when using the SDK, only the
dataobject is returned):Parameter
Type
Description
traceId
string
The request ID.
code
string
The error code. Possible values:
0: Indicates success.A code starting with
AEorOE: Indicates failure.
message
string
The response message. Possible values:
success: The request succeeded.Other values: An error message that explains why the request failed.
success
boolean
Indicates if the request succeeded. Possible values:
true: The request succeeded.false: The request failed.
data
object
The object containing the acceleration job details.
jobHistoryId
string
The ID of the acceleration job.
status
string
The job status. Possible values:
TODO: The job is pending.RUNNING: The job is running.SUCCESS: The job completed successfully.FAILURE: The job failed.CANCELED: The job was canceled.CHECK_DEPENDENCY: The job is checking dependencies.
gmtCreate
date
The time the job started, in
yyyy-MM-dd HH:mm:ssformat.gmtModified
date
The time the job finished, in
yyyy-MM-dd HH:mm:ssformat.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: Verifies whether a dataset exists based on its
cubeId.Availability: Available since standalone deployment 6.0 for all users.
Input parameters:
Parameter
Type
Required
Description
cubeId
String
Yes
The ID of the dataset.
Return parameters (Note: The SDK returns only the
datafield.)Parameter
Type
Description
traceId
string
The request ID.
code
string
The error code. Valid values:
0: The request was successful.
Codes starting with AE or OE: The request failed.
message
string
The response 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 dataset exists.
true: The dataset exists.
false: The dataset does not exist.
Example response
{ "traceId":"235c9*********8f07b2319ce", "code":"0", "message":"f441*******c7d971", "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 custom SQL
Endpoint:
POST /openapi/v2/dataset/createBySqlDescription: Creates a dataset using a custom SQL statement.
Available since: standalone deployment 6.0
Request parameters: (Content-Type: application/json. The following parameters are sent in the request body.)
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 current user.
Yes
customSql
String
The custom SQL statement.
Yes
caption
String
The name of the table created from the custom SQL.
Yes
placeholders
List<PlaceholderModel>
A list of placeholder objects. This parameter is required if the custom SQL contains placeholders.
No
PlaceholderModel object
Parameter
Type
Description
Required
Remarks
uniqueId
String
The unique ID of the placeholder.
No
Used for updates. During creation, this parameter is optional and is ignored if provided.
name
String
The name of the placeholder.
Yes
The name must be unique within the list of placeholders.
style
String
Expression placeholder:
paramValue placeholder:
placeholderCondition placeholder:
conditionYes
Must be one of the values listed above.
type
String
The data type of the placeholder.
stringnumberDate types: See the tables below for details.
Yes
For valid
typeandformatvalues for each placeholder style, see the tables below.useInGlobal
Boolean
Specifies whether the placeholder is global.
true: Globalfalse: Not globalNo
Defaults to
falseif not provided.defaultValue
List<String>
The default value for the placeholder.
No
For date range placeholders, the list can contain 0 or 2 values.
For all other placeholder types, the list can contain 0 or 1 value.
format
String
The format for date types. See the tables below for details.
No
For valid
typeandformatvalues for each placeholder style, see the tables below.originalType
String
Identifies a date range placeholder for the frontend.
No
Set this to
dateRangefor date range value placeholders. Omit this parameter in all other cases.conditionPlaceHolderFields
List<ConditionPlaceHolderFields>
The fields for the condition placeholder. This parameter is required only when the
styleiscondition.No
ConditionPlaceHolderFields object
Parameter
Type
Description
Required
Remarks
uniqueId
String
The unique ID of the field. This is generated by the backend and should not be provided during creation.
No
column
String
The name of the physical field.
Yes
Mappings for expression placeholders (blank cells indicate no value is required)
Type
typeformatString
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
Mappings for value placeholders (blank cells indicate no value is required)
Type
typeformatRemarks
String
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
Specify one of the available formats.
Date-Year-Week
weekRegion
Date-Year-Month-Day
dateRegion
YYYY-MM-DD
YYYYMMDD
YYYY/MM/DD
Specify one of the available 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
Specify one of the available formats.
Mappings for condition placeholders (blank cells indicate no value is required)
Type
typeformatRemarks
String
string
Response parameters
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
AEorOE: The request failed.
message
string
The response message. Possible values:
success: The request was successful.Other values: The error message if the request fails.
success
boolean
Indicates whether the call was successful. Possible values:
true: The request was successful.false: The request failed.
data
string
The ID of the created 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", "MyCustomSQLTable"); 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 a custom SQL dataset
API: /openapi/v2/dataset/updateBySql (POST)
Description: Updates a custom SQL dataset.
Available Since: standalone deployment 6.0
Request parameters: (Content-Type:application/json, in JSON format)
Parameter
Type
Description
Required
cubeId
String
The ID of the dataset to update.
Yes
customSql
String
The new custom SQL for the dataset.
Yes
workspaceId
String
The workspace ID.
Yes
userId
String
The user ID for permission checks.
Yes
dsId
String
The ID of the data source referenced by the dataset.
Yes
placeholders
List<PlaceholderModel>
A collection of placeholders. Required if the custom SQL contains placeholders. For parameter details, see the "Create a dataset using custom SQL" API.
No
Response parameters (SDK calls return only the value of 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 error message. Possible values:
success: The request was successful.
Other messages: A specific error message if the request fails.
success
boolean
Indicates whether the request was successful. Possible values:
true: The request was successful.
false: The request failed.
data
boolean
Indicates whether the operation was successful. Possible values:
true: The operation was successful.
false: The operation failed.
Sample response:
{ "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 logs
API:
GET /openapi/v2/dataset/query/accelerationLogDescription: Retrieves acceleration job logs for a specified dataset.
Available since: standalone deployment 6.0.1
Input parameters:
Parameter
Type
Description
Required
cubeId
String
The ID of the dataset.
Yes
startDate
String
The start of the query time range, in
yyyy-MM-dd HH:mm:ssformat.Yes
endDate
String
The end of the query time range, in
yyyy-MM-dd HH:mm:ssformat.Yes
pageNo
Integer
The page number to retrieve. Defaults to 1.
No
pageSize
Integer
The number of items to return per page. Defaults to 10.
No
Response parameters (Note: SDK calls return only the
dataobject.)Parameter
Type
Description
traceId
string
The request ID.
code
string
The error code. Valid values:
0: The request was successful.Error codes starting with
AEorOE: The request failed.
message
string
The response message. Valid values:
success: The request 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
object
An object that contains the paginated acceleration job logs.
next
Integer
The next page number. A value of
nullor0indicates that this is the last page.pre
Integer
The previous page number. A value of
nullor0indicates that this is the first 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 per page.
data
object[]
An array of acceleration job log objects.
jobId
String
The ID of the acceleration job.
jobHistoryId
String
The job history ID.
jobStartDate
String
The start time of the job.
jobStatus
Integer
The status of the job:
0: pending1: running2: succeeded3: failed4: canceled5: warning
duration
String
The duration in seconds.
log
String
The log content.
Example response:
{ "traceId": "626b80*********************4e5893f63", "code": "0", "message": "success", "success": true, "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 } }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); }
Get acceleration engine jobs in a workspace
Endpoint: GET /openapi/v2/dataset/analytic/list
Description: Retrieves a list of acceleration engine jobs in a specified workspace.
Initial version: standalone deployment 6.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. Default: 1.
No
pageSize
Integer
The number of entries per page. Default: 10.
No
Response parameters (Note: SDK calls return only the
dataobject.)Parameter
Type
Description
traceId
string
The request ID.
code
string
The error code. Valid values:
0: The request was successful.
Codes starting with AE or OE: The request failed.
message
string
The response message. Valid values:
success: The request was successful.
Other values: The error message if the request fails.
success
boolean
Indicates whether the request succeeded. Valid values:
true: The request succeeded.
false: The request failed.
data
object
An object containing acceleration job information.
next
Integer
The next page number. A value of
nullor 0 indicates that there is no next page.pre
Integer
The previous page number. A value of
nullor 0 indicates that 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 requested for the current page.
data
object[]
An array of acceleration job objects.
cubeId
String
The dataset ID.
cubeName
String
The dataset name.
creatorName
String
The name of the creator.
size
Integer
The job size.
lastModifyTime
String
The last modified time.
enableQuickindexTime
String
The timestamp when acceleration was enabled.
jobId
String
The ID of the acceleration job.
jobStatus
String
The job status:
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", "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 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); }