Connecting to REST API

Last updated: Mar 17, 2025
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 have a choice of two methods for setting a connection to the REST API data source: the Sample property method and the Model file method.
    Sample property method
    If you are using the Sample property method, specify an endpoint for your hostname, such as this example URL: https://domain.example.com/api/v1/employee_name. The Sample property method allows access to data from a single endpoint with minimal configuration. You do not need to provide a Model file.
    Model file method
    • If you are using the Model file method, 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 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.
      Using other authentication methods (Basic, None, or Bearer Token)

      To use other authentication methods, complete this step.

      1. In Credentials, select your authentication method (Basic, None, or Bearer Token) and provide the required credentials.
  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.