-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathrainmachine-postman-collection.json
More file actions
3294 lines (3294 loc) · 108 KB
/
Copy pathrainmachine-postman-collection.json
File metadata and controls
3294 lines (3294 loc) · 108 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"info": {
"name": "RainMachine",
"_postman_id": "11b91317-f9c5-4444-9b0c-4aa4c561878c",
"description": "RainMachine API version 4.5 for accesing [RainMachine](http://www.rainmachine.com) devices. Document revision 2.0.\n\n### Compatible devices\n\n- 1st generation RainMachine: `hwVer: 1.0` partial support where noted\n\n- [RainMachine Mini 8](http://www.rainmachine.com/products/rainmachine-mini-8.html): `hwVer: 2.0` full support\n\n- [RainMachine Touch HD](http://www.rainmachine.com/products/rainmachine-touch-hd-12.html): `hwVer: 3.0` full support\n\nFor the [RainMachine Mini 8](http://www.rainmachine.com/products/rainmachine-mini-8.html) and [RainMachine Touch HD](http://www.rainmachine.com/products/rainmachine-touch-hd-12.html) the RESTful interface is accessible via HTTPS on port 8080. HTTP access is only allowed from localhost and it's bound to port 18080.\nA typical URL when accessing the machine directly should look like this: \n\n**https://device.ip:8080/api/4/**\n\nWhen accessing the device though *RainMachine Remote Access* service the URL should look like this:\n\n**https://my.rainmachine.com/**\n\n*For 1st generation RainMachine the RESTful interface is accessible via HTTPS on port 443 or via HTTP on port 80.*\n\n### Allowed HTTPS requests\n\n- `POST` - Creates or updates a resource\n\n- `GET` - Retrieves a resource or list of resources\n\n### Typical Server Responses\n\n- 200 `OK` - The request was successful\n\n- 400 `Bad Request` - The request could not be understood or was missing required parameters.\n\n- 401 `Unauthorized` - Authentication failed or user does not have permissions for the requested operation.\n\n- 404 `Not Found` - Resource was not found.\n\n- 405 `Method Not Allowed` - Requested method is not supported for the specified resource.\n\n- 460 `Cannot Change Password` - Cannot change password\n\n- 501 `Exception Occured` - Exception occured while processing the call\n\n- 540 `Database Error` - Error saving data to database\n\n- 541 `Provision Failed` - Cannot provision unit \n\n### Typical Server Responses Message Bodies\n\nThese are contained in the responses as response body.\n\n- `Success` : `{ \"statusCode\": 0, \"message\": \"OK\" }`\n\n- `ExceptionOccurred` : `{ \"statusCode\": 1, \"message\": \"Exception occurred !\" }`\n\n- `NotAuthenticated` : `{ \"statusCode\": 2, \"message\": \"Not Authenticated !\" }`\n\n- `InvalidRequest` : `{ \"statusCode\": 3, \"message\": \"Invalid request !\" }`\n\n- `NotImplemented` : `{ \"statusCode\": 4, \"message\": \"Not implemented yet !\" }`\n\n- `NotFound` : `{ \"statusCode\": 5, \"message\": \"Not found !\" }`\n\n- `DBError` : `{ \"statusCode\": 6, \"message\": \"DB Error !\" }`\n\n- `ProvisionFailed` : `{ \"statusCode\": 7, \"message\": \"Cannot provision unit\" }`\n\n- `PasswordNotChanged` : `{ \"statusCode\": 8, \"message\": \"Cannot change password\" }`\n\n- `ProgramValidationFailed` : `{ \"statusCode\": 9, \"message\": \"Invalid program constraints\"}`\n\n- `ServiceUnavailable` : `{ \"statusCode\": 10, \"message\": \"Service unavailable, data not ready, retry later.\"}`\n\n- `WrongParserFormat` : `{ \"statusCode\": 11, \"message\": \"Wrong parser format, cannot be loaded.\"}`\n\n\n### Authentication\n\nAfter authenticating [described below](#post-auth-login), additional API calls must contain the returned `access_token` as a URL parameter.\nExample: `GET /api/4/program?access_token=YOUR_ACCESS_TOKEN`\n\n### Changes from API 4.0 to API 4.1\n\n - **NEW** - `POST /dev/import/sshkey` Allow user to upload its own ssh key for login into RainMachine Touch HD.\n\n - **NEW** - `POST /parser/{id}/delete` Delete an existing user (custom uploaded) parser.\n\n - **NEW** - `POST /restrictions/hourly/{id}` Modify the specified hourly restriction. \n\n - **NEW** - `GET /restrictions/currently` Get a summary of currently active restrictions on device.\n\n - **NEW** - `POST /dev/beta` Subscribe to the beta channel for software updates\n\n - **NEW** - `POST /dev/trigger` Send a trigger to the notification server\n\n - **MODIFICATION** - `GET /watering/log` Added *userDuration* field\n\n - **MODIFICATION** - `GET /zone` Added *active* field\n\n - **MODIFICATION** - `GET /diag` Added internetStatus, uptimeSeconds, cloudstatus fields\n\n - **MODIFICATION** - `GET /watering/available` Added possibility to specify start date and days\n\n - **MODIFICATION** - `GET /watering/past` Added possibility to specify start date and days\n\n - **MODIFICATION** - `GET /dailystats` Return an error code if simulation is still being run\n\n - **MODIFICATION** - `GET /parser` Added lastKnownError, isRunning fields\n \n\n### Changes from API 4.1 to API 4.2\n\n - **NEW** - `POST /dev/parser/{id}/defaults` Reset parser parameters to default values\n\n - **NEW** - `GET /auth/totp` Generates a timebased one time password for guest/support access with 1 day valability\n \n\n - **MODIFICATION** - `GET and POST /program` Added *(optional)* startTimeParams that are used to set program start time at sunrise or sunset +/- a specified offset in minutes.\n\n - **MODIFICATION** - `GET /parser` Added description, hasForecast, hasHistorical fields for extra information about a parser. \n\n - **MODIFICATION** - `GET /program` Added simulationExpired to let clients know that a new simulation is being run for the program\n\n### Changes from API 4.2 to API 4.3\n\n - **NEW** - `POST /zone/simulate` Calculate values of Base Watering Time and Field Capacity with the specified zone parameters\n\n - **NEW** - `GET /provision/doy` Show the local stored EvapoTranspiratio values used when no weather is available\n\n - **MODIFICATION** - Added more values for water log flag: \n zwfRainSensorSoftware = 8\n zwfRestrictionMonth = 9\n zwfRestrictionRainDelay = 10\n \n\n - **MODIFICATION** - 'GET /watering/queue' - Added *remaining* for zone timers including master valve, soak and delay events.\n\n - **MODIFICATION** - `GET /dailystats/details` Added *wateringFlag* field that list the day restrictions if they exists\n\n - **MODIFICATION** - `GET /zone/*/properties` Added *referenceTime* and *currentFieldCapacity* fields which represent calculated values from zone properties.\n\n - **MODIFICATION** - `GET /zone/*/properties` Added *area* and *flowrate* fields for galons/liters calculations.\n\n - **MODIFICATION** - `GET /programs/*` Added *userPercentage* field (float) which represent the user increase or decrease of the referenceTime for the zone.\n\n - **MODIFICATION** - `GET /programs/*` *futureField1* field now holds the QPF restriction for the program (to be renamed).\n\n### Changes from API 4.3 to API 4.4\n - **MODIFICATION** - `/provision` - Added *uiUnitsMetric* (boolean) as a way to save on device the measurement units set by different clients\n - **MODIFICATION** - `/provision` - Added *useBonjourService* to enable/disable the use of Bonjour discovery of RainMachine services (on by default)\n - **MODIFICATION** - `/provision` - Added *rainSensorSnoozeDuration* to configure how the snooze should be scheduled after rain was detected. Values:\n \n -1: Until midnight today\n 0: No snooze added it will stop watering only for the period that rain sensor detects rain\n >0: Number of seconds to snooze\n \n- **MODIFICATION** - `/provision` - Added *rainSensorRainStart* which holds the timestamp of the last recorded rain start. A *null* value means that rain was never detected.\n- **MODIFICATION** - `/zone/properties` - Added more soil types: **SandyClay(8), SiltLoam (9), Silt(10)**\n- **MODIFICATION** - `/zone/properties` - Added *minRuntime* which holds per zone minimum watering time in seconds.\n- **MODIFICATION** - `/program` - Added *minRuntimeCoef* in *wateringTimes* object. Each zone from *wateringTimes* can have this coefficient which changes the zone *minWatering* setting. This allows programs to have different minimum watering times than the ones set in zone properties.\n- **MODIFICATION** - `/program` - Added *order* in *wateringTimes* object and it's used to specify the order in which the zones in this program will start watering. \nBy default *order* is the same with zone *id* (meaning zone 1 will start first and then zone 2). With *order* parameter it's possible to set *order: 2* for zone 1 and *order: 1* for zone 2 to reverse their starting order. \nWhen watering RainMachine will sort zones by *order* value (if multiple zones have same order they will be schedule one after another). \nThe API client should set this order correctly for all zones involved in a program.\n\n- **MODIFICATION** - `/program` - Added *startDate* which holds the start date of a program. The format is *YYYY-MM-DD*.\n- **MODIFICATION** - `/program` - Added *endDate* which holds the end date of a program run. The format is *YYYY-MM-DD*. This is uses to have programs valid in certain months, for example programs that run from May till August.\n- **MODIFICATION** - `/program` - Added *yearlyRecurring* which specifies if the program should repeat or not in the next years.\n- **MODIFICATION** - `/program` - The *freq_modified* field is now parsed and contains the integer percentage for adaptive frequency.\n- **MODIFICATION** - `/machine/time` - Added *timestamp* and *timezone* fields to return the local time as unix timestamp and local timezone\n\n- **NEW** - `POST /watering/available` - This allows setting current Available Water value per program per zone.\n\n### Changes from API 4.4 to API 4.5\n - **MODIFICATION** - `/provision` - Added *automaticUpdates* (boolean) to enable or disable automatic updates.",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "API versions",
"description": null,
"item": [
{
"name": "/apiVer",
"request": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{HOST}}/apiVer?{{ACCESS_TOKEN}}",
"host": [
"{{HOST}}"
],
"path": [
"apiVer"
],
"query": [
{
"key": "{{ACCESS_TOKEN}}",
"value": null
}
]
},
"description": "Returns the software, hardware and api level versions.\n*Available on 1st gen.*\n"
},
"response": []
}
]
},
{
"name": "Authenticate directly with device",
"description": "These calls can be used directly with the device by using the device standard URL: **https://device.ip:8080/api/4/**\n",
"item": [
{
"name": "/auth/login",
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"var jsonData = JSON.parse(responseBody);",
"",
"if (jsonData.access_token) {",
" var access_token = jsonData.access_token;",
" postman.setEnvironmentVariable(\"ACCESS_TOKEN\", \"access_token=\" + access_token );",
"}",
""
]
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"pwd\": \"{{PASSWORD}}\",\n \"remember\": 1\n}\n"
},
"url": {
"raw": "{{HOST}}/auth/login?{{ACCESS_TOKEN}}",
"host": [
"{{HOST}}"
],
"path": [
"auth",
"login"
],
"query": [
{
"key": "{{ACCESS_TOKEN}}",
"value": null
}
]
},
"description": "Request auth with the device response will include a token to be used on subsequent calls\n*Available on 1st gen. Response: \"access_token\", \"statusCode\", \"expires_in\".*\n"
},
"response": []
},
{
"name": "/auth/change",
"request": {
"method": "POST",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n newPass: \"newPass\",\n oldPass: \"oldPass\" \n}\n"
},
"url": {
"raw": "{{HOST}}/auth/change?{{ACCESS_TOKEN}}",
"host": [
"{{HOST}}"
],
"path": [
"auth",
"change"
],
"query": [
{
"key": "{{ACCESS_TOKEN}}",
"value": null
}
]
},
"description": "Request a password change\n*Partial support on 1st gen: \"newPass\", \"oldPass\". Response: \"statusCode\", \"message\".*\n"
},
"response": []
},
{
"name": "/auth/check",
"request": {
"method": "POST",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"pwd\": \"password\"\n}\n"
},
"url": {
"raw": "{{HOST}}/auth/check?{{ACCESS_TOKEN}}",
"host": [
"{{HOST}}"
],
"path": [
"auth",
"check"
],
"query": [
{
"key": "{{ACCESS_TOKEN}}",
"value": null
}
]
},
"description": "Request a password check.\n*Available on 1st gen. Response: \"statusCode\", \"message\".*\n\n"
},
"response": []
},
{
"name": "/auth/totp",
"request": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{HOST}}/auth/totp?{{ACCESS_TOKEN}}",
"host": [
"{{HOST}}"
],
"path": [
"auth",
"totp"
],
"query": [
{
"key": "{{ACCESS_TOKEN}}",
"value": null
}
]
},
"description": "Generates a 6 characters Time-based One-time Password that can be used in subsequent auth calls for a limited duration guest login (1 day) \n\n"
},
"response": []
}
]
},
{
"name": "Authenticate using https://my.rainmachine.com",
"description": "The following calls in the section should be prepended with **https://my.rainmachine.com/** as the URL. After authentication\nthe rest of the API calls should use the **https://my.rainmachine.com/s/sprinklerID/api/4/** as URL with\n**?access_token=<obtained token>** appended.\n\n\n",
"item": [
{
"name": "/login/auth",
"event": [
{
"listen": "test",
"script": {
"id": "d01cddda-29c6-4bf4-9abf-3b3a94c3854c",
"type": "text/javascript",
"exec": [
"var jsonData = JSON.parse(responseBody);",
"",
"if (jsonData.errorType === 0 && jsonData.sprinklerId && jsonData.access_token) {",
"",
" var id = jsonData.sprinklerId;",
" var access_token = jsonData.access_token;",
" ",
" postman.setEnvironmentVariable(\"HOST\", postman.getEnvironmentVariable(\"HOST\") + \"/s/\" + id + \"/api/4\" );",
" postman.setEnvironmentVariable(\"ACCESS_TOKEN\", \"access_token=\" + access_token );",
"} else if (jsonData.errorType === -1 && jsonData.access_token) {",
" var access_token = jsonData.access_token;",
" postman.setEnvironmentVariable(\"ACCESS_TOKEN\", \"access_token=\" + access_token );",
"}"
]
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"user\": \n {\n \"email\": \"{{EMAIL_ACCOUNT}}\", \n \"pwd\": \"{{PASSWORD}}\", \n \"remember\": true\n }\n}\n"
},
"url": {
"raw": "{{HOST}}/login/auth?{{ACCESS_TOKEN}}",
"host": [
"{{HOST}}"
],
"path": [
"login",
"auth"
],
"query": [
{
"key": "{{ACCESS_TOKEN}}",
"value": "",
"equals": false
}
]
},
"description": "Authenticate with the RainMachine associated with an account. This call should only be used if the account has only\none RainMachine associated otherwise the `errorType` field from response will return -1 (see below).\n\nIf authentication succeeds the `errorType` field from the returned JSON should be 0 and contain `access_token` and \n`sprinklerId` that will be used for further API calls.\n\nOther values for `errorType` are:\n\n- 0 - success\n\n- -1 - the user has multiple sprinklers use the **/get-sprinklers** call below to retrieve the list\n\n- 1 - the email has not been validated\n\n- 2 - no devices are connected to the cloud \n\n- 3 - the password provided is wrong\n\n- 4 - internal server error\n\n\n"
},
"response": []
},
{
"name": "/devices/login-sprinkler",
"event": [
{
"listen": "test",
"script": {
"id": "509e562e-e6a2-423f-8ce2-4d9661283634",
"type": "text/javascript",
"exec": [
"var jsonData = JSON.parse(responseBody);",
"",
"if (jsonData.errorType === 0 && jsonData.sprinklerId && jsonData.access_token) {",
"",
" var id = jsonData.sprinklerId;",
" var access_token = jsonData.access_token;",
" ",
" postman.setEnvironmentVariable(\"HOST\", \"https://my.rainmachine.com/s/\" + id + \"/api/4\" );",
" postman.setEnvironmentVariable(\"ACCESS_TOKEN\", \"access_token=\" + access_token );",
"}"
]
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"sprinklerId\": \"{{SPRINKLERID}}\", \n \"pwd\": \"{{PASSWORD}}\"\n}\n"
},
"url": {
"raw": "{{HOST}}/login-sprinkler?{{ACCESS_TOKEN}}",
"host": [
"{{HOST}}"
],
"path": [
"login-sprinkler"
],
"query": [
{
"key": "{{ACCESS_TOKEN}}",
"value": "",
"equals": false
}
]
},
"description": "Authenticate with a RainMachine when knowning its *sprinklerId*. `errorType` is either 0 for *success* or 3 for *invalid credentials*\nTo retrieve a list of RainMachine devices and their *sprinklerId* use the **/devices/get-sprinklers** API call (see below)\n\n"
},
"response": []
},
{
"name": "/devices/get-sprinklers",
"event": [
{
"listen": "test",
"script": {
"id": "c6afcd60-1b31-4696-932b-78809e77e7e0",
"type": "text/javascript",
"exec": [
"var jsonData = JSON.parse(responseBody);",
"",
"if (jsonData.errorType === 0 && jsonData.sprinklers && jsonData.sprinklers.length > 0) {",
" postman.setEnvironmentVariable(\"SPRINKLERID\", jsonData.sprinklers[0].sprinklerId);",
"}"
]
}
}
],
"request": {
"auth": {
"type": "noauth"
},
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"user\": \n {\n \"email\": \"{{EMAIL_ACCOUNT}}\", \n \"pwd\": \"{{PASSWORD}}\", \n \"remember\": true\n }\n}\n"
},
"url": {
"raw": "{{HOST}}/devices/get-sprinklers?{{ACCESS_TOKEN}}",
"host": [
"{{HOST}}"
],
"path": [
"devices",
"get-sprinklers"
],
"query": [
{
"key": "{{ACCESS_TOKEN}}",
"value": "",
"equals": false
}
]
},
"description": "Retrieve the list of RainMachine devices associated with the accound. To authenticate with a certain RainMachine the **/devices/login-sprinkler**\ncall should be used.\n\n"
},
"response": []
}
]
},
{
"name": "Authentication using new remote API",
"description": "<a name=\"post-auth-login\"></a>\nAuthenticating with the device it's possible though our *remote access service* or *directly* with the device.\nThe *direct* method can be used if you can access the device with a real IP, either on local LAN or though router \nforwarding. The *remote access service* provided by RainMachine is provided by https://my.rainmachine.com host \nand can be accessed from any location with internet access.\n\n",
"item": [
{
"name": "/v1/auth",
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"var jsonData = JSON.parse(responseBody);",
"",
"if (!jsonData.error && jsonData.token) {",
" var token = jsonData.token;",
" postman.setEnvironmentVariable(\"ACCESS_TOKEN\", token );",
"}",
""
]
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n\t\"email\":\"{{EMAIL_ACCOUNT}}\",\n\t\"password\": \"{{PASSWORD}}\"\n}"
},
"url": {
"raw": "{{HOST}}/v1/auth",
"host": [
"{{HOST}}"
],
"path": [
"v1",
"auth"
]
},
"description": null
},
"response": []
},
{
"name": "/v1/device/list",
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"var jsonData = JSON.parse(responseBody);",
"",
"",
"if (!jsonData.error && jsonData.sprinklers.length > 0) {",
" tests[\"Has sprinklers\"] = jsonData.sprinklers.length > 0;",
" postman.setEnvironmentVariable(\"DEVICE_URL\", jsonData.sprinklers[0].sprinklerUrl);",
"}",
"",
""
]
}
}
],
"request": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{HOST}}/v1/device/list?access_token={{ACCESS_TOKEN}}",
"host": [
"{{HOST}}"
],
"path": [
"v1",
"device",
"list"
],
"query": [
{
"key": "access_token",
"value": "{{ACCESS_TOKEN}}"
}
]
},
"description": null
},
"response": []
}
]
},
{
"name": "Daily Stats",
"description": "Daily Statistics and Weather\n\n\n",
"item": [
{
"name": "/dailystats",
"request": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{HOST}}/dailystats?{{ACCESS_TOKEN}}",
"host": [
"{{HOST}}"
],
"path": [
"dailystats"
],
"query": [
{
"key": "{{ACCESS_TOKEN}}",
"value": null
}
]
},
"description": "Returns daily statistics about simulated watering. It contains how much the programs will water for the next 7 days (pozitive id, id 0 is today).\n\n\n| Variable for Basic Stats | Type | Description |\n| ---------------------------|---------------|----------------------------------------------------------------------------------- |\n| `id` | *int* | Day offset relative to today which is 0. |\n| `wateringFlag` | *int* | See below |\n| `day` | *string* | Day in YYYY-MM-DD format |\n| `mint` | *float* | Minimum temperature of the day |\n| `maxt` | *float* | Maximum temperature of the day |\n| `icon` | *int* | Weather icon for that day (see icon definitions) |\n| `percentage` | *int* | How much it actually waters |\n| `simulatedPercentage` | *int* | How much it would water if a daily program would be configured |\n| `vibration` | *array of int*| How the watering `percetage` varies with historical and future weather predictions |\n| `simulatedVibration` | *array of int*| As above but if a daily program would be configured |\n\n| Variable for Detailed Stats | Type | Description |\n| ----------------------------|---------------|---------------------------------------------------- |\n| `scheduledWateringTime` | *int* | User specified watering time for this zone |\n| `computedWateringTime` | *int* | Calculated watering time for this zone |\n| `availableWater` | *float* | Available water for this zone |\n| `coefficient` | *float* | Zone watering coefficient (see zones documentation) |\n\n\n| Watering Flag Value | Description |\n| ---------------------------|------------------------------------- |\n| 0 | Normal watering |\n| 1 | Interrupted by user |\n| 2 | Restriction Threshold |\n| 3 | Restriction Freeze Protect |\n| 4 | Restriction Day |\n| 5 | Restriction Out Of Day |\n| 6 | Water Surplus |\n| 7 | Stopped by Rain Sensor |\n| 8 | Software rain sensor restriction |\n| 9 | Month Restricted |\n| 10 | Rain Delay set by user |\n| 11 | Program Rain Restriction |\n\n*Partial support on 1st gen: \"vibration\" not available.*\n\n"
},
"response": []
},
{
"name": "/dailystats/{date}",
"request": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{HOST}}/dailystats/2017-03-15?{{ACCESS_TOKEN}}",
"host": [
"{{HOST}}"
],
"path": [
"dailystats",
"2017-03-15"
],
"query": [
{
"key": "{{ACCESS_TOKEN}}",
"value": null
}
]
},
"description": "Returns daily statistics about simulated watering starting from specified `date` per program per zone.\n*Partial support on 1st gen: \"vibration\" not available.*\n \n"
},
"response": []
},
{
"name": "/dailystats/details",
"request": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{HOST}}/dailystats/details?{{ACCESS_TOKEN}}",
"host": [
"{{HOST}}"
],
"path": [
"dailystats",
"details"
],
"query": [
{
"key": "{{ACCESS_TOKEN}}",
"value": null
}
]
},
"description": "Returns daily statistics detauls about simulated watering starting with `date` which is optional.\n*Partial support on 1st gen: \"vibration\" not available.*\n\n"
},
"response": []
}
]
},
{
"name": "Dev",
"description": "Developer and beta update options\n\n",
"item": [
{
"name": "/dev/timezonedb.json",
"request": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{HOST}}/dev/timezonedb.json?{{ACCESS_TOKEN}}",
"host": [
"{{HOST}}"
],
"path": [
"dev",
"timezonedb.json"
],
"query": [
{
"key": "{{ACCESS_TOKEN}}",
"value": null
}
]
},
"description": "Retrieves the Time Zone database available on the device. This database contains *all* available timezones and their Olson format\n\n"
},
"response": []
},
{
"name": "/dev/beta",
"request": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{HOST}}/dev/beta?{{ACCESS_TOKEN}}",
"host": [
"{{HOST}}"
],
"path": [
"dev",
"beta"
],
"query": [
{
"key": "{{ACCESS_TOKEN}}",
"value": null
}
]
},
"description": null
},
"response": []
},
{
"name": "/dev/import/parser",
"request": {
"method": "POST",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{HOST}}/dev/import/parser?{{ACCESS_TOKEN}}",
"host": [
"{{HOST}}"
],
"path": [
"dev",
"import",
"parser"
],
"query": [
{
"key": "{{ACCESS_TOKEN}}",
"value": null
}
]
},
"description": "Installs a new parser to the device. Parsers are written in python and follow [RainMachine Parser API](http://docs.rainmachineparsers.apiary.io/). \n\n\n"
},
"response": []
},
{
"name": "/dev/import/waterlog",
"request": {
"method": "POST",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{HOST}}/dev/import/waterlog?{{ACCESS_TOKEN}}",
"host": [
"{{HOST}}"
],
"path": [
"dev",
"import",
"waterlog"
],
"query": [
{
"key": "{{ACCESS_TOKEN}}",
"value": null
}
]
},
"description": "Imports a waterlog database from another RainMachine device\n\n"
},
"response": []
}
]
},
{
"name": "Diagnostics",
"description": "Software diagnostics, logs and device status\n",
"item": [
{
"name": "/diag",
"request": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{HOST}}/diag?{{ACCESS_TOKEN}}",
"host": [
"{{HOST}}"
],
"path": [
"diag"
],
"query": [
{
"key": "{{ACCESS_TOKEN}}",
"value": null
}
]
},
"description": "Returns software and device diagnostics.\n\n"
},
"response": []
},
{
"name": "/diag/upload",
"request": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{HOST}}/diag/upload?{{ACCESS_TOKEN}}",
"host": [
"{{HOST}}"
],
"path": [
"diag",
"upload"
],
"query": [
{
"key": "{{ACCESS_TOKEN}}",
"value": null
}
]
},
"description": "Returns the status of diagnostics upload progress. Diagnostics are uploaded to RainMachine server for support inspection.\n\n"
},
"response": []
},
{
"name": "/diag/upload",
"request": {
"method": "POST",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{HOST}}/diag/upload?{{ACCESS_TOKEN}}",
"host": [
"{{HOST}}"
],
"path": [
"diag",
"upload"
],
"query": [
{
"key": "{{ACCESS_TOKEN}}",
"value": null
}
]
},
"description": "Starts diagnostics upload to RainMachine support FTP server\n\n"
},
"response": []
},
{
"name": "/diag/log",
"request": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{HOST}}/diag/log?{{ACCESS_TOKEN}}",
"host": [
"{{HOST}}"
],
"path": [
"diag",
"log"
],
"query": [
{
"key": "{{ACCESS_TOKEN}}",
"value": null
}
]
},
"description": "Retrieves the entire application log with the format: ``YYYY-MM-DD HH:MM:SS,MS - <LOGLEVEL> - <COMPONENT>:<LINE>``\n\n"
},
"response": []
},
{
"name": "/diag/log/level",
"request": {
"method": "POST",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{HOST}}/diag/log/level?{{ACCESS_TOKEN}}",
"host": [
"{{HOST}}"
],
"path": [
"diag",
"log",
"level"
],
"query": [
{
"key": "{{ACCESS_TOKEN}}",
"value": null
}
]
},
"description": "Sets the log level for the application. Log level is numeric and can take values:\n\n- 10 : Debug\n\n- 20 : Info (default)\n\n- 30 : Warning\n\n- 40 : Errors\n\n- 50 : No logging\n\n"
},
"response": []
},
{
"name": "/diag/download",
"request": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/zip"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{HOST}}/diag/download?{{ACCESS_TOKEN}}",
"host": [
"{{HOST}}"
],
"path": [
"diag",
"download"
],
"query": [
{
"key": "{{ACCESS_TOKEN}}",
"value": null
}
]
},
"description": "Retrieves an archive with logs and databases from RainMachine\n*Only Available on 1st gen.*\n\n"
},
"response": []
}
]
},
{
"name": "Machine",
"description": null,
"item": [
{
"name": "/machine/time",
"request": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{HOST}}/machine/time?{{ACCESS_TOKEN}}",
"host": [
"{{HOST}}"
],
"path": [
"machine",
"time"
],
"query": [
{
"key": "{{ACCESS_TOKEN}}",
"value": null
}
]
},
"description": "Returns the time on machine in format ``YYYY-MM-DD HH:MM:SS``\n*Available on 1st gen.*\n\n"
},
"response": []
},
{
"name": "/machine/time",
"request": {
"method": "POST",
"header": [