The Autonomous REST Connector uses sampling to normalize the JSON responses from REST APIs and make them available as relational tables. It empowers you to use the full capabilities of SQL, including joining data from different endpoints.

To get you started with the Autonomous REST Connector, in this tutorial, we will walk you through the process of connecting to a REST service from Tableau. This tutorial will give you an overview of how flexible Autonomous REST Connector is and how it works.

We will also use the Composer interface for the Autonomous REST Connector—which allows us to easily expose response data from multiple REST endpoints as tables that can be queried via standard SQL. The Composer interface is available as part of the Autonomous REST Connector for Windows platforms.

For the purposes of demonstration, we will use the REST API for SpaceX project as our data source for this tutorial. The SpaceX project is an open-source service that is free to use and does not require authentication credentials—which allows us to begin accessing data immediately.

This tutorial covers the following:

Note: The purpose of this tutorial is to generally demonstrate accessing data from one or more endpoint(s) with the Autonomous REST Connector. However, if you want to connect to a publicly available REST service (such as Aha!, HubSpot, Jira, etc.), we recommend using the prebuilt Model files that are included with the connector. For details, refer to Getting started using prebuilt Model files (Windows).

Download and install the Autonomous REST Connector for Windows

  1. Navigate to the Autonomous REST Connector for ODBC page and select a Windows 32-bit or 64-bit connector to download. We recommend using the 64-bit driver if supported in your environment; however, Tableau supports either bitness.
  2. When prompted, provide your details, such as name and email address; then, click DOWNLOAD.
  3. Download the connector zip file and extract its contents into a temporary directory; then, double-click the installer program:
    • For 32-bit connectors: PROGRESS_DATADIRECT_ODBC_8.0_WIN_32_INSTALL.exe
    • For 64-bit connectors: PROGRESS_DATADIRECT_ODBC_8.0_WIN_64_INSTALL.exe
  4. Follow the prompts to complete the installation.

Create an ODBC Data Source

  1. Start the ODBC Administrator by selecting its icon from the Progress DataDirect for ODBC program group.
  2. On the ODBC Administrator, select the User DSN tab, and then click Add to display a list of installed drivers. Select DataDirect 8.0 Autonomous REST Connector and click Finish.
  3. The Configuration Manager appears in your default browser. On the Connection tab, specify values for the following fields:
    • Data Source Name: Specify a name for the data source you are creating. For example, SpaceX.
    • REST Sample Path: Specify the endpoint you want to connect to. For example, if you want to connect to the launches endpoint, specify:
       https://api.spacexdata.com/v5/launches
    • Table: Launches

  4. Click Test Connect to connect to the SpaceX API. The Test Connect window opens. Optionally, execute queries in the Test Query field. For example:
    SELECT * FROM LAUNCHES
  5. Click Save.

Connect from Tableau

  1. Navigate to the \tools\Tableau subdirectory of the Progress DataDirect installation directory; then, locate the following Tableau data source file:
    DataDirect Autonomous REST Connector.tdc
  2. Copy the Tableau data source file into the following directory:
    C:\Users\user_name\Documents\My Tableau Repository\Datasources
  3. Open Tableau. If the Connect menu does not open by default, select Data > New Data Source or the Add New Data Source button to open the menu.
  4. From the Connect menu, select Other Databases (ODBC).
  5. In the DSN field, select the data source you created in the Configuration Manager. Click Connect; then, Sign In. Your Tableau Book window opens.
  6. In the Schema field, select AUTOREST. The tables stored in this schema are now available for selection in the Table field. For example, from the Table field, try dragging the LAUNCHES table into the canvas to view data restored in the JSON response from the REST API as relational data.

Result: You have successfully accessed your data and are now ready to create reports with Tableau. For more information, refer to the Tableau product documentation at: http://www.tableau.com/support/help.

Connect to multiple endpoints

To connect to multiple endpoints using Autonomous REST Connector:

  1. Open the Autonomous REST Composer by using one of the following methods:
    • Select the Autonomous REST Composer (ODBC) icon from your desktop or the Windows Start menu.
    • From a command line, navigate to the directory containing the autorest.jar file and execute the following command:
      java -jar autorest.jar --odbcdesign

      By default, the autorest.jar file is stored in the following directory: install_dir\Progress\DataDirect\ODBC\java\lib\.


    Hub window for the Autonomous REST Connector Autonomous REST Composer

  2. Select Create Model. The Create a Model window appears.
    Figure 1. The Create Model Window

    The New Project dialog

    Complete the following fields to create a new project; then, click OK:
    • Model Name: The name of your Model file to be created. For example: Space X.
    • Model Description: An optional description of your Model. Note that this description will be stored in clear text in the Model file.
    • Base URL: The host name portion of your REST endpoints. For example: https://api.spacexdata.com
      Note: The Base URL field is optional. You can also specify the base URL in the Host Name field on the Connection tab. Specifying a value in either location pre-populates the base URL in the Endpoints field(s) of the Configure Endpoints tab. Alternatively, you can also enter the entire URL for your endpoint into the Endpoints field.

    The Composer opens to the Connection tab.

    Figure 2. The Connection tab

    The Connection tab

    Note: Typically, the Connection tab is used to configure your authentication settings; however, for the data source used in this tutorial, no authentication settings are required.
  3. Select the Configure Endpoints tab on the side menu.
    Figure 3. The Configure Endpoints tab

    The Edit the tab

    Provide the minimum required information for an endpoint to which you want to issue requests:

    • From the Endpoint drop-down menu, select the type of request to issue against your endpoint. For example: GET.
    • In the Endpoint field, type your endpoint. Note that the value must be URL-encoded using valid syntax. For example, spaces in an endpoint are replaced with %20.
      Note: If you provided a base URL using the Base URL field or Host Name option, specify only the path portion of your endpoint.
    • In the Table Name field, type the name of the relational table to which you want the endpoint to map. For example: LAUNCHES.
    • Optionally, in the JSON Root fields, type or edit the path to an embedded object that contains the results you want mapped to a dedicated relational table. You can use this option to expose only data starting at a nested field within a JSON response.
      Note: During sampling, the driver specifies a default value for this field when it detects an embedded object that meets the criteria for a JSON root. Depending on the structure of your data model, you might want to add, edit, or remove values for this field.

      For example, for the following JSON response, if you want to expose only the resultsArray data in a table named RESULTS, specify a JSON Root value of /resultsArray and a Table Name of RESULTS.

      {
       "rootLevelField1": "exampleValue1", 
       "rootLevelField2": "exampleValue2", 
       "rootLevelField3": "exampleValue3", 
       "resultsArray": [ 
           {
                              "id": 1, 
                              "data": "exampleResults1" 
           }, 
           { 
                              "id": 2, "data": 
                              "exampleResults2" 
          } 
        ] 
      } 
      
      Results: The data is displayed in a tabular format in the SQL View. The Raw View tab displays the JSON response body that was received from making the REST API call to the endpoint.
      Note: Multiple tables might be mapped from a single endpoint. As a result of normalizing JSON data into a relational view, the driver exposes embedded array data as child tables. Conversely, parent tables are comprised of fields defined at the root level of the JSON response. A foreign key relationship to the parent table is provided by exposing the primary key of the parent in the child. You can use SQL JOIN syntax to rejoin the data of the parent and child tables into a single result set.
  4. Click Send. The driver sends the REST request and generates a relational view of the data based on the response. To add additional endpoints, click in the + button the request list on the left.
    For testing purposes, add the following endpoints:
    Table 1. SpaceX Endpoints
    Table Name Endpoint
    CAPSULES https://api.spacexdata.com/v4/capsules
    COMPANY https://api.spacexdata.com/v4/company
    CORES https://api.spacexdata.com/v4/cores
    CREW https://api.spacexdata.com/v4/crew
    DRAGONS https://api.spacexdata.com/v4/dragons
    HISTORY https://api.spacexdata.com/v4/history
    LANDPADS https://api.spacexdata.com/v4/landpads
    LAUNCHES https://api.spacexdata.com/v5/launches
    LAUNCHPADS https://api.spacexdata.com/v4/launchpads
    PAYLOADS https://api.spacexdata.com/v4/payloads
    ROADSTER https://api.spacexdata.com/v4/roadster
    ROCKETS https://api.spacexdata.com/v4/rockets
    SHIPS https://api.spacexdata.com/v4/ships
    STARLINK https://api.spacexdata.com/v4/starlink
  5. Click Download to generate and download your Model file. After downloading, move your Model file from the downloads folder to a directory that you have access to on your machine.
  6. Open the ODBC Administrator and then double-click the data source you have created. The Configuration Manager appears.
  7. On the Connection tab of the Configuration Manager:
    1. Clear the REST Sample Path field’s value.
    2. In the REST Config File field, specify the fully qualified path and file name for the Model file you downloaded.
  8. Click Update.
  9. Open Tableau and reconnect to the data source.

Result: An updated list of tables is available based on the JSON responses from the endpoints defined in the Model file.