How to read Data from an Asset in Insights hub(mindsphere) using mendix

0
Hi,  I did the mendix academy "Build a mindsphere app with mendix", but I still dont quite get how to get the data from my assets. (During the course, a lot was already done for you).   So I have made an Agent Asset, and an other asset that is connected to the agent, to read read data coming from a node-red application. And I have these databits I would like to read (and change) with mendix, but i dont know how to do so.   i do have a working app with a asset viewer, but dont know how to get the data from the asset.   So if anyone knows how to read the data from the assets, please let me know.   Thanks in advance :)
asked
2 answers
0

You get the data for an asset by calling the REST service with the correct parameters in a microflow. For example:

image.png

The REST call is to https://gateway.eu1.mindsphere.io/api/iottimeseries/v3/timeseries in this case

The API is documented here: https://documentation.mindsphere.io/MindSphere/apis/iot-iottimeseries/api-iottimeseries-api.html

 

answered
0

Hi Luuk,

 

the URL http://localhost:8080/api/iottimeseries/v3/timeseries/<YOUR_ASSET_ID>/Metrics assumes that you like to fetch data from an asset which have the aspect Metrics. Please replace Metric with the name of your aspect, the aspect name can be found within the Asset Manager of Insights Hub. The generic URL would be http://localhost:8080/api/iottimeseries/v3/timeseries/<YOUR_ASSET_ID>/<YOUR_ASPECT_NAME>

More information about Insights Hub APIs can be found at https://documentation.mindsphere.io/MindSphere/apis/index.html for IOT raw values please see https://documentation.mindsphere.io/MindSphere/apis/iot-iottimeseries/api-iottimeseries-overview.html.

answered