Service - Query Iot Hub

Query an IoT hub to retrieve information regarding device twins using a SQL-like language.
Query an IoT hub to retrieve information regarding device twins using a SQL-like language. See https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language for more information. Pagination of results is supported. This returns information about device twins only.

POST https://fully-qualified-iothubname.azure-devices.net/devices/query?api-version=2018-06-30

URI Parameters

Name In Required Type Description
api-version
query True
  • string

Version of the Api.

Request Body

Name Type Description
query
  • string

The query.

Responses

Name Type Description
200 OK

Query result with continuation token if appropriate.

Definitions

QueryResult

The query result.

QuerySpecification

A Json query request

QueryResult

The query result.

Name Type Description
continuationToken
  • string

Request continuation token.

items
  • object[]

The query result items, as a collection.

type enum:
  • deviceJob
  • deviceRegistration
  • enrollment
  • enrollmentGroup
  • jobResponse
  • raw
  • twin
  • unknown

The query result type.

QuerySpecification

A Json query request

Name Type Description
query
  • string

The query.