workplaceSensorDevice: ingestTelemetry

Namespace: microsoft.graph

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

Ingest sensor telemetry for a workplace sensor device.

This API is available in the following national cloud deployments.

Global service US Government L4 US Government L5 (DOD) China operated by 21Vianet

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) PlaceDevice.ReadWrite.All Not available.
Delegated (personal Microsoft account) Not supported. Not supported.
Application PlaceDeviceTelemetry.ReadWrite.All PlaceDevice.ReadWrite.All

HTTP request

POST /workplace/sensorDevices/ingestTelemetry

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-Type application/json. Required.

Request body

In the request body, supply a JSON representation of the parameters.

The sensorId property may be omitted within the workplaceSensorDeviceTelemetry object for devices with unique sensor types. When this property is omitted, the sensorType value serves as the default identifier, consistent with the behavior when you create a device without a specified sensorId.

The following table shows the parameters that you can use with this action.

Parameter Type Description
telemetry workplaceSensorDeviceTelemetry collection A collection of the telemetry data collected and reported by a sensor on a device, such as occupancy, people count, inferred occupancy, temperature, and more.

Response

If successful, this method returns a 204 No Content response code.

Examples

Example 1: Send sensor telemetry for a device with unique sensor types

The following example shows how to send sensor telemetry for a device with unique sensor types.

Request

The following example shows a request.

POST https://graph.microsoft.com/beta/workplace/sensorDevices/ingestTelemetry
Content-Type: application/json

{
    "telemetry": [
        {
            "deviceId": "contoso_9D6816",
            "sensorType": "occupancy",
            "boolValue": false,
            "timestamp": "2021-03-31T09:36:05.144Z"
        }
    ]
}

Response

The following example shows the response.

HTTP/1.1 204 No Content

Example 2: Send sensor telemetry for a device that has multiple sensors of the same type

The following example shows how to send sensor telemetry for a device that has multiple sensors of the same type.

Request

The following example shows a request.

POST https://graph.microsoft.com/beta/workplace/sensorDevices/ingestTelemetry
Content-Type: application/json

{
    "telemetry": [
        {
            "deviceId": "contoso_9D6816",
            "sensorId": "occupancy_1",
            "sensorType": "occupancy",
            "boolValue": false,
            "timestamp": "2021-03-31T09:36:05.144Z"
        },
        {
            "deviceId": "contoso_9D6816",
            "sensorId": "occupancy_2",
            "sensorType": "occupancy",
            "boolValue": false,
            "timestamp": "2021-03-31T09:36:05.144Z"
        }
    ]
}

Response

The following example shows the response.

HTTP/1.1 204 No Content

Example 3: Ingest telemetry for multiple devices

The following example shows how to ingest telemetry for multiple devices.

Request

The following example shows a request.

POST https://graph.microsoft.com/beta/workplace/sensorDevices/ingestTelemetry
Content-Type: application/json

{
    "telemetry": [
        {
            "deviceId": "contoso_9D6816",
            "sensorType": "occupancy",
            "boolValue": false,
            "timestamp": "2021-03-31T09:36:05.144Z"
        },
        {
            "deviceId": "contoso_9D6817",
            "sensorType": "occupancy",
            "boolValue": false,
            "timestamp": "2021-03-31T09:36:05.144Z"
        }
    ]
}

Response

The following example shows the response.

HTTP/1.1 204 No Content