User Tools

Site Tools


webserviceinterface

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

webserviceinterface [2012/06/28 10:11]
elyoliveira [Web Service Interface]
webserviceinterface [2013/06/18 14:35] (current)
elyoliveira
Line 2: Line 2:
 ===== Web Service Interface ===== ===== Web Service Interface =====
  
-This page is under construction. We intend to specify here the web service interface used by all users and Flukso V2 devices to communicate with the mySmartGrid server.+This page is under construction. We intend to specify here the web service interface used by all users and software clients (including Flukso V2 devicesto communicate with the mySmartGrid server.
  
-The mySmartGrid API adopts the RESTful model, and therefore it relies on the HTTP protocol and the JSON standard. Regarding security, all the communication is performed over HTTPS, using a server certificate issued by the mySmartGrid CA. Additionally, both request and response bodies are encrypted using the device individual SHA-1 key, which only the server and the device know.+The mySmartGrid API adopts the RESTful model, and therefore relies on the HTTP protocol and the JSON standard.  
 + 
 +All the communication is performed over HTTPS, using a server certificate issued by the mySmartGrid CA. In addition, both request and response bodies are encrypted using the device individual SHA-1 key, which only the server and the device know.
  
 Despite some similarities, the mySmartGrid API is different from the Flukso.net API in many important aspects. So, if you want to switch from the Flukso.net platform to mySmartGrid, we strongly recomend you to flash the [[http://openwrt.mysmartgrid.de/flm02/atheros|latest mySmartGrid image]] to your device. Despite some similarities, the mySmartGrid API is different from the Flukso.net API in many important aspects. So, if you want to switch from the Flukso.net platform to mySmartGrid, we strongly recomend you to flash the [[http://openwrt.mysmartgrid.de/flm02/atheros|latest mySmartGrid image]] to your device.
Line 44: Line 46:
 | 301             | Moved Permanently     | This and all future requests should be directed to the given URI. | | 301             | Moved Permanently     | This and all future requests should be directed to the given URI. |
 | 400             | Bad request           | The request cannot be fulfilled due to bad syntax. | | 400             | Bad request           | The request cannot be fulfilled due to bad syntax. |
-| 403             | Forbidden             | The user is not authorized to access the requested resource. |+| 401             | Unauthorized          | The user is not authorized to access the requested resource, possibly because it is not authenticated. | 
 +| 403             | Forbidden             | The user is not authorized to access the requested resource, even if it is authenticated. |
 | 404             | Not Found             | The requested resource does not exist on the server. | | 404             | Not Found             | The requested resource does not exist on the server. |
 | 405             | Method Not Allowed    | Method not supported by resource, for example, using GET on a resource that supports only POST | | 405             | Method Not Allowed    | Method not supported by resource, for example, using GET on a resource that supports only POST |
 +| 406             | Not acceptable        | The resource identified by the request is only capable of generating response entities which have content characteristics not acceptable according to the accept headers sent in the request. |
 | 500             | Internal Server Error | The request was aborted due to an unspecified error on the server. | | 500             | Internal Server Error | The request was aborted due to an unspecified error on the server. |
 | 501             | Not Implemented       | The server does not provide the requested operation. | | 501             | Not Implemented       | The server does not provide the requested operation. |
Line 99: Line 103:
 ^ Response Body | The field 'support' is included only if the user requests device remote support on the web application. ^ Response Body | The field 'support' is included only if the user requests device remote support on the web application.
   {   {
-    upgrade:    <string(32)  the version of a pending firmware upgrade if there is one or 0 if there is none>,+    upgrade:    <integer     flag to indicate whether or not there is a pending firmware upgrade>,
     timestamp:  <unixtime    - server current time>,     timestamp:  <unixtime    - server current time>,
     support: {     support: {
Line 151: Line 155:
 The list of possible events is shown bellow. The list of possible events is shown bellow.
  
-== Events == 
 ^ Code            ^  Name                   ^ Description                                 ^ ^ Code            ^  Name                   ^ Description                                 ^
 | 104             | Brownout                | The device has detected a brownout event. | | 104             | Brownout                | The device has detected a brownout event. |
Line 189: Line 192:
 == Sensor Measurements Registration == == Sensor Measurements Registration ==
  
-Reports sensor measurements to the server. The measurement values are saved in RRD files in Ws (Wattseconds).+Reports sensor measurements to the server. The measurement values are saved in RRD files in Wh (watt-hour).
  
 ^ Method       | POST                                                    | ^ Method       | POST                                                    |
Line 197: Line 200:
     measurements: [     measurements: [
       [ <unixtime - timestamp of the first measurement>,       [ <unixtime - timestamp of the first measurement>,
-        <integer  - consumed power in kW/h (ever increasing value), measured at the first timestamp> ],+        <integer  - consumed energy in Wh (ever increasing value), measured at the first timestamp> ],
       ...       ...
       [ <unixtime - timestamp of the measurement n>,       [ <unixtime - timestamp of the measurement n>,
-        <integer  - consumed power in kW/h (ever increasing value), measured at the timestamp n> ]+        <integer  - consumed energy in Wh (ever increasing value), measured at the timestamp n> ]
     ]     ]
   }   }
webserviceinterface.1340871079.txt.gz · Last modified: 2012/10/30 10:43 (external edit)