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
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 Resourcesis 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.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| quickbi-public:QueryDataService | get | *All Resources * |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| ApiId | string | Yes | The API ID in the data service. For more information, see Data Service. | f4cc43bc3*** |
| Conditions | string | No | 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:
| { "area": ["asdf", "west"], "shopping_date": "2019Q1", } |
| ReturnFields | string | No | A list of parameter names to be returned, as a List-type string. | ["area", "city", "price", "date"] |
Response parameters
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 code | Error code | Error message | Description |
|---|---|---|---|
| 400 | API.No.Permission | You are not authorized to call the data service API operation. | You are not authorized to call the data service API operation. |
| 400 | API.Not.Exist | The data service API operation does not exist. | The data service API operation does not exist. |
| 400 | Cube.Not.Exist | The Cube does not exist. | The Cube does not exist. |
| 400 | Invalid.Parameter.Conditions | The specified Conditions is invalid. %s is not defined. | The specified Conditions is invalid. %s is not defined. |
| 400 | Invalid.Parameter.ReturnFields | The specified returnFields is invalid. %s is not defined. | The specified returnFields is invalid. %s is not defined. |
| 400 | Missing.Conditions | The specified Conditions is invalid. You must specify %s. | The specified Conditions is invalid. You must specify %s. |
| 400 | Missing.Dimension.Measure | The dimension or measure %s does not exist in Cube. | The dimension or measure %s does not exist in Cube. |
| 400 | Rowlevel.Permission.Forbbiden | The request is denied by row level permission. The dataset is %s, %s %s. | Request forbidden by row level permission, dataset is %s, %s %s. |
| 400 | Datasource.Sql.ExecuteFailed | Failed to execute the SQL statement in the data source. | - |
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|---|---|
| 2023-04-06 | The Error code has changed | View Change Details |
| 2022-10-24 | The Error code has changed | View Change Details |
