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 HUAWEI 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
- Log in to the DLV console and click the Screens tab.
- 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
- 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.
- On the Data panel, set Data Source Type to API.
- Enter a complete URL in the editing area.
DLV supports only HTTPS-based API requests.
Figure 2 Creating an API data source
- Click Preview Response Result to view the data response result.
Figure 3 Viewing the response result
- Configure the field mapping based on the attribute name of the response data.
Figure 4 Configuring the mapping
- View the effect of the configured screen component.
Figure 5 Screen effect
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot