Updated on 2023-03-09 GMT+08:00

Creating API Data Connections

You can call a third-party Representational State Transfer (REST) API to obtain source data. The HTTP body in the RESTful API response is the source data. DLV can parse the source data in the response and display it on the screen. Without the need to create a data connection, you can directly configure the URL of the API data source on the Data panel.

Use Restrictions

To connect to data sources through the REST API, ensure that the following conditions are met:

  • The REST API for obtaining source data can communicate with the cloud network.
  • The REST API for obtaining source data can be called only using HTTPS GET requests, and the HTTP body in the API response result must be in JSON format.
  • For the API data sources, DLV parses only level-1 JSON arrays similar to the JSON structure of the static data source. Multi-layer nested JSON structure is not supported.

Using API Data Sources

  1. Log in to the DLV console and click the Screens tab.
  2. On the Screens page, locate the screen to be edited and click on the screen. The screen development page is displayed.

    Figure 1 Editing a screen

  3. Select a component, for example, a bar chart. The component is displayed in the canvas. Click the component and then the Data panel on the right of the page.
  4. On the Data panel, set Data Source Type to API.
  5. Enter a complete URL in the editing area.

    DLV supports only HTTPS-based API requests.

    Figure 2 Creating an API data source

  6. Click Preview Response Result to view the data response result.

    Figure 3 Viewing the response result

  7. Configure the field mapping based on the attribute name of the response data.

    Figure 4 Configuring the mapping

  8. View the effect of the configured screen component.

    Figure 5 Screen effect