If a data source can be connected by using APIs, you can use the RestAPI feature of
Alibaba Cloud DataWorks to connect to the data source and integrate data. Before you
use this feature to integrate data, you must configure the data source as a RestAPI
data source.
Procedure
Workspaces in standard mode allow you to isolate data sources. You can add data sources
for the development and production environments separately to isolate the data sources.
This ensures data security. For more information, see Isolate connections between the development and production environments.
If you use a DataWorks workspace in standard mode, perform the following steps to
add a data source in the development environment and another data source in the production
environment.
- Go to the Data Source page.
- Log on to the DataWorks console.
- In the left-side navigation pane, click Workspaces.
- In the top navigation bar, select the region where your workspace resides. Find your
workspace and click Data Integration in the Actions column.
- On the page that appears, click Connection in the left-side navigation pane. The page appears.
- On the Data Source page, click New data source in the upper-right corner.
- In the Add data source dialog box, click RestAPI in the Semi-structured storage section.
- In the Add RestAPI data source dialog box, set the parameters as required.

Parameter |
Description |
Data Source Name |
The name of the data source. The name must contain letters, digits, and underscores
(_) and start with a letter.
|
Data source description |
The description of the data source. The description cannot exceed 80 characters in
length.
|
Network connection type |
Select a network connection type based on the network environment of the data source. |
Environment |
Valid values: Development and Production.
Note This parameter is displayed only if the workspace is in standard mode.
|
url |
The RESTful API URL. |
Default header |
The content of the header in each request that is transferred to the URL. |
Auth method |
The RestAPI feature supports the following authentication methods: Basic Auth, Token
Auth, and Aliyun API Signature. You must select an authentication method and configure
the displayed authentication parameters based on the authentication method that is
supported by the data source API.
- Basic Auth: basic authentication
If the data source API supports username and password-based authentication, you can
select Basic Auth and configure the username and password to be used for authentication.
During data integration, the username and password are transferred to the RESTful
API URL for authentication. The data source is connected only after the authentication
succeeds.
- Token Auth: token-based authentication
If the data source API supports token-based authentication, you can select Token Auth
and configure a fixed token value to be used for authentication. During data integration,
the token is contained in the request header, such as {"Authorization":"Bearer TokenXXXXXX"},
and transferred to the RESTful API URL for authentication. The data source is connected
only after the authentication succeeds.
- Aliyun API Signature: Alibaba Cloud API signature-based authentication
If the following conditions are met, you can select Aliyun API Signature and configure
the AccessKey ID and AccessKey secret to be used for authentication: The data source
you want to connect is an Alibaba Cloud service and the API of this service supports
AccessKey pair-based authentication.
|
- On the Data Integration tab, click Test connectivity in the Operation column of each resource group.
A sync node uses only one resource group. To ensure that your sync nodes can be properly
run, you must test the connectivity of all the resource groups for Data Integration
on which your sync nodes will be run. If you need to test the connectivity of multiple
resource groups for Data Integration at a time, select the resource groups and click
Batch test connectivity. For more information, see
Test data store connectivity.
- After the connection passes the connectivity test, click Complete.
What to do next
After you add a RestAPI data source, you can configure a Data Integration node by
using the codeless user interface (UI) or code editor.