How Do I Obtain the Callback URL When Calling the Subscription API?
The following assumes that an application tries to subscribe to device data changes. The process of subscription and push is as follows:

- The application calls an IoT platform API to subscribe to device data changes (the request carries the callback URL and notification type). The platform stores the callback URL and the notification type in the subscription list.
- The device reports data to the platform.
- The platform automatically pushes the device data to the application based on the callback URL stored during the subscription.
What Is a Callback URL?
The callback URL is the RESTful API address defined by the application for external access. When the platform pushes messages to the application, it calls the RESTful API of the application to send data to the application.
The request method of the callback URL must be POST.
How Do I Obtain a Callback URL?
The callback URL consists of the connection protocol, access address of the application, and URL of the RESTful API. An example is https://server:port/url.
For security reasons, HTTPS is recommended for communications between the application and platform. When HTTPS is used, the platform needs to load a certificate. For details, see Creating an X.509 Commissioning Certificate.
The access address of the application depends on the network where the application is located.
- If the application is deployed on the public network, the access address of the application is Public IP address of the application:Port (or Domain name:Port).
- If the application is deployed on a LAN, you must configure network address translation (NAT) for the application to generate a public network access address for the application. For details, obtain the configuration procedure of the NAT tool from the Internet.
The callback URL can be the same or different for subscription of different notification types. It can be defined based on service requirements.
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.