@@ -10,18 +10,62 @@ HTTP header. Those API calls that use `POST` or `PUT`, should specify
10
10
https://dash.mongoose-os.com/api/v2/devices/DEVICE_ID/rpc/GPIO.Toggle
11
11
true</code ></pre >
12
12
13
+ ## GET /devices
13
14
14
- | Method | Endpoint | Params | Description |
15
- | ------ | ---------------- | ------ | ----------- |
16
- | GET | /devices |   ; | List all registered devices |
17
- | POST | /devices |   ; | Register new device |
18
- | POST | /devices/: id | {"name": "x", "shared_with": "github_user1", "shadow": ...} | Change device properties |
19
- | DELETE | /devices/: id |   ; | Delete device |
20
- | POST | /devices/: id /rpc/: func | {...} | Call device's RPC function |
21
- | POST
| /devices/
: id /ota
| fw.zip
| OTA:
` curl -v -F [email protected] URL ` |
22
- | GET | /devices/: id /data |   ; | Get device saved data |
23
- | GET | /keys |   ; | List all API keys |
24
- | POST | /keys |   ; | Create an API key |
25
- | DELETE | /keys/: id |   ; | Delete an API key |
26
- | POST | /logs | {"start": 0} | Get stored notification logs |
27
- | GET | /devices/data |   ; | Get data from all devices |
15
+ List all registered devices. Params: none.
16
+
17
+ ## POST /devices
18
+
19
+ Register new device. Params: none.
20
+
21
+ ## POST /devices/: id
22
+
23
+ Change device properties. Params:
24
+
25
+ ``` javascript
26
+ {
27
+ " name" : " MyCoolDeviceName" ,
28
+ " shared_with" : " github_user1,github_user2" ,
29
+ " shadow" : ...
30
+ }
31
+ ```
32
+
33
+ Any key in the params is optional.
34
+
35
+
36
+ ## DELETE /devices/: id
37
+
38
+ Delete device. Params: none.
39
+
40
+ ## POST /devices/: id /rpc/: func
41
+
42
+ Call device's RPC function. Params: any valid JSON string, which is expected by the function.
43
+
44
+
45
+ ## POST /devices/: id /ota
46
+
47
+ Perform device OTA. Params: a binary content of the firmware .zip file. Example:
` curl -v -F [email protected] URL ` .
48
+
49
+ ## GET /devices/: id /data
50
+
51
+ Get device saved data. Params: none.
52
+
53
+ ## GET /keys
54
+
55
+ List all API keys. Params: none.
56
+
57
+ ## POST /keys
58
+
59
+ Create an API key. Params: none.
60
+
61
+ ## DELETE /keys/: id
62
+
63
+ Delete an API key. Params: none.
64
+
65
+ ## POST /logs
66
+
67
+ Get stored notification logs. Params: ` {"start": 0} ` - an offset to start from.
68
+
69
+ ## GET /devices/data
70
+
71
+ Get data from all devices. Params: none.
0 commit comments