Devices - Invoke Method

Invokes a direct method on a device. See https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-direct-methods for more information.

POST https://fully-qualified-iothubname.azure-devices.net/twins/{deviceId}/methods?api-version=2020-05-31-preview

URI Parameters

Name In Required Type Description
deviceId
path True

string

The unique identifier of the device.

api-version
query True

string

Version of the Api.

Request Body

Name Type Description
connectTimeoutInSeconds

integer

methodName

string

The name of the method to execute.

payload

object

The JSON-formatted direct method payload, up to 128kb in size.

responseTimeoutInSeconds

integer

Responses

Name Type Description
200 OK

CloudToDeviceMethodResult

OK.

Definitions

Name Description
CloudToDeviceMethod

The parameters to execute a direct method on the device.

CloudToDeviceMethodResult

Represents the Device Method Invocation Results.

CloudToDeviceMethod

The parameters to execute a direct method on the device.

Name Type Description
connectTimeoutInSeconds

integer

methodName

string

The name of the method to execute.

payload

object

The JSON-formatted direct method payload, up to 128kb in size.

responseTimeoutInSeconds

integer

CloudToDeviceMethodResult

Represents the Device Method Invocation Results.

Name Type Description
payload

object

Method invocation result payload.

status

integer

Method invocation result status.