SDK usage

Updated at:

Quick BI provides SDKs in multiple languages. Download the latest versions and integrate Quick BI API operations into your applications.

SDK overview

Introduction

The Quick BI SDK wraps APIs, authenticates callers with AccessKey pairs, and handles request signing automatically.

Install both the Quick BI SDK and the Alibaba Cloud core library. For the Java SDK, download both aliyun-java-sdk-core and aliyun-java-sdk-quickbi-public.

Prerequisites

  • Download the SDK and review the usage instructions on the Alibaba Cloud SDK page.

  • Available API operations are listed in API overview.

  • Obtain the AccessKey ID and AccessKey Secret for your Alibaba Cloud account.

    Create an AccessKey.

  • Grant the AccessKey user permissions to call Quick BI API operations. Authorization information.

  • To call API operations with the SDK:

    • You have logged on to Quick BI with your Alibaba Cloud account at least once.

    • Your Alibaba Cloud account must have organization administrator permissions in Quick BI. Administrators can grant non-admin users API access from the OpenAPI Platform homepage. Overview > access control.

Supported languages

Quick BI SDKs support Java, Python, C#, and more. Download them from the Alibaba Cloud OpenAPI Platform.

Versions

Version

Release date

Description

2.0.0

2022-03-04

The V2 API operations are region-specific and include all operations from the previous API list.

Note

The previous API list is no longer maintained after the release of the V2 API operations. All new API operations are based on V2.

Related links

The Developer Center provides SDKs with Maven addresses, pip commands, and version details.

Call an SDK

When calling an SDK:

  • Initialize the DefaultAcsClient with your Alibaba Cloud AccessKey ID and AccessKey Secret. Otherwise, the call fails. Example error: code: 404, Specified access key is not found. request id: AA7FE476-F206-5C52-95B3-DF35CD30D468.

  • The AccessKey account must have organization administrator permissions in Quick BI and must have logged on to Quick BI at least once.

Detailed call examples: SDK documentation.

API rate limits

Important
  • The following API operations use version 2022-01-01.

  • These API operations are available for Quick BI on the public and financial clouds.

  • You must have Quick BI Pro or a higher edition to call API operations.

Request rate and timeout

Note
  • Unless otherwise specified, the default API request rate is 50 queries per second (QPS).

  • Unless otherwise specified, the default API call timeout is 10s.

Exceptions to these defaults:

Category

API operation

Limit

Request rate

GetMailTaskStatus

1 QPS

ManualRunMailTask

1 QPS

Timeout

QueryData

60s

QueryDataService

60s

SmartqQueryAbility

180s

Check the SDK version

Set version in pom.xml to the latest version from the SDK download URL.

SDK versions are listed at https://mvnrepository.com/artifact/com.aliyun/aliyun-java-sdk-quickbi-public.

Avoid QPS limit errors

Problem description: All Quick BI API operations in the public cloud have default rate limits. Concurrent calls that exceed the QPS threshold fail.

Solution: Use the RateLimiter class from the Google Guava library to control API request QPS.

  1. For Maven-managed Java projects, add this dependency to pom.xml:

    <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>${google.guava.version}</version>
    </dependency>
    Note

    Use the latest version in pom.xml. Available versions: Guava: Google Core Libraries For Java.

  2. Create a RateLimiter instance.

    Use the create() factory method to initialize a RateLimiter. https://www.baeldung.com/guava-rate-limiter.

    // Creates a RateLimiter that allows 30 QPS.
    RateLimiter rateLimiter = RateLimiter.create(30);
    // Acquires a permit. If the QPS exceeds 30, this call blocks until a permit is available.
    rateLimiter.acquire();
    // Makes the API request only after a permit is acquired.
    doSomeAPIRequest();
Note

QPS (Queries Per Second) is the number of requests or tasks handled per second.

Concurrency is the number of requests processed simultaneously.

QPS = concurrency / average response time.