Send telemetry message in DPS from rest api in Android & iOS.

Shahanshah Alam 0 Reputation points
2024-09-27T15:02:59.45+00:00

Is it possible to send telemetry message during DPS registration using Rest API?
there is a way to do using MQTT protocol as per this docs but I want to do that using Rest API.
If possible, how can I do that and how can I receive the message?

Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,189 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sander van de Velde | MVP 32,556 Reputation points MVP
    2024-09-27T15:56:48.76+00:00

    Hello @Shahanshah Alam ,

    welcome to this moderated Azure community forum.

    Devices can connect to the IoT Hub directly or after an IoT Hub is appointed to them using a Device Provisioning Service.

    Using a Device Provisioning Service is recommended because it will make your IoT solution more flexible in case you need to migrate devices to another IoT hub.

    Once an IoT Hub is appointed and the device has its own registration, it can start communicating.

    An IoT Hub offers both device-to-cloud communication (eg. telemetry) and cloud-to-device communication (e.g. commands via the device twin direct methods, desired properties, or cloud messages).

    This communication supports multiple protocols.

    The recommended protocols are MQTT and AMQP.

    If you want to build a proper IoT solution, learning about MQTT is a great investment.

    HTTP is also possible as seen in this blog post.

    Due to the 'stateless' nature of this protocol, it could take several minutes (10+) before a C2D command is retrieved.

    Therefor, HTTP is not recommended and should be avoided in proper IoT projects.


    If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.