Install the SDK

Updated at:
Copy as MD

To call the Raascall API, you need to install the Alibaba Cloud OpenAPI SDK. This topic describes how to install and configure the SDK in Python and Java development environments.

Install the Python SDK

Prerequisites

Python 3.8 or later is required.

Installation steps

The Raascall Python SDK consists of the following three core packages, which must be installed in sequence:

  1. Install alibabacloud-tea-openapi:

    pip install alibabacloud-tea-openapi
  2. Install alibabacloud-tea-util:

    pip install alibabacloud-tea-util
  3. Install alibabacloud-openapi-util:

    pip install alibabacloud-openapi-util

You can also install all dependencies at once with a single command:

pip install alibabacloud-tea-openapi alibabacloud-tea-util alibabacloud-openapi-util

Verify the installation

After the installation is complete, run the following code in the Python interactive environment to verify the installation:

from alibabacloud_tea_openapi import models as open_api_models
from alibabacloud_tea_openapi.client import Client as OpenApiClient
from alibabacloud_tea_util import models as util_models
from alibabacloud_openapi_util.client import Client as OpenApiUtilClient

print("SDK installed successfully!")

If no errors are reported and the confirmation message is displayed, the SDK is installed successfully.

Install the Java SDK

Prerequisites

Java 8 or later is required.

Installation steps

The Raascall uses the Alibaba Cloud OpenAPI generalized invocation SDK (V2.0). You need to add the following dependencies to your project.

Maven

Add the following dependencies to the pom.xml file of your project:

<!-- Core OpenAPI SDK -->
<dependency>
    <groupId>com.aliyun</groupId>
    <artifactId>tea-openapi</artifactId>
    <version>0.3.10</version>
</dependency>

Gradle

Add the following dependencies to the build.gradle file of your project:

dependencies {
    implementation 'com.aliyun:tea-openapi:0.3.10'
}

Verify the installation

After adding the dependencies, create a test class in your project to verify that the SDK is imported correctly:

import com.aliyun.teaopenapi.Client;
import com.aliyun.teaopenapi.models.Config;
import com.aliyun.teaopenapi.models.OpenApiRequest;
import com.aliyun.teaopenapi.models.Params;
import com.aliyun.teautil.models.RuntimeOptions;
import com.google.gson.Gson;

public class SDKTest {
    public static void main(String[] args) {
        System.out.println("SDK installed successfully!");
    }
}

Compile and run the class. If the confirmation message is displayed without errors, the SDK is installed successfully.

What to do next

After you successfully install the SDK, you need to: