Here are the draft notes on the Rest APIs ready for comment and discussion:
1. Template URL: https://<server_host_domain_name>/<api_context_root>/<service>/?[parameters...]
2. Methods:
1. POST - YES
Used to send data from Gateway to Server
2. Delete - No
Irrelevant, we never delete data
3. Put - No
Redundant can't do anything with this that POST can't do
4. Get - MayBe
Don't see a relevant use as of yet,
Maybe just delegate to POST
3. Post Content:
1. JSON
{
param1 : val1,
param2 : val2
...
}
4. Uses
1. Send data from Gateway to Server
2. Send signal from Server to Gateway
5. Endpoints
1. Gateway
e.g.
https://gateway.bedlab.com/gateway/relay/?no=1&status=0 gateway-relay endpoint
parameters: (no=1)relay 1, (status=0)turn off
2. Server
e.g.
https://server.bedlab.com/server/power/?cur=1.4&v=240 server-power-meter endpoint
parameters: (cur=1) current 1A, (v=240) volatage 240v
6. Gateway sends a http GET/POST to Server store sensor data.
7. Server sends a http GET/Post to Gateway to control sensors.