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=2021-04-12
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
device
|
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 (int32) |
|
| methodName |
string |
The name of the method to execute. |
| payload |
object |
The JSON-formatted direct method payload, up to 128kb in size. |
| responseTimeoutInSeconds |
integer (int32) |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
OK. |
Definitions
| Name | Description |
|---|---|
|
Cloud |
The parameters to execute a direct method on the device. |
|
Cloud |
Represents the Device Method Invocation Results. |
CloudToDeviceMethod
The parameters to execute a direct method on the device.
| Name | Type | Description |
|---|---|---|
| connectTimeoutInSeconds |
integer (int32) |
|
| methodName |
string |
The name of the method to execute. |
| payload |
object |
The JSON-formatted direct method payload, up to 128kb in size. |
| responseTimeoutInSeconds |
integer (int32) |
CloudToDeviceMethodResult
Represents the Device Method Invocation Results.
| Name | Type | Description |
|---|---|---|
| payload |
object |
Method invocation result payload. |
| status |
integer (int32) |
Method invocation result status. |