Help Center/ ROMA Connect/ User Guide/ Data Source Management/ Connecting to an API Data Source
Updated on 2024-05-07 GMT+08:00

Connecting to an API Data Source

Overview

ROMA Connect can use API as a data source for data integration tasks. Before using the API data source, you need to connect it to ROMA Connect.

Prerequisites

Each connected data source must belong to an integration application. Ensure that an integration application is available before connecting a data source, or create one first.

Procedure

  1. Log in to the ROMA Connect console. On the Instances page, click View Console of an instance.
  2. In the navigation pane on the left, choose Data Sources. In the upper right corner of the page, click Access Data Source.
  3. On the Default tab page, select API and click Next.
  4. Configure the data source connection information.
    Table 1 Data source connection information

    Parameter

    Description

    Name

    Enter a data source name. Using naming rules facilitates future search.

    Encoding Format

    Default: utf-8

    Integration Application

    Select the integration application to which the data source belongs.

    Description

    Enter a brief description of the data source.

    Address

    Enter the request URL of the API, for example, https://example.com/test.

    NOTE:

    If the API to be accessed is created during service integration, you are advised not to use the default subdomain name because it can only be called 1000 times every day. If the number of access times exceeds the limit, data sources will fail to be connected. You are advised to use an independent domain name to access the API.

    Request Mode

    Select the request method of the API.

    Authentication Mode

    Select the authentication method of the API.

    • None: No authentication is required. Any user can call the API.
    • Basic Auth: The username and password are used for authentication. APIs can be called only after the authentication is successful.
      • Username: Enter the username required for basic authentication.
      • Password: Enter the password required for basic authentication.
    • AppKey Auth: The AppKey and AppSecret are used to sign the request. The API can be called only after the signature verification is successful.
      • App Authentication Type

        Default: The AppKey and AppSecret are used to sign the request. The API can be called only after the signature verification is successful. This mode is used by default for APIs of APIC.

        Secret: The AppKey and AppSecret are used to authenticate the request.

        Jwt: The AppKey, AppSecret, and the API calling timestamp are used to generate signature information, and the AppKey, signature and timestamp are used for authentication.

      • AppKey: Enter the AppKey required for AppKey authentication.
      • AppSecret: Enter the AppSecret required for AppKey authentication.
    • OAuth 2.0: When an API is called, the request header must contain the authorization information. The API can be called only after the secret in the header is successfully verified.
      • Authorization Type: The token information for authorization is obtained through the access token URL. Select an authorization type.
      • Access Token URL: Enter the access token URL of OAuth 2.0 authentication.
      • Client ID: Enter the client ID required for OAuth 2.0 authentication.
      • Client Key: Enter the client key required for OAuth 2.0 authentication.
      • Scope: This parameter is used to define the permission of the application on the API.
    • Secret: A password is used for authentication. The request header carries the secret information. The API for obtaining the secret information in the header can be called only after being verified.

      Secret: Enter the secret required for secret authentication.

    • MD5: The verification information signature is obtained after the body parameters are encrypted. The request body carries the signature information. The API for obtaining the signature information can be called only after being verified.

      Secret: Enter the secret required for MD5 authentication.

    • HMAC: The verification information signature is obtained after the body parameters are encrypted. The request body carries the signature information. The API for obtaining the signature information can be called only after being verified.

      Secret: Enter the secret required for HMAC authentication.

    • Other authentication modes: These authentication modes are customized by business partners, such as Key Top Auth, Hik Vision Auth, and li He Auth. Set the authentication parameters based on the customized authentication mode you select.

    The following is an example of connecting to an API released by ROMA Connect. The API authentication mode is App authentication.

    Set the authentication mode to AppKey Auth, and retain Default for the APP authentication type. AppKey and AppSecret are the key and secret of the integration application authorized by the API.

    Figure 1 API data source configuration example
  5. Click Check Connectivity to check the connectivity between ROMA Connect and the data source.
    • If the test result is Data source connected successfully, go to the next step.
    • If the test result is Failed to connect to the data source, check whether the address, request mode, authentication mode, AppKey, and AppSecret are correct, and whether the API can be accessed. Then, click Recheck until the connection is successful.
  6. Click Create.