Skip to content

Publish direct methods

To invoke a direct method in devices:

  1. Device should subscribe to the topic $iothub/methods/POST/#.

  2. Invoke a direct method using the Direct method invocation API.

    {
         "name": "Reboot",
         "payload": {
             "frequency": 10
         },
         "responseTimeoutInSecs": 10
     }
  3. The device will get notifications in the topic $iothub/methods/POST/Reboot/?$rid=1.

  4. The device should respond to the request within the response time out in the topic $iothub/methods/res/200/?$rid=1. Set the requestId from the notification topic.