Connecting to REST API

The REST API connector requires specific information to create a connection to it in Data Virtualization.

For more information, see Data sources in object storage in Data Virtualization.

Before you begin

You need the following connection details to set a connection with REST API:
  • Hostname URL

Procedure

To connect with REST API in Data Virtualization, follow these steps.

  1. On the navigation menu, click Data > Data virtualization. The Data sources page appears.

  2. Click Add connection > New connection to view a list of data sources.

  3. Select the REST API data source connection.

  4. Enter the connection name and description.

  5. Enter the URL for your host database. You can se a connection to the REST API data source by using a sample property method or the model file method.
    Sample property method
    Specify an endpoint for your hostname, such as this example URL: https://domain.example.com/api/v1/employee_name. This method allows access to data from a single endpoint with minimal configuration. You do not need to provide a Model file.
    Model file method
    Note: You can download the Autonomous REST Composer (ARC) tool to create and edit model files. Go to the Data sources page and select Add connection > Download ARC tool.
    • Enter the Base URL of your hostname (https://domain.example.com) to allow access to data from multiple endpoints.
    • For this method, you need to manually create the Model file and then paste the file into the Model file field. To create your Model file and map your endpoints to tables, follow the steps in Model file syntax. For reference on the basic format for mapping endpoints to tables, see the example in Creating a Model file.
    • You can modify your Model file to fit your environment, such as how the driver processes HTTP status codes or the different configurations for GET requests. For the REST API data source, you do not need a POST request or authentication object as shown in the Example model file.
  6. Complete any of the following tasks.

    Using an authentication method
    1. Select your authentication method from the list:
      • Basic Authentication
      • Bearer token
      • None
      • Open Authentication 2.0 (OAuth2)
    2. Provide the required credentials.
    Using API key authentication that is configured as a query parameter
    To use API key authentication, ensure your data source supports API key passing as a query parameter before you complete these steps.
    1. To use API key authentication, add the API key directly to the host URL.
      For example: In this example URL, you would replace <your_api_key> with the API key.
      https://api.example.com/resource?apikey=<your_api_key>
    2. In Credentials, select None as your authentication method.
    Using API key authentication that is configured as a header parameter
    To use API key authentication that is configured as a header parameter, complete these steps.
    1. In the Additional properties field, enter the following parameter. Replace <your_api_key> with the API key.
      AuthenticationMethod=HttpHeader;SecurityToken=ApiKey<your_api_key>
    2. In Credentials, select None as your authentication method.
    Creating a new REST API connection to a URL that is behind a proxy
    To create a connection to a REST API URL that is behind a proxy, complete these steps when creating a new REST API connection.
    1. Conditional step: If the URL that is behind a proxy requires SSL certificate validation, then ensure you upload the SSL certificate, regardless of whether or not you check off Validate the SSL certificate. To upload the certificate, complete the workaround steps in Creating a REST API connection with public CA authentication fails when passed through a proxy server.
    2. Provide these properties in the Additional properities field:
      Note: Only include ProxyUser=<User>;ProxyPassword=<Password>; if the proxy server requires basic authentication.
      • Replace <Host> with the server name and IP address used to identify the proxy server for the connection in the format: server_name | IP_address. See also ProxyHost.
      • Replace <Port> with the port number where the proxy server is listening for HTTP or HTTPS requests for the specified connection. See also ProxyPort.
      • Replace <User> with the user name needed to connect to the proxy server for the specified connection. See also ProxyUser.
      • Replace <Password> with the password needed to connect to the proxy server for the specified connection. See also ProxyPassword.
      ProxyHost=<Host>;ProxyPort=<Port>;ProxyUser=<User>;ProxyPassword=<Password>;
  7. If the connection requires a custom SSL certificate, enter the certificate in the SSL certificate field.

  8. Click Create to add the connection to the data source environment.

Results

You can now use REST API as a data source in Data Virtualization.