REST APIs » History » Version 16
Hammel, 23 Sep 2018 15:22
1 | 1 | Hammel | h1. REST APIs |
---|---|---|---|
2 | |||
3 | 9 | Hammel | h2. Monitor Node (imwww) |
4 | 1 | Hammel | |
5 | 15 | Hammel | The following describe the API used by the monitor to process incoming requests. |
6 | |||
7 | 12 | Hammel | table{width:100%}. |
8 | |_. Resource Name |_. HTTP Verbs |_. HTTP Methods |_. Returns |_. Direction |_. Description | |
||
9 | 1 | Hammel | | Pair | CREATE Pair | POST /pair/iot/<uuid> | ACK | From IoT Node | Register an IoT node w/Monitor using UUID | |
10 | 15 | Hammel | | Pair | UPDATE Pair | POST /ping | ACK | From IoT Node | IoT device is verifying its stored pairing information | |
11 | 1 | Hammel | | Pair | CREATE Pair | POST /pair/jarvis/<uuid> | ACK | From Jarvis | Pair a Jarvis node with Monitor | |
12 | 12 | Hammel | | Monitor | GET Monitor ID | GET /monitor | Monitor ID | From Jarvis | Monitor Identity information | |
13 | | Device | GET Devices | POST /devices | Device list | From Jarvis | Get list of device IDs and descriptors | |
||
14 | 15 | Hammel | | Device | UPDATE Device | POST /set/device | Device state | From Jarvis | Change device state with JSON | |
15 | 16 | Hammel | | Device | UPDATE Device | PUT /set/device | Ack | From monitor | Change device state with JSON; only valid from localhost | |
16 | | Device | DELETE Device | DELETE /set/device | Ack | From monitor | Remove device pairing; only valid from localhost | |
||
17 | | Monitor | GET Query Devices | GET /query/devices | Updates states | From monitor | Causes monitor to update its device state information; only valid from localhost | |
||
18 | 1 | Hammel | |
19 | 6 | Hammel | Notes |
20 | * Monitor identity includes location and possibly other descriptors that uniquely identify the monitor |
||
21 | 1 | Hammel | * POST is required for GET requests because the sender must identify themselves with a valid encryption key, which is sent in a JSON body that GET does not allow. This is because we are not using HTTPS but rather encrypting the requests and responses inside a JSON packet stored in the body of messages. |
22 | |||
23 | h2. IoT Node (embedded in Arduino device code) |
||
24 | |||
25 | 15 | Hammel | The following describe the API used by a sensor to process incoming requests. |
26 | |||
27 | 1 | Hammel | table{width:100%}. |
28 | 9 | Hammel | |_. Resource Name |_. HTTP Verbs |_. HTTP Methods |_. Returns |_. Direction |_. Description | |
29 | 15 | Hammel | | Device | UPDATE Device| POST /set | Device config| From Monitor | Change device state with JSON | |
30 | | Device | POST Query | POST /query | Device config| From Monitor | Get Device state as JSON | |
||
31 | 9 | Hammel | | Device | GET Register | GET /register/<uuid> | ACK | From Monitor | Provides UUID from monitor | |