All Products
Search
Document Center

Quick BI:QueryDataService

Last Updated:Nov 04, 2025
This topic is generated by a machine translation engine without any human intervention. ALIBABA CLOUD DOES NOT GUARANTEE THE ACCURACY OF MACHINE TRANSLATED CONTENT. To request a human-translated version of this topic or provide feedback on this translation, please include it in the feedback form.
This API is deprecated. You are advised to use quickbi-public(2022-01-01) - QueryData.

Invoke an already created API in the data service.

Operation description

Prerequisites

You create the data service API through Quick BI's data service. For more details, see Data Service.

Usage Restrictions

  • The data service feature is only available to professional edition customers.
  • The timeout for data service API calls is 60s, and the QPS for a single API is 10 times/second.
  • If row-level permissions are enabled on the dataset referenced by the data service API, the API call may be intercepted by the row-level permission policy.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
quickbi-public:QueryDataServiceget
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ApiIdstringYes

The API ID in the data service. For more information, see Data Service.

f4cc43bc3***
ConditionsstringNo

The query conditions for the data service, passed in as Key-Value pairs. This is a map-type string. Here, Key is the name of the request parameter, and Value is the value of the request parameter. Keys and Values must appear in pairs.

Note:

  • When the operator of the request parameter is set to enumeration filter, the value can contain multiple values. In this case, the format of the value is a JSON list. For example: area=["East China","North China","South China"]

  • For dates, different formats are provided based on the type:

    • Year: 2019

    • Quarter: 2019Q1

    • Month: 201901 (with leading zero)

    • Week: 2019-52

    • Day: 20190101

    • Hour: 14:00:00 (minutes and seconds are 00)

    • Minute: 14:12:00 (seconds are 00)

    • Second: 14:34:34

{ "area": ["asdf", "west"], "shopping_date": "2019Q1", }
ReturnFieldsstringNo

A list of parameter names to be returned, as a List-type string.

["area", "city", "price", "date"]

Response parameters

ParameterTypeDescriptionExample
object
Successboolean

Indicates whether the request was successful. Possible values:

  • true: The request was successful

  • false: The request failed

true
RequestIdstring

The request ID.

78C1AA2D-9201-599E-A0BA-6FC462E57A95
Resultobject

Returns the result of the interface query.

Headersarray<object>

Column headers.

Headersobject
Aggregatorstring

Aggregation operator. Only present for measure fields, such as SUM, AVG, and MAX.

SUM
Columnstring

Field name, corresponding to the physical table field name.

The alias of the field. The key of the map data row in the result parameter values.
DataTypestring

The data type of the field. Common types include number, string, date, datetime, time, and geographic.

string
Granularitystring

The granularity of the dimension field. This field is returned only when the requested field is a date or geographic dimension, with the following possible values:

  • Date granularity: yearRegion (year), monthRegion (month), weekRegion (week), dayRegion (day), hourRegion (hour), minRegion (minute), secRegion (second)

  • Geographic granularity: COUNTRY (country level), PROVINCE (province level), CITY (city level), XIAN (district/county level), REGION (region)

yearRegion
Labelstring

Alias for the field, serving as the key in the map data row of the values parameter.

area
Typestring

Field type, used to distinguish between dimension and measure fields.

StandardDimension
Sqlstring

The SQL of the query request.

SELECT COMPANY_T_1_.`area` AS D_AREA_2_, COMPANY_T_1_.`city` AS D_CITY_3_, SUM(COMPANY_T_1_.`profit_amt`) AS D_PROFIT_4_ FROM `quickbi_test`.`company_sales_record_copy` AS COMPANY_T_1_ LIMIT 0, 10
Valuesarray<object>

The queried results returned.

Valuesobject

Rows and columns of the returned data.

This parameter is a List structure, where each Map represents a row of data. The Key in the Map corresponds to the Headers#Label field.

[{"area":"west","city":"asd"},{"area":"wesd","city":"sdfa"}]

Examples

Sample success responses

JSONformat

{
  "Success": true,
  "RequestId": "78C1AA2D-9201-599E-A0BA-6FC462E57A95",
  "Result": {
    "Headers": [
      {
        "Aggregator": "SUM",
        "Column": "The alias of the field. The key of the map data row in the result parameter values.",
        "DataType": "string",
        "Granularity": "yearRegion",
        "Label": "area",
        "Type": "StandardDimension"
      }
    ],
    "Sql": "SELECT COMPANY_T_1_.`area` AS D_AREA_2_, COMPANY_T_1_.`city` AS D_CITY_3_, SUM(COMPANY_T_1_.`profit_amt`) AS D_PROFIT_4_ FROM `quickbi_test`.`company_sales_record_copy` AS COMPANY_T_1_   LIMIT 0, 10",
    "Values": [
      [
        {
          "area": "west",
          "city": "asd"
        },
        {
          "area": "wesd",
          "city": "sdfa"
        }
      ]
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400API.No.PermissionYou are not authorized to call the data service API operation.You are not authorized to call the data service API operation.
400API.Not.ExistThe data service API operation does not exist.The data service API operation does not exist.
400Cube.Not.ExistThe Cube does not exist.The Cube does not exist.
400Invalid.Parameter.ConditionsThe specified Conditions is invalid. %s is not defined.The specified Conditions is invalid. %s is not defined.
400Invalid.Parameter.ReturnFieldsThe specified returnFields is invalid. %s is not defined.The specified returnFields is invalid. %s is not defined.
400Missing.ConditionsThe specified Conditions is invalid. You must specify %s.The specified Conditions is invalid. You must specify %s.
400Missing.Dimension.MeasureThe dimension or measure %s does not exist in Cube.The dimension or measure %s does not exist in Cube.
400Rowlevel.Permission.ForbbidenThe request is denied by row level permission. The dataset is %s, %s %s.Request forbidden by row level permission, dataset is %s, %s %s.
400Datasource.Sql.ExecuteFailedFailed to execute the SQL statement in the data source.-

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-04-06The Error code has changedView Change Details
2022-10-24The Error code has changedView Change Details