-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclimate-control-api.html
795 lines (764 loc) · 90.7 KB
/
climate-control-api.html
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
<!DOCTYPE html><html><head><meta charset="utf-8"><title>Climate Conrol API</title><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"><style>@import url('https://fonts.googleapis.com/css?family=Roboto:400,700|Inconsolata|Raleway:200');.hljs-comment,.hljs-title{color:#8e908c}.hljs-variable,.hljs-attribute,.hljs-tag,.hljs-regexp,.ruby .hljs-constant,.xml .hljs-tag .hljs-title,.xml .hljs-pi,.xml .hljs-doctype,.html .hljs-doctype,.css .hljs-id,.css .hljs-class,.css .hljs-pseudo{color:#c82829}.hljs-number,.hljs-preprocessor,.hljs-pragma,.hljs-built_in,.hljs-literal,.hljs-params,.hljs-constant{color:#f5871f}.ruby .hljs-class .hljs-title,.css .hljs-rules .hljs-attribute{color:#eab700}.hljs-string,.hljs-value,.hljs-inheritance,.hljs-header,.ruby .hljs-symbol,.xml .hljs-cdata{color:#718c00}.css .hljs-hexcolor{color:#3e999f}.hljs-function,.python .hljs-decorator,.python .hljs-title,.ruby .hljs-function .hljs-title,.ruby .hljs-title .hljs-keyword,.perl .hljs-sub,.javascript .hljs-title,.coffeescript .hljs-title{color:#4271ae}.hljs-keyword,.javascript .hljs-function{color:#8959a8}.hljs{display:block;background:white;color:#4d4d4c;padding:.5em}.coffeescript .javascript,.javascript .xml,.tex .hljs-formula,.xml .javascript,.xml .vbscript,.xml .css,.xml .hljs-cdata{opacity:.5}.right .hljs-comment{color:#969896}.right .css .hljs-class,.right .css .hljs-id,.right .css .hljs-pseudo,.right .hljs-attribute,.right .hljs-regexp,.right .hljs-tag,.right .hljs-variable,.right .html .hljs-doctype,.right .ruby .hljs-constant,.right .xml .hljs-doctype,.right .xml .hljs-pi,.right .xml .hljs-tag .hljs-title{color:#c66}.right .hljs-built_in,.right .hljs-constant,.right .hljs-literal,.right .hljs-number,.right .hljs-params,.right .hljs-pragma,.right .hljs-preprocessor{color:#de935f}.right .css .hljs-rule .hljs-attribute,.right .ruby .hljs-class .hljs-title{color:#f0c674}.right .hljs-header,.right .hljs-inheritance,.right .hljs-name,.right .hljs-string,.right .hljs-value,.right .ruby .hljs-symbol,.right .xml .hljs-cdata{color:#b5bd68}.right .css .hljs-hexcolor,.right .hljs-title{color:#8abeb7}.right .coffeescript .hljs-title,.right .hljs-function,.right .javascript .hljs-title,.right .perl .hljs-sub,.right .python .hljs-decorator,.right .python .hljs-title,.right .ruby .hljs-function .hljs-title,.right .ruby .hljs-title .hljs-keyword{color:#81a2be}.right .hljs-keyword,.right .javascript .hljs-function{color:#b294bb}.right .hljs{display:block;overflow-x:auto;background:#1d1f21;color:#c5c8c6;padding:.5em;-webkit-text-size-adjust:none}.right .coffeescript .javascript,.right .javascript .xml,.right .tex .hljs-formula,.right .xml .css,.right .xml .hljs-cdata,.right .xml .javascript,.right .xml .vbscript{opacity:.5}@media (max-width:768px){body .container .row .content,body .container-fluid .row .content,body .container-fluid.triple .row .content{width:100%}}body{margin:0 20px}h3.resource-heading{font:200 36px 'Raleway',Helvetica,sans-serif;padding-top:20px;text-transform:none}p{margin-bottom:18px}.back-to-top{display:none}nav>p{display:none}.container-fluid+p{display:none}.tryit{float:right;color:#888;padding:4px 8px;border-radius:4px;border:1px solid #d9d9d9;font:400 14px / 1.42 'Roboto',Helvetica,sans-serif}body{color:black;background:white;font:400 14px / 1.42 'Roboto',Helvetica,sans-serif}header{border-bottom:1px solid #f2f2f2;margin-bottom:12px}h1,h2,h3,h4,h5{color:black;margin:12px 0}h1 .permalink,h2 .permalink,h3 .permalink,h4 .permalink,h5 .permalink{margin-left:0;opacity:0;transition:opacity .25s ease}h1:hover .permalink,h2:hover .permalink,h3:hover .permalink,h4:hover .permalink,h5:hover .permalink{opacity:1}.triple h1 .permalink,.triple h2 .permalink,.triple h3 .permalink,.triple h4 .permalink,.triple h5 .permalink{opacity:.15}.triple h1:hover .permalink,.triple h2:hover .permalink,.triple h3:hover .permalink,.triple h4:hover .permalink,.triple h5:hover .permalink{opacity:.15}h1{font:200 36px 'Raleway',Helvetica,sans-serif;font-size:36px}h2{font:200 36px 'Raleway',Helvetica,sans-serif;font-size:30px}h3{font-size:100%;text-transform:uppercase}h5{font-size:100%;font-weight:normal}p{margin:0 0 10px}p.choices{line-height:1.6}a{color:#428bca;text-decoration:none}li p{margin:0}hr.split{border:0;height:1px;width:100%;padding-left:6px;margin:12px auto;background-image:linear-gradient(to right, rgba(0,0,0,0) 20%, rgba(0,0,0,0.2) 51.4%, rgba(255,255,255,0.2) 51.4%, rgba(255,255,255,0) 80%)}dl dt{float:left;width:130px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:700}dl dd{margin-left:150px}blockquote{color:rgba(0,0,0,0.5);font-size:15.5px;padding:10px 20px;margin:12px 0;border-left:5px solid #e8e8e8}blockquote p:last-child{margin-bottom:0}pre{background-color:#f5f5f5;padding:12px;border:1px solid #cfcfcf;border-radius:6px;overflow:auto}pre code{color:black;background-color:transparent;padding:0;border:none}code{color:#444;background-color:#f5f5f5;font:'Inconsolata',monospace;padding:1px 4px;border:1px solid #cfcfcf;border-radius:3px}ul,ol{padding-left:2em}table{border-collapse:collapse;border-spacing:0;margin-bottom:12px}table tr:nth-child(2n){background-color:#fafafa}table th,table td{padding:6px 12px;border:1px solid #e6e6e6}.text-muted{opacity:.5}.note,.warning{padding:.3em 1em;margin:1em 0;border-radius:2px;font-size:90%}.note h1,.warning h1,.note h2,.warning h2,.note h3,.warning h3,.note h4,.warning h4,.note h5,.warning h5,.note h6,.warning h6{font-family:200 36px 'Raleway',Helvetica,sans-serif;font-size:135%;font-weight:500}.note p,.warning p{margin:.5em 0}.note{color:black;background-color:#f0f6fb;border-left:4px solid #428bca}.note h1,.note h2,.note h3,.note h4,.note h5,.note h6{color:#428bca}.warning{color:black;background-color:#fbf1f0;border-left:4px solid #c9302c}.warning h1,.warning h2,.warning h3,.warning h4,.warning h5,.warning h6{color:#c9302c}header{margin-top:24px}nav{position:fixed;top:24px;bottom:0;overflow-y:auto}nav .resource-group{padding:0}nav .resource-group .heading{position:relative}nav .resource-group .heading .chevron{position:absolute;top:12px;right:12px;opacity:.5}nav .resource-group .heading a{display:block;color:black;opacity:.7;border-left:2px solid transparent;margin:0}nav .resource-group .heading a:hover{text-decoration:none;background-color:bad-color;border-left:2px solid black}nav ul{list-style-type:none;padding-left:0}nav ul a{display:block;font-size:13px;color:rgba(0,0,0,0.7);padding:8px 12px;border-top:1px solid #d9d9d9;border-left:2px solid transparent;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}nav ul a:hover{text-decoration:none;background-color:bad-color;border-left:2px solid black}nav ul>li{margin:0}nav ul>li:first-child{margin-top:-12px}nav ul>li:last-child{margin-bottom:-12px}nav ul ul a{padding-left:24px}nav ul ul li{margin:0}nav ul ul li:first-child{margin-top:0}nav ul ul li:last-child{margin-bottom:0}nav>div>div>ul>li:first-child>a{border-top:none}.preload *{transition:none !important}.pull-left{float:left}.pull-right{float:right}.badge{display:inline-block;float:right;min-width:10px;min-height:14px;padding:3px 7px;font-size:12px;color:#000;background-color:#f2f2f2;border-radius:10px;margin:-2px 0}.badge.get{color:#70bbe1;background-color:#d9edf7}.badge.head{color:#70bbe1;background-color:#d9edf7}.badge.options{color:#70bbe1;background-color:#d9edf7}.badge.put{color:#f0db70;background-color:#fcf8e3}.badge.patch{color:#f0db70;background-color:#fcf8e3}.badge.post{color:#93cd7c;background-color:#dff0d8}.badge.delete{color:#ce8383;background-color:#f2dede}.collapse-button{float:right}.collapse-button .close{display:none;color:#428bca;cursor:pointer}.collapse-button .open{color:#428bca;cursor:pointer}.collapse-button.show .close{display:inline}.collapse-button.show .open{display:none}.collapse-content{max-height:0;overflow:hidden;transition:max-height .3s ease-in-out}nav{width:220px}.container{max-width:940px;margin-left:auto;margin-right:auto}.container .row .content{margin-left:244px;width:696px}.container .row:after{content:'';display:block;clear:both}.container-fluid nav{width:22%}.container-fluid .row .content{margin-left:24%}.container-fluid.triple nav{width:16.5%;padding-right:1px}.container-fluid.triple .row .content{position:relative;margin-left:16.5%;padding-left:24px}.middle:before,.middle:after{content:'';display:table}.middle:after{clear:both}.middle{box-sizing:border-box;width:51.5%;padding-right:12px}.right{box-sizing:border-box;float:right;width:48.5%;padding-left:12px}.right a{color:#428bca}.right h1,.right h2,.right h3,.right h4,.right h5,.right p,.right div{color:white}.right pre{background-color:#1d1f21;border:1px solid #1d1f21}.right pre code{color:#c5c8c6}.right .description{margin-top:12px}.triple .resource-heading{font-size:125%}.definition{margin-top:12px;margin-bottom:12px}.definition .method{font-weight:bold}.definition .method.get{color:#2e8ab8}.definition .method.head{color:#2e8ab8}.definition .method.options{color:#2e8ab8}.definition .method.post{color:#56b82e}.definition .method.put{color:#b8a22e}.definition .method.patch{color:#b8a22e}.definition .method.delete{color:#b82e2e}.definition .uri{word-break:break-all;word-wrap:break-word}.definition .hostname{opacity:.5}.example-names{background-color:#eee;padding:12px;border-radius:6px}.example-names .tab-button{cursor:pointer;color:black;border:1px solid #ddd;padding:6px;margin-left:12px}.example-names .tab-button.active{background-color:#d5d5d5}.right .example-names{background-color:#444}.right .example-names .tab-button{color:white;border:1px solid #666;border-radius:6px}.right .example-names .tab-button.active{background-color:#5e5e5e}#nav-background{position:fixed;left:0;top:0;bottom:0;width:16.5%;padding-right:14.4px;background-color:#fbfbfb;border-right:1px solid #f0f0f0;z-index:-1}#right-panel-background{position:absolute;right:-12px;top:-12px;bottom:-12px;width:48.6%;background-color:#333;z-index:-1}@media (max-width:1200px){nav{width:198px}.container{max-width:840px}.container .row .content{margin-left:224px;width:606px}}@media (max-width:992px){nav{width:169.4px}.container{max-width:720px}.container .row .content{margin-left:194px;width:526px}}@media (max-width:768px){nav{display:none}.container{width:95%;max-width:none}.container .row .content,.container-fluid .row .content,.container-fluid.triple .row .content{margin-left:auto;margin-right:auto;width:95%}#nav-background{display:none}#right-panel-background{width:48.6%}}.back-to-top{position:fixed;z-index:1;bottom:0;right:24px;padding:4px 8px;color:rgba(0,0,0,0.5);background-color:#f2f2f2;text-decoration:none !important;border-top:1px solid #d9d9d9;border-left:1px solid #d9d9d9;border-right:1px solid #d9d9d9;border-top-left-radius:3px;border-top-right-radius:3px}.resource-group{padding:12px;margin-bottom:12px;background-color:white;border:1px solid #d9d9d9;border-radius:6px}.resource-group h2.group-heading,.resource-group .heading a{padding:12px;margin:-12px -12px 12px -12px;background-color:#f2f2f2;border-bottom:1px solid #d9d9d9;border-top-left-radius:6px;border-top-right-radius:6px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.triple .content .resource-group{padding:0;border:none}.triple .content .resource-group h2.group-heading,.triple .content .resource-group .heading a{margin:0 0 12px 0;border:1px solid #d9d9d9}nav .resource-group .heading a{padding:12px;margin-bottom:0}nav .resource-group .collapse-content{padding:0}.action{margin-bottom:12px;padding:12px 12px 0 12px;overflow:hidden;border:1px solid transparent;border-radius:6px}.action h4.action-heading{padding:6px 12px;margin:-12px -12px 12px -12px;border-bottom:1px solid transparent;border-top-left-radius:6px;border-top-right-radius:6px;overflow:hidden}.action h4.action-heading .name{float:right;font-weight:normal;padding:6px 0}.action h4.action-heading .method{padding:6px 12px;margin-right:12px;border-radius:3px;display:inline-block}.action h4.action-heading .method.get{color:#fff;background-color:#337ab7}.action h4.action-heading .method.head{color:#fff;background-color:#337ab7}.action h4.action-heading .method.options{color:#fff;background-color:#337ab7}.action h4.action-heading .method.put{color:#fff;background-color:#ed9c28}.action h4.action-heading .method.patch{color:#fff;background-color:#ed9c28}.action h4.action-heading .method.post{color:#fff;background-color:#5cb85c}.action h4.action-heading .method.delete{color:#fff;background-color:#d9534f}.action h4.action-heading code{color:#444;background-color:#f5f5f5;border-color:#cfcfcf;font-weight:normal;word-break:break-all;display:inline-block;margin-top:2px}.action dl.inner{padding-bottom:2px}.action .title{border-bottom:1px solid white;margin:0 -12px -1px -12px;padding:12px}.action.get{border-color:#bce8f1}.action.get h4.action-heading{color:#337ab7;background:#d9edf7;border-bottom-color:#bce8f1}.action.head{border-color:#bce8f1}.action.head h4.action-heading{color:#337ab7;background:#d9edf7;border-bottom-color:#bce8f1}.action.options{border-color:#bce8f1}.action.options h4.action-heading{color:#337ab7;background:#d9edf7;border-bottom-color:#bce8f1}.action.post{border-color:#d6e9c6}.action.post h4.action-heading{color:#5cb85c;background:#dff0d8;border-bottom-color:#d6e9c6}.action.put{border-color:#faebcc}.action.put h4.action-heading{color:#ed9c28;background:#fcf8e3;border-bottom-color:#faebcc}.action.patch{border-color:#faebcc}.action.patch h4.action-heading{color:#ed9c28;background:#fcf8e3;border-bottom-color:#faebcc}.action.delete{border-color:#ebccd1}.action.delete h4.action-heading{color:#d9534f;background:#f2dede;border-bottom-color:#ebccd1}</style></head><body class="preload"><a href="#top" class="text-muted back-to-top"><i class="fa fa-toggle-up"></i> Back to top</a><div class="container-fluid"><div class="row"><nav><div class="resource-group"><div class="heading"><div class="chevron"><i class="open fa fa-angle-down"></i></div><a href="#top">Overview</a></div><div class="collapse-content"><ul><li><a href="#header-authorization">Authorization</a></li><li><a href="#header-security">Security</a></li><li><a href="#header-requests">Requests</a></li><li><a href="#header-responses">Responses</a></li></ul></div></div><div class="resource-group"><div class="heading"><div class="chevron"><i class="open fa fa-angle-down"></i></div><a href="#">Resources</a></div><div class="collapse-content"><ul><li><a href="#accounts">Accounts</a><ul><li><a href="#accounts-get"><span class="badge get"><i class="fa fa-arrow-down"></i></span>Read an account profile</a></li><li><a href="#accounts-get-1"><span class="badge get"><i class="fa fa-arrow-down"></i></span>Read account profiles</a></li><li><a href="#accounts-put"><span class="badge put"><i class="fa fa-pencil"></i></span>Update an account profile</a></li><li><a href="#accounts-delete"><span class="badge delete"><i class="fa fa-times"></i></span>Delete an account</a></li></ul></li><li><a href="#sites">Sites</a><ul><li><a href="#sites-get"><span class="badge get"><i class="fa fa-arrow-down"></i></span>Read available sites</a></li><li><a href="#sites-get-1"><span class="badge get"><i class="fa fa-arrow-down"></i></span>Read site information</a></li><li><a href="#sites-delete"><span class="badge delete"><i class="fa fa-times"></i></span>Leave a site</a></li></ul></li><li><a href="#invitations">Invitations</a><ul><li><a href="#invitations-post"><span class="badge post"><i class="fa fa-plus"></i></span>Send an invitation</a></li><li><a href="#invitations-get"><span class="badge get"><i class="fa fa-arrow-down"></i></span>Review an invitation</a></li><li><a href="#invitations-put"><span class="badge put"><i class="fa fa-pencil"></i></span>Accept an invitation</a></li><li><a href="#invitations-delete"><span class="badge delete"><i class="fa fa-times"></i></span>Cancel an invitation</a></li></ul></li></ul></div></div><p style="text-align: center; word-wrap: break-word;"><a href="https://microclimates.com">https://microclimates.com</a></p></nav><div class="content"><header><h1 id="top">Climate Conrol API</h1></header><p>The Microclimates Climate Control API lets you connect
with external products and services, eliminating built-in constraints, and extending
functionality to the limits of your imagination.</p>
<p>Your devices. Your data. On your terms.</p>
<p>When connected with vendor APIs and services like <a href="https://ifttt.com" target="_blank">IFTTT</a>,
your favorite developer or
<a href="https://www.microclimates.com/professional-services" target="_blank">professional services</a>
team can build custom integrations, consolidating previously disconnected systems into one.</p>
<p>A live preview for developers is hosted on
<a href="https://microclimates.docs.apiary.io" target="_blank">microclimates.docs.apiary.io</a></p>
<h1 id="header-authorization">Authorization <a class="permalink" href="#header-authorization" aria-hidden="true">¶</a></h1>
<p>All API interactions must be authorized by passing
the account API token in the HTTP Authorization header.</p>
<pre><code><span class="hljs-attribute">Authorization</span>: <span class="hljs-string">Bearer {API Token}</span></code></pre>
<p>This token is available in the Account Settings section within the Microclimates
application under <i>API Key</i>.</p>
<p>Example:</p>
<pre><code>Authorization: Bearer eb4b8e6c-0e51-4f96-bec2-1e5b1a9b2009</code></pre>
<h1 id="header-security">Security <a class="permalink" href="#header-security" aria-hidden="true">¶</a></h1>
<p>The API processes only HTTPS requests, securing the content from
observation while traveling over the network.</p>
<p>The resource ID and request parameters may be part of the URL, but all resource
data is passed in the request/response body, as to not get logged on the server.</p>
<p>If you feel your API token has been compromised, the token can be revoked and replaced
within the Microclimates application.</p>
<h1 id="header-requests">Requests <a class="permalink" href="#header-requests" aria-hidden="true">¶</a></h1>
<p><h2>Request Headers</h2></p>
<p>The following (case insensitive) request headers are recognized</p>
<p><strong>authorization</strong> - (see Authorization section above)<br>
<strong>content-type</strong> - Describes the format of the request body. One of <code>application/json</code> or <code>application/x-www-form-urlencoded</code><br>
<strong>accept-encoding</strong> - Supplied if your client accepts gzip, deflate, etc. encoding<br>
<strong>if-none-match</strong> - Supplied on <em>GET</em> requests if you want a <code>304 - Not Modified</code> response if the content hasn’t changed. The value is that of a prior <code>etag</code> response header value. This improves performance by not transferrng the response body if it’s the same as a prior request.</p>
<p><h2>Request Body</h2></p>
<p>The format of data supplied in the request body is based on the <code>Content-Type</code> header
(see above).</p>
<p><strong>Example: applicaton/json</strong></p>
<pre><code><span class="hljs-collection">{
<span class="hljs-string">"id"</span>: <span class="hljs-string">"some-resource-id"</span>,
<span class="hljs-string">"name"</span>:<span class="hljs-string">"Resource Name"</span>,
...
}</span></code></pre>
<p>JSON data may be, but is not required to be pretty printed as in the above example.</p>
<p><strong>Example: application/x-www-form-urlencoded</strong></p>
<pre><code><span class="hljs-property">id</span>=<span class="hljs-keyword">some</span>-resource-<span class="hljs-property">id</span>&<span class="hljs-property">name</span>=Resource%<span class="hljs-number">20</span>Name</code></pre>
<h1 id="header-responses">Responses <a class="permalink" href="#header-responses" aria-hidden="true">¶</a></h1>
<p><h2>Status Codes</h2></p>
<p><strong>The following codes indicate success:</strong></p>
<p><strong>200</strong> <em>OK</em> - Everything went according to plan, and the results are as documented.<br>
<strong>304</strong> <em>Not Modified</em> - No body returned. Used in conjunction with the <code>if-none-match</code> request header.</p>
<p><strong>The following codes indicate an error.</strong> They return an error body vs. the documented body, for the following reasons</p>
<p><strong>400</strong> <em>Bad Request</em> - The request fails a precondition and was rejected. Reason indicated in the body.<br>
<strong>401</strong> <em>Unauthorized</em> - Authorization header not supplied, or supplied with an invalid token.<br>
<strong>404</strong> <em>Not Found</em> - The resource requested by ID is not found in the system.<br>
<strong>500</strong> <em>Internal Server Error</em> - Oh crap - something bad happened on our end. You might find something useful in the response body.<br>
<strong>501</strong> <em>Not Implemented</em> - Coming soon to an API near you.<br>
<strong>503</strong> <em>Bad Gateway</em> - The cloud servers are having a problem connecting with the on-site edge server.</p>
<p><h2>Response Headers</h2></p>
<p><strong>content-encoding</strong> - Supplied if the content was encoded, as requested by the <code>accept-encoding</code> request header.<br>
<strong>content-length</strong> - Byte count of the content body<br>
<strong>content-type</strong> - The content type response. Usually <code>appliction/json; charset-utf-8</code><br>
<strong>date</strong> - The timestamp that the request arrived<br>
<strong>etag</strong> - A unique value representing the content of this response. If this value is supplied in a subsequent <code>if-none-match</code> request header and the content hasn’t changed, the response code will be <code>304 - Not Modified</code>.<br>
<strong>status</strong> - The respons status code (see above)<br>
<strong>vary</strong> - A value that may be supplied, informing network caches how this content varies so they can quickly respond to similar requests.<br>
<strong>x-request-id</strong> - A unique identifier for this request. If a request fails, this can be used to help trace the problem from server logs.<br>
<strong>x-response-time</strong> - The amount of time this request took for the server to process.<br>
<strong>Access-Control-Allow-Origin</strong> - Set to <code>*</code> to allow cross domain browser requests.<br>
<strong>Access-Control-Allow-Headers</strong> - Set to <code>Authorization, Cookie</code> to allow authorization.<br>
<strong>Access-Control-Allow-Methods</strong> - Set to <code>GET, POST, PUT, DELETE</code> to allow all API requests.</p>
<p><h2>Response Body</h2></p>
<p><strong>Successful</strong> API calls are documented in the API below.</p>
<p><strong>Unsuccessful</strong> API calls (status code 400 or higher) have the following format. Clients should be capable of managing the different response body formats based on the response status code.</p>
<pre><code>{
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Unauthorized"</span></span>,
"<span class="hljs-attribute">statusCode</span>": <span class="hljs-value"><span class="hljs-number">401</span></span>,
"<span class="hljs-attribute">message</span>": <span class="hljs-value"><span class="hljs-string">"HTTP 401 Unauthorized"</span></span>,
"<span class="hljs-attribute">timestamp</span>": <span class="hljs-value"><span class="hljs-string">"2018-08-19T18:05:17.480Z"</span></span>,
"<span class="hljs-attribute">requestId</span>": <span class="hljs-value"><span class="hljs-string">"f14d156c-5e90-4457-aaa6-d8f6757b07ba"</span></span>,
"<span class="hljs-attribute">meta</span>": <span class="hljs-value">{
"<span class="hljs-attribute">warnings</span>": <span class="hljs-value">[]</span>,
"<span class="hljs-attribute">moreInfo</span>": <span class="hljs-value">[]
</span>}
</span>}</code></pre>
<section id="" class="resource-group"><h2 class="group-heading">Resources <a href="#" class="permalink">¶</a></h2><div id="accounts" class="resource"><h3 class="resource-heading">Accounts <a href="#accounts" class="permalink"> ¶</a></h3><p>Account - <em>Information associated with an individual that interacts with the system</em></p>
<div id="accounts-get" class="action get"><h4 class="action-heading"><div class="name">Read an account profile</div><a href="#accounts-get" class="method get">GET</a><code class="uri">/api/v2/accounts/{accountId}</code></h4><h2 id="header-read-an-account-profile-try-it">Read an account profile <a class="tryit hidden" target="_blank" href="https://microclimates.docs.apiary.io/#reference/0/accounts/read-an-account-profile?console=1">Try it</a> <a class="permalink" href="#header-read-an-account-profile-try-it" aria-hidden="true">¶</a></h2>
<p>Returns the account profile for the specified ID.</p>
<h4>Example URI</h4><div class="definition"><span class="method get">GET</span> <span class="uri"><span class="hostname">https://microclimates.com</span>/api/v2/accounts/<span class="hljs-attribute" title="accountId">1e46f669-cf98-4d04-8d19-34fd93feea19</span></span></div><div class="title"><strong>URI Parameters</strong><div class="collapse-button show"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><dl class="inner"><dt>accountId</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>1e46f669-cf98-4d04-8d19-34fd93feea19</span></span><p>The account resource id</p>
</dd></dl></div><div class="title"><strong>Request</strong><div class="collapse-button"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Authorization</span>: <span class="hljs-string">Basic eb4b8e6c-0e51-4f96-bec2-1e5b1a9b2009</span></code></pre><div style="height: 1px;"></div></div></div><div class="title"><strong>Response <code>200</code></strong><div class="collapse-button"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-string">"3627cc99-d839-4684-bd78-8322703b273f"</span></span>,
"<span class="hljs-attribute">firstName</span>": <span class="hljs-value"><span class="hljs-string">"John"</span></span>,
"<span class="hljs-attribute">lastName</span>": <span class="hljs-value"><span class="hljs-string">"Jones"</span></span>,
"<span class="hljs-attribute">email</span>": <span class="hljs-value"><span class="hljs-string">"jjones84@gmail.com"</span></span>,
"<span class="hljs-attribute">phone</span>": <span class="hljs-value"><span class="hljs-string">"402 889-8765"</span></span>,
"<span class="hljs-attribute">avatarUrl</span>": <span class="hljs-value"><span class="hljs-string">"https://www.gravatar.com/avatar/205e460b479e2e5b48aec07710c08d50"</span>
</span>}</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The unique account identifier, used in subsequent PUT or DELETE calls."</span>
</span>}</span>,
"<span class="hljs-attribute">firstName</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span>
</span>}</span>,
"<span class="hljs-attribute">lastName</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span>
</span>}</span>,
"<span class="hljs-attribute">email</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span>
</span>}</span>,
"<span class="hljs-attribute">phone</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Mobile phone number (North America only)"</span>
</span>}</span>,
"<span class="hljs-attribute">avatarUrl</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"This starts out as a gravatar URL, and can be changed by uploading an avatar."</span>
</span>}
</span>}</span>,
"<span class="hljs-attribute">required</span>": <span class="hljs-value">[
<span class="hljs-string">"firstName"</span>,
<span class="hljs-string">"email"</span>
]
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div id="accounts-get-1" class="action get"><h4 class="action-heading"><div class="name">Read account profiles</div><a href="#accounts-get-1" class="method get">GET</a><code class="uri">/api/v2/accounts</code></h4><h2 id="header-read-account-profiles-try-it">Read account profiles <a class="tryit hidden" target="_blank" href="https://microclimates.docs.apiary.io/#reference/0/accounts/read-account-profiles?console=1">Try it</a> <a class="permalink" href="#header-read-account-profiles-try-it" aria-hidden="true">¶</a></h2>
<p>Returns an array of account profiles. This will return a single account profile of the person making the request. It’s useful if you have an Authorization token, but don’t have the account ID.</p>
<h4>Example URI</h4><div class="definition"><span class="method get">GET</span> <span class="uri"><span class="hostname">https://microclimates.com</span>/api/v2/accounts</span></div><div class="title"><strong>Request</strong><div class="collapse-button"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Authorization</span>: <span class="hljs-string">Basic eb4b8e6c-0e51-4f96-bec2-1e5b1a9b2009</span></code></pre><div style="height: 1px;"></div></div></div><div class="title"><strong>Response <code>200</code></strong><div class="collapse-button"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>[
{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-string">"3627cc99-d839-4684-bd78-8322703b273f"</span></span>,
"<span class="hljs-attribute">firstName</span>": <span class="hljs-value"><span class="hljs-string">"John"</span></span>,
"<span class="hljs-attribute">lastName</span>": <span class="hljs-value"><span class="hljs-string">"Jones"</span></span>,
"<span class="hljs-attribute">email</span>": <span class="hljs-value"><span class="hljs-string">"jjones84@gmail.com"</span></span>,
"<span class="hljs-attribute">phone</span>": <span class="hljs-value"><span class="hljs-string">"402 889-8765"</span></span>,
"<span class="hljs-attribute">avatarUrl</span>": <span class="hljs-value"><span class="hljs-string">"https://www.gravatar.com/avatar/205e460b479e2e5b48aec07710c08d50"</span>
</span>}
]</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"array"</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div id="accounts-put" class="action put"><h4 class="action-heading"><div class="name">Update an account profile</div><a href="#accounts-put" class="method put">PUT</a><code class="uri">/api/v2/accounts/{accountId}</code></h4><h2 id="header-update-an-account-profile-try-it">Update an account profile <a class="tryit hidden" target="_blank" href="https://microclimates.docs.apiary.io/#reference/0/accounts/update-an-account-profile?console=1">Try it</a> <a class="permalink" href="#header-update-an-account-profile-try-it" aria-hidden="true">¶</a></h2>
<p>Updates your account profile. Most attributes can be updated, but not all. The <code>body</code> can contain
a subset of attributes to update, or all attributes.</p>
<p>The resource /{accountId} must be the ID associated with the Authentication token.</p>
<h4>Example URI</h4><div class="definition"><span class="method put">PUT</span> <span class="uri"><span class="hostname">https://microclimates.com</span>/api/v2/accounts/<span class="hljs-attribute" title="accountId">1e46f669-cf98-4d04-8d19-34fd93feea19</span></span></div><div class="title"><strong>URI Parameters</strong><div class="collapse-button show"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><dl class="inner"><dt>accountId</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>1e46f669-cf98-4d04-8d19-34fd93feea19</span></span><p>The account resource id</p>
</dd></dl></div><div class="title"><strong>Request</strong><div class="collapse-button"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Authorization</span>: <span class="hljs-string">Basic eb4b8e6c-0e51-4f96-bec2-1e5b1a9b2009</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-string">"3627cc99-d839-4684-bd78-8322703b273f"</span></span>,
"<span class="hljs-attribute">firstName</span>": <span class="hljs-value"><span class="hljs-string">"John"</span></span>,
"<span class="hljs-attribute">lastName</span>": <span class="hljs-value"><span class="hljs-string">"Jones"</span></span>,
"<span class="hljs-attribute">email</span>": <span class="hljs-value"><span class="hljs-string">"jjones84@gmail.com"</span></span>,
"<span class="hljs-attribute">phone</span>": <span class="hljs-value"><span class="hljs-string">"402 889-8765"</span></span>,
"<span class="hljs-attribute">avatarUrl</span>": <span class="hljs-value"><span class="hljs-string">"https://www.gravatar.com/avatar/205e460b479e2e5b48aec07710c08d50"</span>
</span>}</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The unique account identifier, used in subsequent PUT or DELETE calls."</span>
</span>}</span>,
"<span class="hljs-attribute">firstName</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span>
</span>}</span>,
"<span class="hljs-attribute">lastName</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span>
</span>}</span>,
"<span class="hljs-attribute">email</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span>
</span>}</span>,
"<span class="hljs-attribute">phone</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Mobile phone number (North America only)"</span>
</span>}</span>,
"<span class="hljs-attribute">avatarUrl</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"This starts out as a gravatar URL, and can be changed by uploading an avatar."</span>
</span>}
</span>}</span>,
"<span class="hljs-attribute">required</span>": <span class="hljs-value">[
<span class="hljs-string">"firstName"</span>,
<span class="hljs-string">"email"</span>
]</span>,
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div><div class="title"><strong>Response <code>200</code></strong><div class="collapse-button"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-string">"3627cc99-d839-4684-bd78-8322703b273f"</span></span>,
"<span class="hljs-attribute">firstName</span>": <span class="hljs-value"><span class="hljs-string">"John"</span></span>,
"<span class="hljs-attribute">lastName</span>": <span class="hljs-value"><span class="hljs-string">"Jones"</span></span>,
"<span class="hljs-attribute">email</span>": <span class="hljs-value"><span class="hljs-string">"jjones84@gmail.com"</span></span>,
"<span class="hljs-attribute">phone</span>": <span class="hljs-value"><span class="hljs-string">"402 889-8765"</span></span>,
"<span class="hljs-attribute">avatarUrl</span>": <span class="hljs-value"><span class="hljs-string">"https://www.gravatar.com/avatar/205e460b479e2e5b48aec07710c08d50"</span>
</span>}</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The unique account identifier, used in subsequent PUT or DELETE calls."</span>
</span>}</span>,
"<span class="hljs-attribute">firstName</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span>
</span>}</span>,
"<span class="hljs-attribute">lastName</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span>
</span>}</span>,
"<span class="hljs-attribute">email</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span>
</span>}</span>,
"<span class="hljs-attribute">phone</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Mobile phone number (North America only)"</span>
</span>}</span>,
"<span class="hljs-attribute">avatarUrl</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"This starts out as a gravatar URL, and can be changed by uploading an avatar."</span>
</span>}
</span>}</span>,
"<span class="hljs-attribute">required</span>": <span class="hljs-value">[
<span class="hljs-string">"firstName"</span>,
<span class="hljs-string">"email"</span>
]
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div id="accounts-delete" class="action delete"><h4 class="action-heading"><div class="name">Delete an account</div><a href="#accounts-delete" class="method delete">DELETE</a><code class="uri">/api/v2/accounts/{accountId}</code></h4><h2 id="header-delete-an-account-try-it">Delete an account <a class="tryit hidden" target="_blank" href="https://microclimates.docs.apiary.io/#reference/0/accounts/delete-an-account?console=1">Try it</a> <a class="permalink" href="#header-delete-an-account-try-it" aria-hidden="true">¶</a></h2>
<p><strong>Be very careful with this one.</strong> If you delete yourself, that will be the last API call you’re
able to make. You will be removed from all sites, and will have to be re-invited. Your account id and
API keys will be different, even if you’re invited with the same email address.</p>
<p>The resource /{accountId} must be the ID associated with the Authentication token.</p>
<h4>Example URI</h4><div class="definition"><span class="method delete">DELETE</span> <span class="uri"><span class="hostname">https://microclimates.com</span>/api/v2/accounts/<span class="hljs-attribute" title="accountId">1e46f669-cf98-4d04-8d19-34fd93feea19</span></span></div><div class="title"><strong>URI Parameters</strong><div class="collapse-button show"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><dl class="inner"><dt>accountId</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>1e46f669-cf98-4d04-8d19-34fd93feea19</span></span><p>The account resource id</p>
</dd></dl></div><div class="title"><strong>Request</strong><div class="collapse-button"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Authorization</span>: <span class="hljs-string">Basic eb4b8e6c-0e51-4f96-bec2-1e5b1a9b2009</span></code></pre><div style="height: 1px;"></div></div></div><div class="title"><strong>Response <code>200</code></strong></div></div></div><div id="sites" class="resource"><h3 class="resource-heading">Sites <a href="#sites" class="permalink"> ¶</a></h3><p>Site - <em>A physical installation with managed devices.</em> All sites are associated with a <em>site server</em>,
also known as an <em>edge server</em>, responsible for managing devices, accounts, and security for the location.</p>
<div id="sites-get" class="action get"><h4 class="action-heading"><div class="name">Read available sites</div><a href="#sites-get" class="method get">GET</a><code class="uri">/api/v2/sites</code></h4><h2 id="header-read-available-sites-try-it">Read available sites <a class="tryit hidden" target="_blank" href="https://microclimates.docs.apiary.io/#reference/0/sites/read-available-sites?console=1">Try it</a> <a class="permalink" href="#header-read-available-sites-try-it" aria-hidden="true">¶</a></h2>
<p>Returns all sites authorized for the account, as specified in the Authorization token.</p>
<p>This request is served without directly contacting the site servers.</p>
<h4>Example URI</h4><div class="definition"><span class="method get">GET</span> <span class="uri"><span class="hostname">https://microclimates.com</span>/api/v2/sites</span></div><div class="title"><strong>Request</strong><div class="collapse-button"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Authorization</span>: <span class="hljs-string">Basic eb4b8e6c-0e51-4f96-bec2-1e5b1a9b2009</span></code></pre><div style="height: 1px;"></div></div></div><div class="title"><strong>Response <code>200</code></strong><div class="collapse-button"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>[
{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-string">"a908"</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Indoor Farm North"</span></span>,
"<span class="hljs-attribute">role</span>": <span class="hljs-value"><span class="hljs-number">1</span>
</span>}
]</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"array"</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div id="sites-get-1" class="action get"><h4 class="action-heading"><div class="name">Read site information</div><a href="#sites-get-1" class="method get">GET</a><code class="uri">/api/v2/sites/{siteId}</code></h4><h2 id="header-read-site-information-try-it">Read site information <a class="tryit hidden" target="_blank" href="https://microclimates.docs.apiary.io/#reference/0/sites/read-site-information?console=1">Try it</a> <a class="permalink" href="#header-read-site-information-try-it" aria-hidden="true">¶</a></h2>
<p>Returns site details for the account. This request is made to the site server.</p>
<h4>Example URI</h4><div class="definition"><span class="method get">GET</span> <span class="uri"><span class="hostname">https://microclimates.com</span>/api/v2/sites/<span class="hljs-attribute" title="siteId">a908</span></span></div><div class="title"><strong>URI Parameters</strong><div class="collapse-button show"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><dl class="inner"><dt>siteId</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>a908</span></span><p>The ID of the site</p>
</dd></dl></div><div class="title"><strong>Request</strong><div class="collapse-button"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Authorization</span>: <span class="hljs-string">Basic eb4b8e6c-0e51-4f96-bec2-1e5b1a9b2009</span></code></pre><div style="height: 1px;"></div></div></div><div class="title"><strong>Response <code>200</code></strong><div class="collapse-button"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-string">"a908"</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Indoor Farm North"</span></span>,
"<span class="hljs-attribute">role</span>": <span class="hljs-value"><span class="hljs-number">0</span></span>,
"<span class="hljs-attribute">menu</span>": <span class="hljs-value">[
{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-string">"clone-room-one"</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Clone Room"</span></span>,
"<span class="hljs-attribute">icon</span>": <span class="hljs-value"><span class="hljs-string">"location"</span></span>,
"<span class="hljs-attribute">slug</span>": <span class="hljs-value"><span class="hljs-string">"clone-room-one"</span></span>,
"<span class="hljs-attribute">url</span>": <span class="hljs-value"><span class="hljs-string">"https://my-site.com/clone-room-one"</span></span>,
"<span class="hljs-attribute">hubId</span>": <span class="hljs-value"><span class="hljs-string">"d8Je"</span></span>,
"<span class="hljs-attribute">dashId</span>": <span class="hljs-value"><span class="hljs-string">"clone-room"</span></span>,
"<span class="hljs-attribute">page</span>": <span class="hljs-value"><span class="hljs-string">"account-settings"</span></span>,
"<span class="hljs-attribute">modalpage</span>": <span class="hljs-value"><span class="hljs-string">"account-settings"</span></span>,
"<span class="hljs-attribute">items</span>": <span class="hljs-value">[
{}
]
</span>}
]
</span>}</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The unique identifier, to be used as siteId in site related API requests."</span>
</span>}</span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Name given to the site by the site owner."</span>
</span>}</span>,
"<span class="hljs-attribute">role</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"number"</span></span>,
"<span class="hljs-attribute">enum</span>": <span class="hljs-value">[
<span class="hljs-number">0</span>,
<span class="hljs-number">1</span>,
<span class="hljs-number">2</span>,
<span class="hljs-number">3</span>,
<span class="hljs-number">4</span>
]</span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The primary role of the requester (0:guest, 1:monitor, 2:controller, 3:admin, 4:owner)"</span>
</span>}</span>,
"<span class="hljs-attribute">menu</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"array"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The list of menu items available to the requester"</span>
</span>}
</span>}
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div id="sites-delete" class="action delete"><h4 class="action-heading"><div class="name">Leave a site</div><a href="#sites-delete" class="method delete">DELETE</a><code class="uri">/api/v2/sites/{siteId}</code></h4><h2 id="header-leave-a-site-try-it">Leave a site <a class="tryit hidden" target="_blank" href="https://microclimates.docs.apiary.io/#reference/0/sites/leave-a-site?console=1">Try it</a> <a class="permalink" href="#header-leave-a-site-try-it" aria-hidden="true">¶</a></h2>
<p>This requests the account specified by the Authorization token to leave the site.
Once an account owner has left a site, they must be invited back in.</p>
<h4>Example URI</h4><div class="definition"><span class="method delete">DELETE</span> <span class="uri"><span class="hostname">https://microclimates.com</span>/api/v2/sites/<span class="hljs-attribute" title="siteId">a908</span></span></div><div class="title"><strong>URI Parameters</strong><div class="collapse-button show"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><dl class="inner"><dt>siteId</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>a908</span></span><p>The ID of the site</p>
</dd></dl></div><div class="title"><strong>Request</strong><div class="collapse-button"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Authorization</span>: <span class="hljs-string">Basic eb4b8e6c-0e51-4f96-bec2-1e5b1a9b2009</span></code></pre><div style="height: 1px;"></div></div></div><div class="title"><strong>Response <code>200</code></strong></div></div></div><div id="invitations" class="resource"><h3 class="resource-heading">Invitations <a href="#invitations" class="permalink"> ¶</a></h3><p>Invitation - <em>A request to invite a person to a site</em>. Sites are accessible by invite only.</p>
<div id="invitations-post" class="action post"><h4 class="action-heading"><div class="name">Send an invitation</div><a href="#invitations-post" class="method post">POST</a><code class="uri">/api/v2/invites</code></h4><h2 id="header-send-an-invitation-try-it">Send an invitation <a class="tryit hidden" target="_blank" href="https://microclimates.docs.apiary.io/#reference/0/invitations/send-an-invitation?console=1">Try it</a> <a class="permalink" href="#header-send-an-invitation-try-it" aria-hidden="true">¶</a></h2>
<p>Send an email invitation to join a site. This includes the security role for the individual
and a custom message from the sender, so the recipient knows it didn’t originate from a robot.</p>
<h4>Example URI</h4><div class="definition"><span class="method post">POST</span> <span class="uri"><span class="hostname">https://microclimates.com</span>/api/v2/invites</span></div><div class="title"><strong>Request</strong><div class="collapse-button"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Authorization</span>: <span class="hljs-string">Basic eb4b8e6c-0e51-4f96-bec2-1e5b1a9b2009</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-string">"3627cc99-d839-4684-bd78-8322703b273f"</span></span>,
"<span class="hljs-attribute">siteId</span>": <span class="hljs-value"><span class="hljs-string">"a908"</span></span>,
"<span class="hljs-attribute">siteName</span>": <span class="hljs-value"><span class="hljs-string">"Indoor Farm North"</span></span>,
"<span class="hljs-attribute">invitedBy</span>": <span class="hljs-value"><span class="hljs-string">"Mary Maker"</span></span>,
"<span class="hljs-attribute">role</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">firstName</span>": <span class="hljs-value"><span class="hljs-string">"Johnny"</span></span>,
"<span class="hljs-attribute">lastName</span>": <span class="hljs-value"><span class="hljs-string">"Jones"</span></span>,
"<span class="hljs-attribute">email</span>": <span class="hljs-value"><span class="hljs-string">"jjones84@gmail.com"</span></span>,
"<span class="hljs-attribute">message</span>": <span class="hljs-value"><span class="hljs-string">"Come see what we're doing here."</span>
</span>}</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The unique invite identifier. Generated on the server."</span>
</span>}</span>,
"<span class="hljs-attribute">siteId</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"ID of the site being invited into."</span>
</span>}</span>,
"<span class="hljs-attribute">siteName</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Site name. Provided for convenience on GET."</span>
</span>}</span>,
"<span class="hljs-attribute">invitedBy</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Invitation created by. Provided for convenience on GET."</span>
</span>}</span>,
"<span class="hljs-attribute">role</span>": <span class="hljs-value">{
"<span class="hljs-attribute">enum</span>": <span class="hljs-value">[
<span class="hljs-literal">null</span>,
<span class="hljs-number">0</span>,
<span class="hljs-number">1</span>,
<span class="hljs-number">2</span>,
<span class="hljs-number">3</span>,
<span class="hljs-number">4</span>
]</span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The security role of the account for this site. (0:guest, 1:monitor, 2:controller, 3:admin, 4:owner)"</span>
</span>}</span>,
"<span class="hljs-attribute">firstName</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"First name of the person being invited."</span>
</span>}</span>,
"<span class="hljs-attribute">lastName</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Last name of the person being invited."</span>
</span>}</span>,
"<span class="hljs-attribute">email</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Email address of the invitee."</span>
</span>}</span>,
"<span class="hljs-attribute">message</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Personal message to send to the person being invited."</span>
</span>}
</span>}</span>,
"<span class="hljs-attribute">required</span>": <span class="hljs-value">[
<span class="hljs-string">"siteId"</span>,
<span class="hljs-string">"role"</span>,
<span class="hljs-string">"firstName"</span>,
<span class="hljs-string">"email"</span>
]</span>,
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div><div class="title"><strong>Response <code>200</code></strong></div></div><div id="invitations-get" class="action get"><h4 class="action-heading"><div class="name">Review an invitation</div><a href="#invitations-get" class="method get">GET</a><code class="uri">/api/v2/invites/{inviteId}</code></h4><h2 id="header-review-an-invitation-try-it">Review an invitation <a class="tryit hidden" target="_blank" href="https://microclimates.docs.apiary.io/#reference/0/invitations/review-an-invitation?console=1">Try it</a> <a class="permalink" href="#header-review-an-invitation-try-it" aria-hidden="true">¶</a></h2>
<p>This is used by the person being invited as a way to see who invited them, and into which
site they’re being invited into.</p>
<p>This request may accept authorization, and if given it must match the credentials of
the person being invited, or the person that created the invitation.</p>
<h4>Example URI</h4><div class="definition"><span class="method get">GET</span> <span class="uri"><span class="hostname">https://microclimates.com</span>/api/v2/invites/<span class="hljs-attribute" title="inviteId">some-long-uuid</span></span></div><div class="title"><strong>URI Parameters</strong><div class="collapse-button show"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><dl class="inner"><dt>inviteId</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>some-long-uuid</span></span><p>The invite ID, generated during POST.</p>
</dd></dl></div><div class="title"><strong>Response <code>200</code></strong><div class="collapse-button"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-string">"3627cc99-d839-4684-bd78-8322703b273f"</span></span>,
"<span class="hljs-attribute">siteId</span>": <span class="hljs-value"><span class="hljs-string">"a908"</span></span>,
"<span class="hljs-attribute">siteName</span>": <span class="hljs-value"><span class="hljs-string">"Indoor Farm North"</span></span>,
"<span class="hljs-attribute">invitedBy</span>": <span class="hljs-value"><span class="hljs-string">"Mary Maker"</span></span>,
"<span class="hljs-attribute">role</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">firstName</span>": <span class="hljs-value"><span class="hljs-string">"Johnny"</span></span>,
"<span class="hljs-attribute">lastName</span>": <span class="hljs-value"><span class="hljs-string">"Jones"</span></span>,
"<span class="hljs-attribute">email</span>": <span class="hljs-value"><span class="hljs-string">"jjones84@gmail.com"</span></span>,
"<span class="hljs-attribute">message</span>": <span class="hljs-value"><span class="hljs-string">"Come see what we're doing here."</span>
</span>}</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The unique invite identifier. Generated on the server."</span>
</span>}</span>,
"<span class="hljs-attribute">siteId</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"ID of the site being invited into."</span>
</span>}</span>,
"<span class="hljs-attribute">siteName</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Site name. Provided for convenience on GET."</span>
</span>}</span>,
"<span class="hljs-attribute">invitedBy</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Invitation created by. Provided for convenience on GET."</span>
</span>}</span>,
"<span class="hljs-attribute">role</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"number"</span></span>,
"<span class="hljs-attribute">enum</span>": <span class="hljs-value">[
<span class="hljs-number">0</span>,
<span class="hljs-number">1</span>,
<span class="hljs-number">2</span>,
<span class="hljs-number">3</span>,
<span class="hljs-number">4</span>
]</span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The security role of the account for this site. (0:guest, 1:monitor, 2:controller, 3:admin, 4:owner)"</span>
</span>}</span>,
"<span class="hljs-attribute">firstName</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"First name of the person being invited."</span>
</span>}</span>,
"<span class="hljs-attribute">lastName</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Last name of the person being invited."</span>
</span>}</span>,
"<span class="hljs-attribute">email</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Email address of the invitee."</span>
</span>}</span>,
"<span class="hljs-attribute">message</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Personal message to send to the person being invited."</span>
</span>}
</span>}</span>,
"<span class="hljs-attribute">required</span>": <span class="hljs-value">[
<span class="hljs-string">"siteId"</span>,
<span class="hljs-string">"role"</span>,
<span class="hljs-string">"firstName"</span>,
<span class="hljs-string">"email"</span>
]
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div id="invitations-put" class="action put"><h4 class="action-heading"><div class="name">Accept an invitation</div><a href="#invitations-put" class="method put">PUT</a><code class="uri">/api/v2/invites/{inviteId}</code></h4><h2 id="header-accept-an-invitation-try-it">Accept an invitation <a class="tryit hidden" target="_blank" href="https://microclimates.docs.apiary.io/#reference/0/invitations/accept-an-invitation?console=1">Try it</a> <a class="permalink" href="#header-accept-an-invitation-try-it" aria-hidden="true">¶</a></h2>
<p>This is used by the person being invited upon accepting the invite. It creates the user
account if necessary, and associates the account with the site.</p>
<p>This request may accept authorization, and if given it must match the credentials of
the person being invited.</p>
<p>Invitations that have not been accepted within a few days of creation will be invalidated.</p>
<h4>Example URI</h4><div class="definition"><span class="method put">PUT</span> <span class="uri"><span class="hostname">https://microclimates.com</span>/api/v2/invites/<span class="hljs-attribute" title="inviteId">some-long-uuid</span></span></div><div class="title"><strong>URI Parameters</strong><div class="collapse-button show"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><dl class="inner"><dt>inviteId</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>some-long-uuid</span></span><p>The invite ID, generated during POST.</p>
</dd></dl></div><div class="title"><strong>Request</strong><div class="collapse-button"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Authorization</span>: <span class="hljs-string">Basic eb4b8e6c-0e51-4f96-bec2-1e5b1a9b2009</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-string">"3627cc99-d839-4684-bd78-8322703b273f"</span></span>,
"<span class="hljs-attribute">siteId</span>": <span class="hljs-value"><span class="hljs-string">"a908"</span></span>,
"<span class="hljs-attribute">siteName</span>": <span class="hljs-value"><span class="hljs-string">"Indoor Farm North"</span></span>,
"<span class="hljs-attribute">invitedBy</span>": <span class="hljs-value"><span class="hljs-string">"Mary Maker"</span></span>,
"<span class="hljs-attribute">role</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">firstName</span>": <span class="hljs-value"><span class="hljs-string">"Johnny"</span></span>,
"<span class="hljs-attribute">lastName</span>": <span class="hljs-value"><span class="hljs-string">"Jones"</span></span>,
"<span class="hljs-attribute">email</span>": <span class="hljs-value"><span class="hljs-string">"jjones84@gmail.com"</span></span>,
"<span class="hljs-attribute">message</span>": <span class="hljs-value"><span class="hljs-string">"Come see what we're doing here."</span>
</span>}</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The unique invite identifier. Generated on the server."</span>
</span>}</span>,
"<span class="hljs-attribute">siteId</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"ID of the site being invited into."</span>
</span>}</span>,
"<span class="hljs-attribute">siteName</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Site name. Provided for convenience on GET."</span>
</span>}</span>,
"<span class="hljs-attribute">invitedBy</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Invitation created by. Provided for convenience on GET."</span>
</span>}</span>,
"<span class="hljs-attribute">role</span>": <span class="hljs-value">{
"<span class="hljs-attribute">enum</span>": <span class="hljs-value">[
<span class="hljs-literal">null</span>,
<span class="hljs-number">0</span>,
<span class="hljs-number">1</span>,
<span class="hljs-number">2</span>,
<span class="hljs-number">3</span>,
<span class="hljs-number">4</span>
]</span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The security role of the account for this site. (0:guest, 1:monitor, 2:controller, 3:admin, 4:owner)"</span>
</span>}</span>,
"<span class="hljs-attribute">firstName</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"First name of the person being invited."</span>
</span>}</span>,
"<span class="hljs-attribute">lastName</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Last name of the person being invited."</span>
</span>}</span>,
"<span class="hljs-attribute">email</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Email address of the invitee."</span>
</span>}</span>,
"<span class="hljs-attribute">message</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Personal message to send to the person being invited."</span>
</span>}
</span>}</span>,
"<span class="hljs-attribute">required</span>": <span class="hljs-value">[
<span class="hljs-string">"siteId"</span>,
<span class="hljs-string">"role"</span>,
<span class="hljs-string">"firstName"</span>,
<span class="hljs-string">"email"</span>
]</span>,
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div><div class="title"><strong>Response <code>200</code></strong><div class="collapse-button"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-string">"3627cc99-d839-4684-bd78-8322703b273f"</span></span>,
"<span class="hljs-attribute">siteId</span>": <span class="hljs-value"><span class="hljs-string">"a908"</span></span>,
"<span class="hljs-attribute">siteName</span>": <span class="hljs-value"><span class="hljs-string">"Indoor Farm North"</span></span>,
"<span class="hljs-attribute">invitedBy</span>": <span class="hljs-value"><span class="hljs-string">"Mary Maker"</span></span>,
"<span class="hljs-attribute">role</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">firstName</span>": <span class="hljs-value"><span class="hljs-string">"Johnny"</span></span>,
"<span class="hljs-attribute">lastName</span>": <span class="hljs-value"><span class="hljs-string">"Jones"</span></span>,
"<span class="hljs-attribute">email</span>": <span class="hljs-value"><span class="hljs-string">"jjones84@gmail.com"</span></span>,
"<span class="hljs-attribute">message</span>": <span class="hljs-value"><span class="hljs-string">"Come see what we're doing here."</span>
</span>}</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The unique invite identifier. Generated on the server."</span>
</span>}</span>,
"<span class="hljs-attribute">siteId</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"ID of the site being invited into."</span>
</span>}</span>,
"<span class="hljs-attribute">siteName</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Site name. Provided for convenience on GET."</span>
</span>}</span>,
"<span class="hljs-attribute">invitedBy</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Invitation created by. Provided for convenience on GET."</span>
</span>}</span>,
"<span class="hljs-attribute">role</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"number"</span></span>,
"<span class="hljs-attribute">enum</span>": <span class="hljs-value">[
<span class="hljs-number">0</span>,
<span class="hljs-number">1</span>,
<span class="hljs-number">2</span>,
<span class="hljs-number">3</span>,
<span class="hljs-number">4</span>
]</span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The security role of the account for this site. (0:guest, 1:monitor, 2:controller, 3:admin, 4:owner)"</span>
</span>}</span>,
"<span class="hljs-attribute">firstName</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"First name of the person being invited."</span>
</span>}</span>,
"<span class="hljs-attribute">lastName</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Last name of the person being invited."</span>
</span>}</span>,
"<span class="hljs-attribute">email</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Email address of the invitee."</span>
</span>}</span>,
"<span class="hljs-attribute">message</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Personal message to send to the person being invited."</span>
</span>}
</span>}</span>,
"<span class="hljs-attribute">required</span>": <span class="hljs-value">[
<span class="hljs-string">"siteId"</span>,
<span class="hljs-string">"role"</span>,
<span class="hljs-string">"firstName"</span>,
<span class="hljs-string">"email"</span>
]
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div id="invitations-delete" class="action delete"><h4 class="action-heading"><div class="name">Cancel an invitation</div><a href="#invitations-delete" class="method delete">DELETE</a><code class="uri">/api/v2/invites/{inviteId}</code></h4><h2 id="header-cancel-an-invitation-try-it">Cancel an invitation <a class="tryit hidden" target="_blank" href="https://microclimates.docs.apiary.io/#reference/0/invitations/cancel-an-invitation?console=1">Try it</a> <a class="permalink" href="#header-cancel-an-invitation-try-it" aria-hidden="true">¶</a></h2>
<p>This is used to cancel an existing inviation. It can be initiated by the person making
the invitation, or by the person being invited as a way of canceling the invitation request.</p>
<p>This request may accept authorization, and if given it must match the credentials of
the person being invited, or the person that created the invitation.</p>
<h4>Example URI</h4><div class="definition"><span class="method delete">DELETE</span> <span class="uri"><span class="hostname">https://microclimates.com</span>/api/v2/invites/<span class="hljs-attribute" title="inviteId">some-long-uuid</span></span></div><div class="title"><strong>URI Parameters</strong><div class="collapse-button show"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><dl class="inner"><dt>inviteId</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>some-long-uuid</span></span><p>The invite ID, generated during POST.</p>
</dd></dl></div><div class="title"><strong>Response <code>200</code></strong></div></div></div></section></div></div></div><p style="text-align: center;" class="text-muted">Generated by <a href="https://github.com/danielgtaylor/aglio" class="aglio">aglio</a> on 01 Feb 2019</p><script>/* eslint-env browser */
/* eslint quotes: [2, "single"] */
'use strict';
/*
Determine if a string ends with another string.
*/
function endsWith(str, suffix) {
return str.indexOf(suffix, str.length - suffix.length) !== -1;
}
/*
Get a list of direct child elements by class name.
*/
function childrenByClass(element, name) {
var filtered = [];
for (var i = 0; i < element.children.length; i++) {
var child = element.children[i];
var classNames = child.className.split(' ');
if (classNames.indexOf(name) !== -1) {
filtered.push(child);
}
}
return filtered;
}
/*
Get an array [width, height] of the window.
*/
function getWindowDimensions() {
var w = window,
d = document,
e = d.documentElement,
g = d.body,
x = w.innerWidth || e.clientWidth || g.clientWidth,
y = w.innerHeight || e.clientHeight || g.clientHeight;
return [x, y];
}
/*
Collapse or show a request/response example.
*/
function toggleCollapseButton(event) {
var button = event.target.parentNode;
var content = button.parentNode.nextSibling;
var inner = content.children[0];
if (button.className.indexOf('collapse-button') === -1) {
// Clicked without hitting the right element?
return;
}
if (content.style.maxHeight && content.style.maxHeight !== '0px') {
// Currently showing, so let's hide it
button.className = 'collapse-button';
content.style.maxHeight = '0px';
} else {
// Currently hidden, so let's show it
button.className = 'collapse-button show';
content.style.maxHeight = inner.offsetHeight + 12 + 'px';
}
}
function toggleTabButton(event) {
var i, index;
var button = event.target;
// Get index of the current button.
var buttons = childrenByClass(button.parentNode, 'tab-button');
for (i = 0; i < buttons.length; i++) {
if (buttons[i] === button) {
index = i;
button.className = 'tab-button active';
} else {
buttons[i].className = 'tab-button';
}
}
// Hide other tabs and show this one.
var tabs = childrenByClass(button.parentNode.parentNode, 'tab');
for (i = 0; i < tabs.length; i++) {
if (i === index) {
tabs[i].style.display = 'block';
} else {
tabs[i].style.display = 'none';
}
}
}
/*
Collapse or show a navigation menu. It will not be hidden unless it
is currently selected or `force` has been passed.
*/
function toggleCollapseNav(event, force) {
var heading = event.target.parentNode;
var content = heading.nextSibling;
var inner = content.children[0];
if (heading.className.indexOf('heading') === -1) {
// Clicked without hitting the right element?
return;
}
if (content.style.maxHeight && content.style.maxHeight !== '0px') {
// Currently showing, so let's hide it, but only if this nav item
// is already selected. This prevents newly selected items from
// collapsing in an annoying fashion.
if (force || window.location.hash && endsWith(event.target.href, window.location.hash)) {
content.style.maxHeight = '0px';
}
} else {
// Currently hidden, so let's show it
content.style.maxHeight = inner.offsetHeight + 12 + 'px';
}
}
/*
Refresh the page after a live update from the server. This only
works in live preview mode (using the `--server` parameter).
*/
function refresh(body) {
document.querySelector('body').className = 'preload';
document.body.innerHTML = body;
// Re-initialize the page
init();
autoCollapse();
document.querySelector('body').className = '';
}
/*
Determine which navigation items should be auto-collapsed to show as many
as possible on the screen, based on the current window height. This also
collapses them.
*/
function autoCollapse() {
return; var windowHeight = getWindowDimensions()[1];
var itemsHeight = 64; /* Account for some padding */
var itemsArray = Array.prototype.slice.call(
document.querySelectorAll('nav .resource-group .heading'));
// Get the total height of the navigation items
itemsArray.forEach(function (item) {
itemsHeight += item.parentNode.offsetHeight;
});
// Should we auto-collapse any nav items? Try to find the smallest item
// that can be collapsed to show all items on the screen. If not possible,
// then collapse the largest item and do it again. First, sort the items
// by height from smallest to largest.
var sortedItems = itemsArray.sort(function (a, b) {
return a.parentNode.offsetHeight - b.parentNode.offsetHeight;
});
while (sortedItems.length && itemsHeight > windowHeight) {
for (var i = 0; i < sortedItems.length; i++) {
// Will collapsing this item help?
var itemHeight = sortedItems[i].nextSibling.offsetHeight;
if ((itemsHeight - itemHeight <= windowHeight) || i === sortedItems.length - 1) {
// It will, so let's collapse it, remove its content height from
// our total and then remove it from our list of candidates
// that can be collapsed.
itemsHeight -= itemHeight;
toggleCollapseNav({target: sortedItems[i].children[0]}, true);
sortedItems.splice(i, 1);
break;
}
}
}
}
/*
Initialize the interactive functionality of the page.
*/
function init() {
var i, j;
// Make collapse buttons clickable
var buttons = document.querySelectorAll('.collapse-button');
for (i = 0; i < buttons.length; i++) {
buttons[i].onclick = toggleCollapseButton;
// Show by default? Then toggle now.
if (buttons[i].className.indexOf('show') !== -1) {
toggleCollapseButton({target: buttons[i].children[0]});
}
}
var responseCodes = document.querySelectorAll('.example-names');
for (i = 0; i < responseCodes.length; i++) {
var tabButtons = childrenByClass(responseCodes[i], 'tab-button');
for (j = 0; j < tabButtons.length; j++) {
tabButtons[j].onclick = toggleTabButton;
// Show by default?
if (j === 0) {
toggleTabButton({target: tabButtons[j]});
}
}
}
// Make nav items clickable to collapse/expand their content.
var navItems = document.querySelectorAll('nav .resource-group .heading');
for (i = 0; i < navItems.length; i++) {
navItems[i].onclick = toggleCollapseNav;
// Show all by default
toggleCollapseNav({target: navItems[i].children[0]});
}
}
// Initial call to set up buttons
init();
window.onload = function () {
autoCollapse();
// Remove the `preload` class to enable animations
document.querySelector('body').className = '';
};
</script></body></html>