Sending data to Insights Hub (Mindsphere)

0
Hi,   I want to be able to send data to my asset(s) on Insights Hub so i can change these ints using my mendix application.   these are the names of my assets:   And i hve been trying to do a PUT request to change to send the data on insights hub. Using this URL: 'https://southgate.eu1.mindsphere.io' + '/api/iottimeseries/v3' + '/timeseries/' + $AppContext/SelectedAssetId + '/Node_Red_Testing_Data_Aspect' The PUT call uses this export mapping: And when I run it I get error code 415: unsuported media type.   But I can't really find anything about sending data to insights hub (mindsphere), only about reading.    1. Is it possible to send data this way?       if yes: what am I doing wrong?         if no: then how do I send data to my asset(s)?
asked
2 answers
0

Have you added a Content-Type header to your request?

answered
0

Use "https://gateway.eu1.mindsphere.io" as domain. You should use the "GatewayUrl" const from the "SiemensInsightsHubSingleSignOn" module.

 

Provide the authorization header as described here:

https://docs.mendix.com/partners/siemens/mindsphere-development-considerations/#mstoken

 

and provide a "Content-Type" = "application/json" header. 

To figure out the 400 bad request you should check the export mapping, if the exported JSON looks like described in the API documentation:

https://documentation.mindsphere.io/MindSphere/apis/iot-iottimeseries/api-iottimeseries-api.html

 

I think, you have to adopte your export mapping and remove the "root" element. Simply remove the "checkBox" in the export mapping configuration.

answered