Sample Data Sources

We have prepared the following test API endpoints for users to try out SpatialWork data visualisation tools. These endpoints provide randomly generated values for different attributes of different objects and they are refreshed at fixed intervals. The objects can be dynamic or static. Dynamic objects have x, y, z and angle values that determine the position of the object in SpatialWork. Static objects have attributes that are changing as well, though at a less frequent interval as compared to dynamic objects. For example, an air conditioner is a static object in SpatialWork that has the attributes power_consumption and operation_time, both of which will be increasing at fixed intervals.

Each device has a topic associated with it. A topic is how the devices are organised based on their location and whether they are dynamic or static objects. For example, a static object located in Car Manufacturing Plant is under the topic: data/User2/CarManufactoryPlant/ and a dynamic object located in Car Manufacturing Plant is under the topic: data/User2/CarManufactoryPlant/dynamic. Dynamic object topics should always end with “/dynamic”. Currently, there are 3 main topics corresponding to different locations:

  • data/User1/warehouse (location: Warehouse)

  • data/User2/CarManufactoryPlant (location: Car Manufacturing Plant)

  • data/User3/0407Hiverlab (location: 0407 Hiverlab Office)

The output format can be in JSON or CSV, depending on the format you require.

API References:

1. Function: Get latest record of a single device in JSON format

Connection type: REST

HTTP request method: GET

URL (dynamic object):

Response type: JSON

Example:

URL:

Object type: Static

Topic: data/User2/CarManufactoryPlant/es

Device name: ES001

Location: Car Manufacturing Plant

Response:

{
  "data": [
    {
      "id": 34,
      "topic": "data/User2/CarManufactoryPlant/es",
      "device_name": "ES001",
      "category": "Temperature and Humidity",
      "manufacturer": "OMEGA Engineering, Inc.",
      "model": "HH314A",
      "measurement_range": "0 to 100% RH, -20 to 60°C",
      "value": 0.08,
      "datetime": "2023-08-04T15:03:02.000Z"
    }
  ]
}

2. Function: Get latest record of a single device in CSV format

Connection type: REST

HTTP request method: GET

URL (static object):

URL (dynamic object):

Response type: CSV

Example:

URL:

Object type: Static

Topic: data/User2/CarManufactoryPlant/es

Device name: ES001

Location: Car Manufacturing Plant

Response:

"value","datetime" 0.08,"2023-08-04T15:03:02.000Z"

3. Function: Get latest records of all devices under a specific topic in JSON format

Connection type: REST

HTTP request method: GET

URL (static object):

URL (dynamic object):

Response type: JSON

Example:

URL:

Object type: Static

Topic: data/User2/CarManufactoryPlant/es

Device name: -

Location: Car Manufacturing Plant

Response:

{
    "data": [
        {
            "id": 34,
            "device_name": "ES001",
            "topic": "data/User2/CarManufactoryPlant/es",
            "category": "Temperature and Humidity",
            "manufacturer": "OMEGA Engineering, Inc.",
            "model": "HH314A",
            "measurement_range": "0 to 100% RH, -20 to 60°C",
            "value": 0.08,
            "datetime": "2023-08-04T15:03:02.000Z"
        },
        {
            "id": 35,
            "device_name": "ES002",
            "topic": "data/User2/CarManufactoryPlant/es",
            "category": "Air Quality",
            "manufacturer": "OMEGA Engineering, Inc.",
            "model": "Aeroqual Series 500",
            "measurement_range": "0 to 100",
            "value": 48,
            "datetime": "2023-08-04T15:03:02.000Z"
        }
    ]
}

4. Function: Get latest records of all devices under a specific topic in CSV format

Connection type: REST

HTTP request method: GET

URL (static object):

URL (dynamic object):

Response type: CSV

Example:

URL:

Object type: Static

Topic: data/User2/CarManufactoryPlant/es

Device name: -

Location: Car Manufacturing Plant

Response:

"id","device_name","topic","category","manufacturer","model","measurement_range","value","datetime"
34,"ES001","data/User2/CarManufactoryPlant/es","Temperature and Humidity","OMEGA Engineering, Inc.","HH314A","0 to 100%
RH, -20 to 60°C",0.08,"2023-08-04T15:03:02.000Z"
35,"ES002","data/User2/CarManufactoryPlant/es","Air Quality","OMEGA Engineering, Inc.","Aeroqual Series 500","0 to
100",48,"2023-08-04T15:03:02.000Z"

5. Function: Get records of a single device within a period of time in JSON format

Connection type: REST

HTTP request method: GET

URL (static object):

URL (dynamic object):

Response type: JSON

Example:

URL:

Object type: Static

Topic: data/User2/CarManufactoryPlant/es

Device name: ES001

Location: Car Manufacturing Plant

Response:

{
    "id": 34,
    "device_name": "ES001",
    "topic": "data/User2/CarManufactoryPlant/es",
    "device_id": 34,
    "category": "Temperature and Humidity",
    "manufacturer": "OMEGA Engineering, Inc.",
    "model": "HH314A",
    "measurement_range": "0 to 100% RH, -20 to 60°C",
    "records": [
        {
            "value": 0.31,
            "datetime": "2023-08-01T17:20:05.000Z"
        },
        {
            "value": 0.3,
            "datetime": "2023-08-01T17:20:15.000Z"
        }
    ]
}

6. Function: Get records of a single device within a period of time in CSV format

Connection type: REST

HTTP request method: GET

URL (static object):

URL (dynamic object):

Response type: CSV

Example:

URL:

Object type: Static

Topic: data/User2/CarManufactoryPlant/es

Device name: ES001

Location: Car Manufacturing Plant

Response:

"value","datetime"
0.31,"2023-08-01T17:20:05.000Z"
0.3,"2023-08-01T17:20:15.000Z"

7. Function: Get records of all devices under a topic within a period of time in JSON format

Connection type: REST

HTTP request method: GET

URL (static object):

URL (dynamic object):

Response type: JSON

Example:

URL:

Object type: Static

Topic: data/User2/CarManufactoryPlant/es

Device name: -

Location: Car Manufacturing Plant

Response:

[
    {
        "id": 34,
        "device_name": "ES001",
        "topic": "data/User2/CarManufactoryPlant/es",
        "category": "Temperature and Humidity",
        "manufacturer": "OMEGA Engineering, Inc.",
        "model": "HH314A",
        "measurement_range": "0 to 100% RH, -20 to 60°C",
        "records": [
            {
                "value": 0.31,
                "datetime": "2023-08-01T17:20:05.000Z"
            },
            {
                "value": 0.3,
                "datetime": "2023-08-01T17:20:15.000Z"
            }
        ]
    },
    {
        "id": 35,
        "device_name": "ES002",
        "topic": "data/User2/CarManufactoryPlant/es",
        "category": "Air Quality",
        "manufacturer": "OMEGA Engineering, Inc.",
        "model": "Aeroqual Series 500",
        "measurement_range": "0 to 100",
        "records": [
            {
                "value": 52.424,
                "datetime": "2023-08-01T17:20:05.000Z"
            },
            {
                "value": 51.424,
                "datetime": "2023-08-01T17:20:15.000Z"
            }
        ]
    }
]

8. Function: Get records of all devices under a topic within a period of time in CSV format

Connection type: REST

HTTP request method: GET

URL (static object):

URL (dynamic object):

Response type: CSV

Example:

URL:

Object type: Static

Topic: data/User2/CarManufactoryPlant/es

Device name: -

Location: Car Manufacturing Plant

Response:

"id","device_name","topic","category","manufacturer","model","measurement_range","records"
34,"ES001","data/User2/CarManufactoryPlant/es","Temperature and Humidity","OMEGA Engineering, Inc.","HH314A","0 to 100%
RH, -20 to
60°C","[{""value"":0.31,""datetime"":""2023-08-01T17:20:05.000Z""},{""value"":0.3,""datetime"":""2023-08-01T17:20:15.000Z""}]"
35,"ES002","data/User2/CarManufactoryPlant/es","Air Quality","OMEGA Engineering, Inc.","Aeroqual Series 500","0 to
100","[{""value"":52.424,""datetime"":""2023-08-01T17:20:05.000Z""},{""value"":51.424,""datetime"":""2023-08-01T17:20:15.000Z""}]"

Last updated