Server's API

API description for server

Using the API, you can send a request to the server and get hourly data at a specific interval. To use the API, your application or website needs to send a corresponding HTTP request to the server. Requests can be sent using GET or POST. In response to a request, the server returns an HTTP message containing the result of processing in the body. The results returned by the server are in the format JSON.

To work with the API, you need an API key, which can be obtained on the Profile page in the smart-MAC Dashboard.
This feature is available for a BUSINESS license.


Key features and limitations:

  • In response to a request, the hourly data for the selected period comes.
  • Period no more than 45 days.
  • If the interval is incorrect, the request period will be 45 days from the end date of the period.
  • If there are no dates in the request (date1 and date2), data will be received in one last hour. The last hour is the previous current one. If there is no data, the query will return an empty array.
  • In the absence of the data1 parameter, data will be received for 45 days from data2.
  • The date is sent in UNIX format accurate to seconds.
  • Requests can be sent no more than once per minute.

GET request format for receiving data from the server
https://dash.smart-mac.com/api?devid=[Device ID]&date1=[start date]&date2=[end date]&apikey=[API key]
POST request format for receiving data from the server
Address: https://dash.smart-mac.com/api
Request parameters:
devid=[Device ID]
date1=[start date]
date2=[end date]
apikey=[API key]

Sample GET request to the server. Show »
https://dash.smart-mac.com/api?devid=1728053249&date1=1554577200&date2=1554663600&apikey=122951987

Leave your wishes and comments on the forum. Ask »

Successes in development!

This article was helpful for 10 people. Is this article helpful for you?