Skip to content

IoT Time Series Client for Java


The IoT TimeSeries Java client allows you to interact with time series data related to assets. Refer to IoT Time Series for more information about the service.

Further implementation of the IOT TimeSeries SDK library has been shown in a sample project that you can download and test in local or on mindsphere application. Please refer to this repository: mindsphere-java-sdk-examples


In the IoT context, assets are referred to as entity and aspects as propertyset.
Placeholders in the following samples are indicated by angular brackets < >.

Time Series Operations

Client Name: TimeSeriesOperationsClient

Create or update time series data for mutiple unique asset-aspect (entity-property set) combinations

  • Create or update time series data for multiple unique combinations of assets (entities) and aspects (property sets). In case of an update of data at an already existing time, all properties at that time will be replaced by the ones provided in the request. All asset-aspect (entity-property set) combinations need to belong to the same tenant.

Request body limitations:

  1. A maximum of 5 asset-aspect (entity-property set) combinations can be provided
  2. The request body size must be equal or less than 100 kb
  3. A maximum of 100 time series data items can be provided overall
// Construct the PackageProvisioningClient object
  TimeSeriesOperationsClient ts = TimeSeriesOperationsClient.builder().

  CreateOrUpdateTimeseriesRequest createOrUpdateTimeseriesRequest = new CreateOrUpdateTimeseriesRequest();
  TimeSeries timeseries = new TimeSeries();
  TimeSeriesItem timeSeriesItem = new TimeSeriesItem();
  List<TimeSeriesItem> liSeriesItems = new ArrayList<TimeSeriesItem>();
  TimeSeriesItem timeSeriesItem1 = new TimeSeriesItem();
  TimeSeriesDataItem timeSeriesDataItem1 = new TimeSeriesDataItem();
  Map<String, Object> dataMap1 = timeSeriesDataItem1.getFields();
  dataMap1.put("test", 80);
  List<TimeSeriesDataItem> lisDataItems1 = new ArrayList<TimeSeriesDataItem>();

     try {
       MultiStatusError multiStatusError = ts.createOrUpdateTimeseries(createOrUpdateTimeseriesRequest);
      } catch (MindsphereException e) {
      // Exception handling

Create or update time series data

  • Create or update time series data for one combination of an asset (entity) and an(a) aspect (property set). In case of an update of data at an already existing time, all properties at that time will be replaced by the ones provided in the request.
  CreateOrUpdateTimeseriesDataRequest requestObject = new CreateOrUpdateTimeseriesDataRequest();
  TimeSeriesDataItem timeSeriesDataItem = new TimeSeriesDataItem();
  Map<String, Object> dataMap = timeSeriesDataItem.getFields();
  dataMap.put("test", 99);
  // dataMap.put("RLwheel", 98);
  List<TimeSeriesDataItem> lisDataItems = new ArrayList<TimeSeriesDataItem>();

     try {
      } catch (MindsphereException e) {
      // Exception handling

Delete time series data

  • Delete time series data for one combination of an asset (entity) and an(a) aspect (property set). All property values within the given time range are deleted.
  DeleteUpdatedTimeseriesRequest requestObject = new DeleteUpdatedTimeseriesRequest();

     try {
      } catch (MindsphereException e) {
      // Exception handling

Retrieve time series data

  • Retrieve time series data for one combination of an asset (entity) and an(a) aspect (property set). The maximum number of time series data items returned per request is defined by parameter <i>limit</i>. In case more time series data items are present in the requested time range, only a subset of data items will be returned and a header <i>link</i> is added to the response. The header value contains the request URL to fetch the next set of time series data items, by increasing the parameter accordingly. Returns the latest record if no range is provided.
  RetrieveTimeseriesRequest requestObject = new RetrieveTimeseriesRequest();

     try {
       List<TimeSeriesDataItem> response = ts.retrieveTimeseries(requestObject);
      } catch (MindsphereException e) {
      // Exception handling

Any questions left?

Ask the community

Except where otherwise noted, content on this site is licensed under the MindSphere Development License Agreement.

Last update: April 20, 2021