Memanggil API yang telah dibuat di layanan data.
API ini telah ditinggalkan. Kami merekomendasikan migrasi ke quickbi-public(2022-01-01) - QueryData guna memperoleh fungsionalitas yang lebih baik dan dukungan berkelanjutan. Meskipun API yang telah ditinggalkan ini masih dapat diakses sementara, tidak akan ada pembaruan atau perbaikan bug lebih lanjut.
Deskripsi operasi
Prasyarat
Anda membuat API layanan data melalui layanan data Quick BI. Untuk detail lebih lanjut, lihat Layanan Data.
Batasan Penggunaan
Fitur layanan data hanya tersedia untuk pelanggan edisi profesional.
Batas waktu (timeout) untuk panggilan API layanan data adalah 60 detik, dan QPS untuk satu API adalah 10 kali/detik.
Jika izin tingkat baris (row-level) diaktifkan pada dataset yang dirujuk oleh API layanan data, panggilan API dapat dicegat oleh kebijakan izin tingkat baris.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
quickbi-public:QueryDataService |
get |
*All Resource
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| ApiId |
string |
Yes |
ID API di layanan data. Untuk informasi lebih lanjut, lihat Layanan Data. |
f4cc43bc3*** |
| Conditions |
string |
No |
Kondisi query untuk layanan data, dikirim sebagai pasangan Key-Value. Ini adalah string bertipe map. Di sini, Key adalah nama parameter permintaan, dan Value adalah nilai parameter permintaan. Key dan Value harus muncul secara berpasangan. Catatan:
|
{ "area": ["华东", "华北"], "shopping_date": "2019Q1", } |
| ReturnFields |
string |
No |
Daftar nama parameter yang akan dikembalikan, sebagai string bertipe List. |
["area", "city", "price", "date"] |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
|||
| Success |
boolean |
Menunjukkan apakah permintaan berhasil. Nilai yang mungkin:
|
true |
| RequestId |
string |
ID permintaan. |
78C1AA2D-9201-599E-A0BA-6FC462E57A95 |
| Result |
object |
Mengembalikan hasil dari query antarmuka. |
|
| Headers |
array<object> |
Header kolom. |
|
|
object |
|||
| Aggregator |
string |
Aggregation operator. Only present for measure fields, such as SUM, AVG, and MAX. |
SUM |
| Column |
string |
Field name, corresponding to the physical table field name. |
具体的物理字段名 |
| DataType |
string |
The data type of the field. Common types include number, string, date, datetime, time, and geographic. |
string |
| Granularity |
string |
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:
|
yearRegion |
| Label |
string |
Alias for the field, serving as the key in the map data row of the values parameter. |
area |
| Type |
string |
Field type, used to distinguish between dimension and measure fields. |
StandardDimension |
| Sql |
string |
SQL dari permintaan query. |
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_ WHERE COMPANY_T_1_.`area` LIKE '%华东%' GROUP BY COMPANY_T_1_.`area`, COMPANY_T_1_.`city` HAVING SUM(COMPANY_T_1_.`order_amt`) > 1 LIMIT 0, 10 |
| Values |
array<object> |
Hasil query yang dikembalikan. |
|
|
object |
Baris dan kolom dari data yang dikembalikan. Parameter ini adalah struktur List |
[{"area":"华东","city":"三明市"},{"area":"华东","city":"上海市"}] |
Contoh
Respons sukses
JSONformat
{
"Success": true,
"RequestId": "78C1AA2D-9201-599E-A0BA-6FC462E57A95",
"Result": {
"Headers": [
{
"Aggregator": "SUM",
"Column": "具体的物理字段名",
"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_ WHERE COMPANY_T_1_.`area` LIKE '%华东%' GROUP BY COMPANY_T_1_.`area`, COMPANY_T_1_.`city` HAVING SUM(COMPANY_T_1_.`order_amt`) > 1 LIMIT 0, 10",
"Values": [
[
{
"area": "华东",
"city": "三明市"
},
{
"area": "华东",
"city": "上海市"
}
]
]
}
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | API.No.Permission | You are not authorized to call the data service API operation. | |
| 400 | API.Not.Exist | The data service API operation does not exist. | |
| 400 | Cube.Not.Exist | The Cube does not exist. | |
| 400 | Invalid.Parameter.Conditions | The specified Conditions is invalid. %s is not defined. | |
| 400 | Invalid.Parameter.ReturnFields | The specified returnFields is invalid. %s is not defined. | |
| 400 | Missing.Conditions | The specified Conditions is invalid. You must specify %s. | |
| 400 | Missing.Dimension.Measure | 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. | |
| 400 | Datasource.Sql.ExecuteFailed | Failed to execute the SQL statement in the data source. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.