Interface Function

After the device successfully connects to the network, it will request the NTP interface to synchronize its own time.

Most devices do not store or cannot maintain standard time. They need to obtain it through an interface and then maintain standard time using their own internal clock.

If your Broker has access to the public network, you can also use the platform's time service.
Interface Address: http://api.thingboot.com/ntp/

Implementation Method

This interface can be implemented through a web service on any network server that the device can access.

Any web container such as IIS, Apache, or Nginx can be used.
It can be deployed on the same server as the Broker.
Log records can be added to the interface for debugging purposes.

Please ensure the device can access this interface normally!

Device Request

The device does not carry any parameters when requesting this interface.

Request Protocol: HTTP; Request Method: GET.

Interface Response

After the device initiates the request, please return the standard time in the interface response.

Please return the response directly in text/plain format; there are no additional format requirements.
It can be a 10-digit timestamp (in seconds) or a 13-digit timestamp (in milliseconds).
However, it must be the standard time of the time zone where the device is located. China uses China Standard Time (UTC+8).

If the request fails, the device will send requests continuously at 5-second intervals for a total of 3 times;
If the request ultimately fails, the device will still use the timestamp (with a failed value) as the value of the "ts" parameter for the registration interface request. Please decide whether to allow access in the registration interface.
Response Example: