If a data source can be connected by using APIs, you can use the RestAPI (HTTP) feature of Alibaba Cloud DataWorks to connect to the data source and integrate data. Before you use this feature to integrate data, you must add a RestAPI data source. This topic describes how to add a RestAPI data source.

Limits

RestAPI data sources support only exclusive resource groups for Data Integration. For more information, see Create and use an exclusive resource group for Data Integration.

Procedure

Workspaces in standard mode support the data source isolation feature. You can add data sources separately for the development and production environments to isolate the data sources. This helps keep your data secure. 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 data sources separately for the development and production environments:

  1. Go to the Data Source page.
    1. Log on to the DataWorks console.
    2. In the left-side navigation pane, click Workspaces.
    3. After you select the region where the required workspace resides, find the workspace and click Data Integration in the Actions column.
    4. In the left-side navigation pane of the Data Integration page, choose Data Source > Data Sources to go to the Data Source page.
  2. On the Data Source page, click Add data source in the upper-right corner.
  3. In the Add data source dialog box, click RestAPI in the Semi-structured storage section.
  4. In the Add RestAPI data source dialog box, configure the parameters.
    restapi
    Parameter Description
    Data Source Name The name of the data source. The name can contain letters, digits, and underscores (_) and must start with a letter.
    Data source description The description of the data source. The description can be a maximum of 80 characters in length.
    Connection Type The network connection type. Select a network connection type based on the network environment of the data source.
    Environment The environment in which the data source is used. Valid values: Development and Production.
    Note This parameter is displayed only when the workspace is in standard mode.
    Url The URL of the RESTful API.
    Default header The content of the header in each request that is transferred to the URL.
    Auth method The authentication method. The RestAPI feature supports the following authentication methods: Basic Auth, Token Auth, No 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.
    • Basic Auth: basic authentication

      If the data source supports username- and password-based authentication, you can select Basic Auth and configure the username and password that can 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 is successful.

    • Token Auth: token-based authentication

      If the data source supports token-based authentication, you can select Token Auth and configure a fixed token value that can 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 is successful.

    • 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 that can be used for authentication: The data source that you want to connect is an Alibaba Cloud service, and the API of this service supports AccessKey pair-based authentication.

  5. Set Resource Group connectivity to Data Integration.
  6. Find the desired resource group in the resource group list in the lower part of the dialog box and click Test connectivity in the Actions column.
    A synchronization node can use only one type of resource group. To ensure that your synchronization nodes can be normally run, you must test the connectivity of all the resource groups for Data Integration on which your synchronization nodes will be run. If you want 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 Select a network connectivity solution.
    Note You can use only exclusive resource groups. For more information about exclusive resource groups for Data Integration, see Create and use an exclusive resource group for Data Integration.
  7. After the data source passes the connectivity test, click Complete.

What to do next

After you add a RestAPI data source, you can configure a synchronization node for the data source by using the codeless user interface (UI) or code editor.