This topic describes how to add an Alibaba Cloud API Gateway data source in DataV and explains the parameter settings. Alibaba Cloud API Gateway is a hosted API service that provides full lifecycle management, including API publishing, management, operations and maintenance (O&M), and sales.
Prerequisites
An Alibaba Cloud API Gateway data source is available.
Add an Alibaba Cloud API Gateway data source
Log on to the DataV console.
On the My Data tab, select Data Source Management and click Add Data.
From the Type list, select Alibaba Cloud API Gateway.
Enter the API Gateway information.
Parameter
Description
Name
The display name of the data source. You can enter any name.
Domain Name
The domain name used to call the API Gateway. You can find this in the API Gateway console.
AppKey
The AppKey used to call the API Gateway API. For more information, see Create Application to obtain the AppKey for the API.
AppSecret
The AppSecret used to call the API Gateway API. For more information, see Create Application to obtain the AppSecret for the API.
Enter the information and click OK to add the data source.
The new data source appears in the data source list.
Use an Alibaba Cloud API Gateway data source
Log on to the DataV console.
On the My Visualization page, hover the pointer over the visualization application that you want to edit, and then click Edit.
ImportantIf you do not have any visualization applications on the My Visualization page, create one. For more information, see Create a PC visualization application using a template.
On the canvas editor page, click a widget on the canvas.
If the canvas does not have any widgets, add one. For more information, see Add an asset.
On the right side of the canvas, in the widget configuration pane, select Data and click Configure Data Source.
On the Set Data Source page, you can set Data Source Type to Alibaba Cloud API Gateway.
From the Select Existing Data Source list, select the Alibaba Cloud API Gateway data source.
Select a request method from the HTTP Method drop-down list. The options are GET, POST, PATCH, PUT, DELETE, HEAD, or OPTIONS. For more information about these request methods, see Common Request Methods.
In the Request URL text box, enter the API path.
Based on your selection from the HTTP Method list, you can enter the corresponding values in the Header and Body sections.
Click Preview Data Source Response to view the response data.
Example
Obtain an Alibaba Cloud API Gateway API.
Alibaba Cloud API Gateway is a user-facing product. You can obtain an API Gateway API in one of the following two ways:
Host your API on API Gateway and call it from DataV. For more information about the connection type, see the official Alibaba Cloud API Gateway documentation.
Purchase an API service, such as an IP-based location service, from the Alibaba Cloud Marketplace. Then, call the service from DataV to retrieve the results.
Configure the API data source in DataV and display the results in a visualization application.
This example uses an API service from the Alibaba Cloud Marketplace. The configuration procedure is as follows:
Purchase an API service from the Alibaba Cloud Marketplace.
After you complete the purchase, go to the API Gateway Management Console. Find the AppKey and AppSecret for the API and enter them in the DataV data source settings.
Obtain the domain name, path, and parameters for the API service. Query the API definition on the API description page.
The following example shows the information that is available for the IP-based location API.
Domain Name: iploc.market.alicloudapi.com
Request URL: /v3/ip
Request Parameter: ip
Configure the data source.
Enter the query parameters.
View the query results.
Use callback parameters.