The Data connector JSON Get uses a GET method to request content from an URL, expecting a JSON file in it.
Requirements
While some APIs are publicly available, there are other ones requiring authentication. Keep in mind:
- The App ID or authentication token needs to be added to the URL.
- Authentication based on headers IS NOT supported
Adding the Data Connector to the Graphics Editor
First, you need to add an External Connector to your tree (1) and then click on Connect (2)
From the External Source panel choose JSON Get (if it's not listed contact your designated Customer Success Manager).
Setting up the JSON Get
You will be asked to complete de dataset settings:
- Acquisition Style: select how to control the data update. That means you control when data is updated either by syncing from the remote control (Attended) or automatically data updated periodically (Unattended)
- JSON URL: Add the URL that hosts the JSON content
- JSON Schema: After you've added the URL, the Schema will be auto-generated and displayed within an editable field.
Even though the JSON Schema is inferred automatically, you must review it. In the case of images, URLs will probably be inferred as a string and not ImageUrL. In order to retrieve images coming from a URL, you need to change the Schema from "type": "string" to "type": "ImageUrl"
JSON Get example graphics
With the data now set up, you can start creating your tree with our building blocks, binding content, and formatting the Graphics. In this example, we use the following URL:
https://api.npoint.io/e9cd5ed0e0c0f3fcfdfc
In the example, we created a "Scorebug" for a baseball game with the information of the previous Json.