视觉智能开放平台-自学习_SDK中心

viapi-regen
API Version:
2021-11-19
SDK Generation:
V2.0Recommended
View Generation Differences
All languages:

Overview

The sample code in the document is for reference only. For more information about how to use the SDK, see SDK example and OpenAPI documentation.

Latest Stable Version

Environmental requirements

  • You must use Java 8 or later.

Installation Method

Background information

  • The following sample code shows how to use the Darabonba Java SDK. In this example, the CreateDataset API operation is called to initiate the Create a data set request.

Sample code

The SDK for Java provides the following sample code.


Procedure

  1. Initialize the com.aliyun.teaopenapi.models.Config object. The Config object stores configuration parameters such as AccessKeyId, AccessKeySecret, and Endpoint. For more information about endpoints, see viapi-regen.cn-hangzhou.aliyuncs.com in the example.

  1. Instantiate a client object from the com.aliyun.viapi_regen20211119.Client class. Generate subsequent requests and responses from the com.aliyun.viapi_regen20211119.models class.

  1. Create a request based on the required API operation. The class name is in the [APIName]Request format. Example:

  1. Set parameters for the request class. You must set the required properties for the request class.

  1. Obtain a response by using the client object.

  1. Obtain a response parameter by calling the corresponding property. Example:

  1. Use the catch() syntax to handle errors.