Twins - DigitalTwins SendTelemetry

Sends telemetry on behalf of a digital twin. Status codes:

  • 204 No Content
  • 400 Bad Request
    • InvalidArgument - The digital twin id or message id is invalid.
    • ValidationFailed - The telemetry content is invalid.
  • 404 Not Found
    • DigitalTwinNotFound - The digital twin was not found.
POST https://digitaltwins-hostname/digitaltwins/{id}/telemetry?api-version=2020-10-31

URI Parameters

Name In Required Type Description
id
path True
  • string

The id of the digital twin. The id is unique within the service and case sensitive.

api-version
query True
  • string

The requested API version.

Request Header

Name Required Type Description
Message-Id True
  • string

A unique message identifier (in the scope of the digital twin id) that is commonly used for de-duplicating messages.

Telemetry-Source-Time
  • string

An RFC 3339 timestamp that identifies the time the telemetry was measured.

traceparent
  • string

Identifies the request in a distributed tracing system.

tracestate
  • string

Provides vendor-specific trace identification information and is a companion to traceparent.

Request Body

Name Type Description
telemetry
  • object

The telemetry measurements to send from the digital twin.

Responses

Name Type Description
204 No Content

Success

Other Status Codes

Default response.

Security

oauth2

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize?resource=0b07f429-9f4b-4714-9392-cc5e8e80c8b0

Examples

Send telemetry

Sample Request

POST https://digitaltwins-hostname/digitaltwins/myTwinId/telemetry?api-version=2020-10-31
Message-Id: e5ca50dd-ca31-4fae-8d84-3af5a72b10c5
Telemetry-Source-Time: 1985-04-12T23:20:50.52Z
{
  "temperature": 1
}

Sample Response

Definitions

Error

Error definition.

ErrorResponse

Error response.

InnerError

A more specific error description than was provided by the containing error.

Error

Error definition.

Name Type Description
code
  • string

Service specific error code which serves as the substatus for the HTTP error code.

details

Internal error details.

innererror

An object containing more specific information than the current object about the error.

message
  • string

A human-readable representation of the error.

ErrorResponse

Error response.

Name Type Description
error

The error details.

InnerError

A more specific error description than was provided by the containing error.

Name Type Description
code
  • string

A more specific error code than was provided by the containing error.

innererror

An object containing more specific information than the current object about the error.