Skip to content

IoT Time Series Bulk Service – Samples

Importing Simulation Data

To import high frequency simulation data from the IoT File Service, use the following endpoint:

1
POST /api/iottsbulk/v3/importJobs

Sample request:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
POST /api/iottsbulk/v3/importJobs HTTP/1.1
Host: gateway.eu1.mindsphere.io
Content-Type: application/json
Accept: application/json
Authorization: Bearer {token}
{
  "data": [
    {
      "entity": "978528e7a124458f87c8f1d38fd9400f",
      "propertySetName": "tireMonitor",
      "timeseriesFiles": [
        {
          "filePath": "Demo/SampleFile1.json",
          "from": "2018-09-21T15:00:01.787000Z",
          "to": "2018-09-21T15:05:50.633015Z"
        },
        {
          "filePath": "Demo/SampleFile2.json",
          "from": "2018-09-21T15:07:00.795015Z",
          "to": "2018-09-21T15:11:40.417015Z"
        }
      ]
    }
  ]
}

After validation checks, the service returns a location header with the associated import job ID.

Checking the Import Status

The import job ID can be used for import status checks, e.g.:

1
2
3
4
GET /api/iottsbulk/v3/importJobs/978528e7a124458f87c8f1d38fd9400f HTTP/1.1
Host: gateway.eu1.mindsphere.io
Accept: application/json
Authorization: Bearer {token}

Sample response:

1
2
3
4
5
6
7
8
9
[
    {
        "id": "978528e7a124458f87c8f1d38fd9400f",
        "status": "SUBMITTED",
        "message": "<message>",
        "startTime": "2018-11-01T14:48:37.056Z",
        "lastModified": "2018-11-01T14:48:37.056Z"
    }
]

Retrieving Simulation Data

To retrieve high frequency simulation data from the IoT File Service, use the following endpoint:

1
https://gateway.{region}.mindsphere.io/api/iottsbulk/v3/iottimeseries/{assetId}/{aspectName}

Sample request:

1
2
3
4
GET /api/iottsbulk/v3/iottimeseries/978528e7a124458f87c8f1d38fd9400f/tireMonitor?from=2018-11-01T10:00:00.050000Z&to=2018-11-01T10:00:05.000000Z&select=pressure,temperature HTTP/1.1
Host: gateway.eu1.mindsphere.io
Accept: application/json
Authorization: Bearer {token}

Sample response:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
{
"records": [
    {
        "pressure": 94,
        "pressure_qc": 192,
        "temperature": 45,
        "_time": "2018-11-01T10:00:00.051035Z"
    },
    {
        "pressure": 95,
        "pressure_qc": 192,
        "temperature": 45,
        "_time": "2018-11-01T10:00:00.052070Z"
    },
    ...
],
"nextRecord": "https://gateway.{region}.mindpshere.io/api/iottsbulk/v3/iottimeseries/978528e7a124458f87c8f1d38fd9400f/tireMonitor?from=2018-11-01T10:00:02.000000Z&to=2018-11-01T10:00:05.000000&select=pressure,temperature"
}

Deleting Simulation Data

Simulation data is deleted using the IoT Time Series Service via the following endpoint:

1
DELETE /api/iottimeseries/v3/timeseries/{assetid}{aspectname}

Sample request:

1
2
3
4
DELETE /api/iottimeseries/v3/timeseries/978528e7a124458f87c8f1d38fd9400f/tireMonitor?from=2018-11-01T10:00:00Z&to=2018-11-01T11:00:00Z HTTP/1.1
Host: gateway.eu1.mindsphere.io
Accept: application/json
Authorization: Bearer {token}

Info

Currently, only full hours of simulation data can be deleted and the time range must start and end at the top of an hour.

Any questions left?

Ask the community


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