Wiki source code of 05 HTTP API

Version 4.1 by Hunter on 2022/07/11 10:48

Show last authors
1 = **1 General** =
2
3 This documents introduces WECON V-BOX HTTP API. And this document also shows some examples. All example is tested from postman application.
4
5 **Transport protocol:** HTTP protocol
6
7 **Server address:**
8
9 China:
10
11 [[http:~~/~~/api.v-box.net>>url:http://api.v-box.net/]]
12
13 Asean:
14
15 [[http:~~/~~/api.asean.v-box.net>>url:http://api.v-box.net/]]
16
17 Europe:
18
19 [[http:~~/~~/api.eu.v-box.net>>url:http://api.v-box.net/]]
20
21 (% style="text-align:center" %)
22 [[image:V-BOX HTTP manual_html_ceb1e13ef4c1fa5d.png||class="img-thumbnail" height="361" width="800"]]
23
24 For **ASEAN server** V-BOX, now can use http, the server address is api.asean.v-box.net.
25
26 The common KEY is:
27
28 **comid=2**
29
30 **comkey=589625dce895454dbff9782c299db156**
31
32 screctkey=f1cd9351930d4e589922edbcf3b09a7c
33
34 {{id name="_GoBack"/}}
35
36 For** EU server **V-BOX, now can use http, the server address is api.eu.v-box.net.
37
38 The common KEY is:
39
40 **comid=100**
41
42 **comkey=8919244ff15d441bae4b944b112a33ea**
43
44 screctkey=f1cd9351930d4e589922edbcf3b09a7c
45
46 == 1.1 Interface parameter description ==
47
48 **Global parameters**
49
50 The following acturls need to have global parameters (The global parameter client is put into the JSON format and placed in the common parameters of the Headers)
51
52 (% style="text-align:center" %)
53 [[image:企业微信截图_20210531172144.png||class="img-thumbnail" height="467" width="800"]]
54
55 **The returned result represented by Json and case sensitive:**
56
57 1).Abnormal
58
59 {"code" : 403, "msg" : "SessionID (user session ID) invalid", "reqId": "1502074141465"}
60
61 2).Normal
62
63 {"code" : 200 , "result": {}, "msg" : "ok", "reqId":"1502074141465"}
64
65 **State code description**
66
67 (% style="text-align:center" %)
68 [[image:1.png||class="img-thumbnail" height="141" width="500"]]
69
70 == **1.2 Example key and value** ==
71
72 1).**comid**=2
73
74 2).**comkey**=589625dce895454dbff9782c299db156
75
76 3).**screctkey**=f1cd9351930d4e589922edbcf3b09a7c
77
78 4).**ts**=1573897380
79
80 (((
81 = **2 Basic API** =
82 )))
83
84 == **2.1 {{id name="_Toc24963726"/}}Login operation** ==
85
86 (((
87 **2.1.1 Parameters**
88 )))
89
90 (% class="table-bordered" %)
91 |**Acturl**|(% colspan="2" %)we-data/login
92 |**Function**|(% colspan="2" %)Login with username, email, phone number
93 |(% rowspan="3" %)**Parameters**|Items|Description
94 |alias|Username, email, phone number
95 |password|32bit password (MD5 encryption)
96 |(% rowspan="3" %)**Return value**|Items|Description
97 |utype|User Type: 1-Manage Account, 2-Viewer Account
98 |sid|User session ID
99
100 **2.1.2 Operating procedures**
101
102 **Setp1: ** Set http: [[http:~~/~~/api.v-box.net/box-data/api/we-data/login>>url:http://api.v-box.net/box-data/api/we-data/login]]
103
104 (% style="text-align:center" %)
105 [[image:V-BOX HTTP manual_html_78fa6b0e5f03b2f2.png||height="63" width="800" class="img-thumbnail"]]
106
107 **Setp2: ** Set parameters on Params
108
109 alias: weconuser
110
111 password: 599a3c736c04e196c58a29f43778f7ea(The md5 encryption result of Wecon159)
112
113 (% style="text-align:center" %)
114 [[image:V-BOX HTTP manual_html_563261d83c8f3530.png||height="250" width="700" class="img-thumbnail"]]
115
116 **Step3:**  Get sign
117
118 alias=weconuser&comid=2&compvtkey=589625dce895454dbff9782c299db156&password=599a3c736c04e196c58a29f43778f7ea&ts=1573897380&key=f1cd9351930d4e589922edbcf3b09a7c
119
120 Put the whole string above encrypted by MD5, so will get the value of "sign"
121
122 "sign":"997513ff1320862f0cbb9ce19d0bd253"
123
124 **Step4: ** Set common of header
125
126 {"comid":"2","compvtkey":"589625dce895454dbff9782c299db156","ts":"1573897380","sign":"997513ff1320862f0cbb9ce19d0bd253"}
127
128 (% style="text-align:center" %)
129 [[image:V-BOX HTTP manual_html_cbfc9bbb7d0d4f84.png||height="230" width="700" class="img-thumbnail"]]
130
131 (((
132 **2.1.3 Result**
133 )))
134
135 {
136
137 "code": 200,
138
139 "msg": "ok",
140
141 "reqId": "1573899119000",
142
143 "result": {
144
145 "utype": 1,
146
147 "ztRole": 1,
148
149 "sid": "2d7bfd344aa64d8ebc9beea0e4dad8ad"
150
151 }
152
153 }
154
155 (% style="text-align:center" %)
156 [[image:V-BOX HTTP manual_html_b00e7e6a00828e27.png||height="291" width="500" class="img-thumbnail"]]
157
158 (((
159 = **3 Service data APIs** =
160 )))
161
162 == **3.1 V-Box list** ==
163
164 **3.1.1 {{id name="_Toc24963732"/}}Parameters**
165
166 (% style="text-align:center" %)
167 [[image:X.png||class="img-thumbnail" height="412" width="700"]]
168
169 **3.1.2 {{id name="_Toc24963733"/}}Operating procedures**
170
171 **Step1:**  Set http: [[http:~~/~~/api.v-box.net/box-data/api/we-data/boxs>>url:http://api.v-box.net/box-data/api/we-data/boxs]]
172
173 (% style="text-align:center" %)
174 [[image:V-BOX HTTP manual_html_7555868f6d398292.png||class="img-thumbnail" height="48" width="700"]]
175
176 **Step2:**  Set parameters on Params
177
178 No parameters for this acturl, so no need to set.
179
180 **Step3: ** Get sign
181
182 comid=2&compvtkey=589625dce895454dbff9782c299db156&sid=2d7bfd344aa64d8ebc9beea0e4dad8ad&ts=1573897380&key=f1cd9351930d4e589922edbcf3b09a7c
183
184 MD5 value: 8fb4fbf99fcc1331c3274e708a403034
185
186 **Step4:**  Set common of header
187
188 {"sid":"2d7bfd344aa64d8ebc9beea0e4dad8ad","comid":"2","compvtkey":"589625dce895454dbff9782c299db156","ts":"1573897380","sign":"8fb4fbf99fcc1331c3274e708a403034"}
189
190 (% style="text-align:center" %)
191 [[image:V-BOX HTTP manual_html_999832f3a31ac851.png||class="img-thumbnail" height="232" width="700"]]
192
193 **3.1.3 Result**
194
195 {
196
197 "code": 200,
198
199 "msg": "ok",
200
201 "reqId": "1573900361203",
202
203 "result": {
204
205 "list": [
206
207 {
208
209 "groupName": "",
210
211 "boxList": [
212
213 {
214
215 "machineCode": "V01001171116005027a279eb001",
216
217 "devModel": "V-BOX S-00",
218
219 "isAlarm": 0,
220
221 "boxName": "Treatment Systems",
222
223 "remark": "",
224
225 "state": "1",
226
227 "map": "78.178613,9.177124",
228
229 "boxId": "913"
230
231 },
232
233 …………
234
235 {
236
237 "machineCode": "Vir001171116005027a27201908",
238
239 "devModel": "V-BOX S-00",
240
241 "isAlarm": 0,
242
243 "boxName": "(Smart farm)",
244
245 "remark": "",
246
247 "state": "1",
248
249 "map": "88.637476,50.415074",
250
251 "boxId": "973"
252
253 }
254
255 ]
256
257 },
258
259 ……………………
260
261 {
262
263 "groupName": "(Manufacturing)",
264
265 "boxList": [
266
267 {
268
269 "machineCode": "Vir001171116005027a27201904",
270
271 "devModel": "V-BOX S-00",
272
273 "isAlarm": 0,
274
275 "boxName": "(Adjustment)",
276
277 "remark": "",
278
279 "state": "1",
280
281 "map": "109.316038,33.749868",
282
283 "boxId": "957"
284
285 },
286
287 ………………
288
289 {
290
291 "machineCode": "Vir001171116005027a27201915",
292
293 "devModel": "V-BOX S-00",
294
295 "isAlarm": 0,
296
297 "boxName": "",
298
299 "remark": "",
300
301 "state": "1",
302
303 "map": "121.357068,24.312132",
304
305 "boxId": "975"
306
307 }
308
309 ]
310
311 }
312
313 ]
314
315 }
316
317 }
318
319 (% style="text-align:center" %)
320 [[image:V-BOX HTTP manual_html_5999b14ed63e8065.png||class="img-thumbnail" height="348" width="600"]]
321
322 == **3.2 Real-time group list** ==
323
324 **3.2.1{{id name="_Toc24963736"/}} Parameters**
325
326 (% class="table-bordered" %)
327 |**acturl**|(% colspan="3" %)we-data/realgroups
328 |**Functions**|(% colspan="3" %)Get V-BOX’s tags group list
329 |(% rowspan="2" %)**Parameters**|Parameter|(% colspan="2" %)Description
330 |boxId|(% colspan="2" %)VBoxID ("None" means custom grouping)
331 |(% rowspan="4" %)**Return value**|Field name|(% colspan="2" %)Description
332 |(% rowspan="3" %)list|(% colspan="2" %)Group list
333 |groupId|Group ID
334 |groupName|Group name
335
336 **3.2.2 Operating procedures**
337
338 **Step1: **Set http: [[http:~~/~~/api.v-box.net/box-data/api/we-data/realgroups>>url:http://api.v-box.net/box-data/api/we-data/realgroups]]
339
340 (% style="text-align:center" %)
341 [[image:V-BOX HTTP manual_html_abb2159981171c6.png||class="img-thumbnail" height="46" width="700"]]
342
343 **Step2: **Set parameters on Params
344
345 "boxId": "973"
346
347 (% style="text-align:center" %)
348 [[image:V-BOX HTTP manual_html_5c3ab35ebdab144e.png||class="img-thumbnail" height="151" width="800"]]
349
350 **Step3: **Get sign
351
352 boxId=973&comid=2&compvtkey=589625dce895454dbff9782c299db156&sid=2d7bfd344aa64d8ebc9beea0e4dad8ad&ts=1573897380&key=f1cd9351930d4e589922edbcf3b09a7c
353
354 MD5 value: 9b267b7549083167954b7ede30916ff5
355
356 **Step4: **Set common of header
357
358 {"boxId":"973","sid":"2d7bfd344aa64d8ebc9beea0e4dad8ad","comid":"2","compvtkey":"589625dce895454dbff9782c299db156","ts":"1573897380","sign":"9b267b7549083167954b7ede30916ff5"}
359
360 (% style="text-align:center" %)
361 [[image:V-BOX HTTP manual_html_cc06cac462c1b77a.png||class="img-thumbnail" height="172" width="800"]]
362
363 **3.2.3 Result**
364
365 {
366
367 "code": 200,
368
369 "msg": "ok",
370
371 "reqId": "1573901906667",
372
373 "result": {
374
375 "list": [
376
377 {
378
379 "groupName": "Temperature",
380
381 "groupId": 7325
382
383 },
384
385 {
386
387 "groupName": "Humidity",
388
389 "groupId": 7326
390
391 },
392
393 {
394
395 "groupName": "Button switch",
396
397 "groupId": 7327
398
399 }
400
401 ]
402
403 }
404
405 }
406
407 [[image:V-BOX HTTP manual_html_2445c358293d621.png||height="531" width="532"]]
408
409 == **3.3 Real-time tags configuration list** ==
410
411 **3.3.1 Parameters**
412
413 (% class="table-bordered" %)
414 |**acturl**|(% colspan="3" %)we-data/realcfgs
415 |**Functions**|(% colspan="3" %)Get the tags configuration information in the specified group in V-BOX.
416 |(% rowspan="5" %)**Parameters**|Parameter|(% colspan="2" %)Description
417 |boxId|(% colspan="2" %)VBoxID(“None” means custom tags grouping)
418 |groupId|(% colspan="2" %)Group ID (Required)
419 |pageSize|(% colspan="2" %)Number of each page, 10 by default
420 |pageIndex|(% colspan="2" %)Number of current page, start from 1
421 |(% rowspan="15" %)**Return value**|Field name|(% colspan="2" %)Description
422 |(% rowspan="11" %)cfgList|monitorId|Tags ID
423 |monitorName|Tags name
424 |updTime|Last update time
425 |dataId|(((
426 type of data
427
428 100: 16-bit binary
429
430 101: 16-digit octal
431
432 Refer to Appendix 1
433 )))
434 |addr|Address
435 |addrType|(((
436 0: bit address
437
438 1: byte address
439
440 2: word address
441
442 3: double word
443 )))
444 |digitCount|Integer digits, decimal places
445 |digitBinary|Data type and integer digits, decimal places
446 |dataLimit|Data range
447 |rid|Address
448 |roleType|Permission: 1-read only, 2-write only, 3-read-write
449 |totalPage|(% colspan="2" %)Total pages
450 |totalRecord|(% colspan="2" %)Total record number
451 |currentPage|(% colspan="2" %)Current page number
452
453 **3.3.2 Operating procedures**
454
455 **Step1: **Set http: [[http:~~/~~/api.v-box.net/box-data/api/we-data/realcfgs>>url:http://api.v-box.net/box-data/api/we-data/realcfgs]]
456
457 (% style="text-align:center" %)
458 [[image:V-BOX HTTP manual_html_3fff373ae27e2e00.png||class="img-thumbnail" height="44" width="700"]]
459
460 **Step2: **Set parameters on Params
461
462 "boxId":"973"
463
464 "groupId":"7325"
465
466 "pageSize":"5"
467
468 "pageIndex":"2"
469
470 (% style="text-align:center" %)
471 [[image:V-BOX HTTP manual_html_52bf7d95165a3e3a.png||class="img-thumbnail" height="273" width="700"]]
472
473 **Step3:** Get sign
474
475 boxId=973&comid=2&compvtkey=589625dce895454dbff9782c299db156&groupId=7325&pageIndex=2&pageSize=5&sid=2d7bfd344aa64d8ebc9beea0e4dad8ad&ts=1573897380&key=f1cd9351930d4e589922edbcf3b09a7c
476
477 MD5 sign: 0769228e66c945eed5431c41a96949f2
478
479 **Step4:** Set common of header
480
481 {"boxId":"973","groupId":"7325","pageSize":"5","pageIndex":"2","sid":"2d7bfd344aa64d8ebc9beea0e4dad8ad","comid":"2","compvtkey":"589625dce895454dbff9782c299db156","ts":"1573897380","sign":"0769228e66c945eed5431c41a96949f2"}
482
483 (% style="text-align:center" %)
484 [[image:V-BOX HTTP manual_html_d284dfdd7b4844ee.png||class="img-thumbnail" height="288" width="800"]]
485
486 **3.3.3 Result**
487
488 {
489
490 "code": 200,
491
492 "msg": "ok",
493
494 "reqId": "1573903822419",
495
496 "result": {
497
498 "cfgList": [
499
500 {
501
502 "monitorId": 91545,
503
504 "dataId": 105,
505
506 "monitorName": "Temp_9",
507
508 "updTime": 1571965761000,
509
510 "dataLimit": "0 7999",
511
512 "digitBinary": "十进制",
513
514 "addr": "9",
515
516 "rid": "D",
517
518 "roleType": 3,
519
520 "digitCount": "5,0",
521
522 "addrType": 2
523
524 },
525
526 ……………
527
528 {
529
530 "monitorId": 91541,
531
532 "dataId": 105,
533
534 "monitorName": "Temp_5",
535
536 "updTime": 1571965761000,
537
538 "dataLimit": "0 7999",
539
540 "digitBinary": "十进制",
541
542 "addr": "5",
543
544 "rid": "D",
545
546 "roleType": 3,
547
548 "digitCount": "5,0",
549
550 "addrType": 2
551
552 }
553
554 ],
555
556 "totalPage": 3,
557
558 "totalRecord": 15,
559
560 "currentPage": 2
561
562 }
563
564 }
565
566 (% style="text-align:center" %)
567 [[image:V-BOX HTTP manual_html_e7271097b71941cc.png||class="img-thumbnail" height="644" width="800"]]
568
569 == (% id="cke_bm_1151S" style="display:none" %)** {{id name="_Toc24963743"/}}**(%%)**3.4 Tags data list** ==
570
571 **3.4.1 {{id name="_Toc24963744"/}}Parameters**
572
573 (% class="table-bordered" %)
574 |**acturl**|(% colspan="3" %)we-data/realdata
575 |**Functions**|(% colspan="3" %)Get the tags data in the specified group in V-BOX.
576 |(% rowspan="5" %)**Parameters**|Parameter|(% colspan="2" %)Description
577 |boxId|(% colspan="2" %)VBoxID(“None” means custom tag grouping)
578 |groupId|(% colspan="2" %)Group ID (Required)
579 |pageSize|(% colspan="2" %)Number of each page, 10 by default
580 |pageIndex|(% colspan="2" %)Number of current page, start from 1
581 |(% rowspan="11" %)**Return value**|Field name|(% colspan="2" %)Description
582 |(% rowspan="7" %)List|(% colspan="2" %)Real-time data list
583 |com|Communication port ID
584 |monitorId|Tag ID
585 |monitorName|Tag name
586 |state|status
587 |value|Value
588 |groupId|Group ID
589 |totalPage|(% colspan="2" %)Total pages
590 |totalRecord|(% colspan="2" %)Total record
591 |currentPage|(% colspan="2" %)current page
592
593 **3.4.2 {{id name="_Toc24963745"/}}Operating procedures**
594
595 **Step1: **Set http: [[http:~~/~~/api.v-box.net/box-data/api/we-data/realdata>>url:http://api.v-box.net/box-data/api/we-data/realdata]]
596
597 (% style="text-align:center" %)
598 [[image:V-BOX HTTP manual_html_839fb0577dac88c1.png||class="img-thumbnail" height="45" width="700"]]
599
600 **Step2: **Set parameters on Params
601
602 "boxId":"973"
603
604 "groupId":"7325"
605
606 "pageSize":"5"
607
608 "pageIndex":"2"
609
610 (% style="text-align:center" %)
611 [[image:V-BOX HTTP manual_html_b860bab44ebbc128.png||class="img-thumbnail" height="272" width="700"]]
612
613 **Step3:** Get sign
614
615 boxId=973&comid=2&compvtkey=589625dce895454dbff9782c299db156&groupId=7325&pageIndex=2&pageSize=5&sid=2d7bfd344aa64d8ebc9beea0e4dad8ad&ts=1573897380&key=f1cd9351930d4e589922edbcf3b09a7c
616
617 MD5 sign: 0769228e66c945eed5431c41a96949f2
618
619 {"boxId":"973","groupId":"7325","pageSize":"5","pageIndex":"2","sid":"2d7bfd344aa64d8ebc9beea0e4dad8ad","comid":"2","compvtkey":"589625dce895454dbff9782c299db156","ts":"1573897380","sign":"0769228e66c945eed5431c41a96949f2"}
620
621 **3.4.3 {{id name="_Toc24963746"/}}Result**
622
623 {
624
625 "code": 200,
626
627 "msg": "ok",
628
629 "reqId": "1573905679365",
630
631 "result": {
632
633 "totalPage": 3,
634
635 "list": [
636
637 {
638
639 "com": 2939,
640
641 "monitorId": 91545,
642
643 "monitorName": "Temp_9",
644
645 "groupId": 0,
646
647 "state": "1",
648
649 "value": "90"
650
651 },
652
653 …………
654
655 },
656
657 {
658
659 "com": 2939,
660
661 "monitorId": 91541,
662
663 "monitorName": "Temp_5",
664
665 "groupId": 0,
666
667 "state": "1",
668
669 "value": "87"
670
671 }
672
673 ],
674
675 "totalRecord": 15,
676
677 "currentPage": 2
678
679 }
680
681 }
682
683 (% style="text-align:center" %)
684 [[image:V-BOX HTTP manual_html_705682e81eae5ea7.png||class="img-thumbnail" height="651" width="800"]]
685
686 == **3.5 Modify tag data** ==
687
688 (((
689 **3.5.1 Parameters**
690 )))
691
692 (% class="table-bordered" %)
693 |**acturl**|(% colspan="2" %)we-data/updrealdata
694 |**Functions**|(% colspan="2" %)Modify tag data
695 |(% rowspan="3" %)**Parameters**|Parameter|Description
696 |monitorId|Tag ID
697 |value|value
698 |**Return value**|(% colspan="2" %)None
699
700 **3.5.2 Operating procedures**
701
702 **Step1:** Set http: [[http:~~/~~/api.v-box.net/box-data/api/we-data/updrealdata>>url:http://api.v-box.net/box-data/api/we-data/updrealdata]]
703
704 (% style="text-align:center" %)
705 [[image:1651915094120-525.png||class="img-thumbnail" height="45" width="700"]]
706
707 **Step2:** Set parameters on Params
708
709 "monitorId":"91541"
710
711 "value":"60"
712
713 (% style="text-align:center" %)
714 [[image:V-BOX HTTP manual_html_5a3153add75ca7b4.png||class="img-thumbnail" height="246" width="800"]]
715
716 **Step3:** Get sign
717
718 comid=2&compvtkey=589625dce895454dbff9782c299db156&monitorId=91541&sid=2d7bfd344aa64d8ebc9beea0e4dad8ad&ts=1573897380&value=60&key=f1cd9351930d4e589922edbcf3b09a7c
719
720 MD5 sign: 4119b1abc9176a187f781bece04a5296
721
722 **Step4: **Set common of header
723
724 {"monitorId":"91541","value":"60","sid":"2d7bfd344aa64d8ebc9beea0e4dad8ad","comid":"2","compvtkey":"589625dce895454dbff9782c299db156","ts":"1573897380","sign":"4119b1abc9176a187f781bece04a5296"}
725
726 (% style="text-align:center" %)
727 [[image:V-BOX HTTP manual_html_59d54a5d886ef614.png||class="img-thumbnail" height="244" width="700"]]
728
729 **3.5.3 Result**
730
731 {
732
733 "code": 200,
734
735 "msg": "ok",
736
737 "reqId": "1573907138803",
738
739 "result": {}
740
741 }
742
743 (% style="text-align:center" %)
744 [[image:V-BOX HTTP manual_html_590c8dab9e80fd0f.png||class="img-thumbnail" height="425" width="700"]]
745
746 == **3.6 {{id name="_Toc24963751"/}}Historical tags name list** ==
747
748 **3.6.1 Parameters**
749
750 (% class="table-bordered" %)
751 |**acturl**|(% colspan="3" %)we-data/monitors
752 |**Functions**|(% colspan="3" %)Get a list of historical tags
753 |(% rowspan="2" %)**Parameters**|Parameter|(% colspan="2" %)Description
754 |boxId|(% colspan="2" %)VBoxID (Not required)
755 |(% rowspan="4" %)**Return value**|Field name|(% colspan="2" %)Description
756 |(% rowspan="3" %)list|(% colspan="2" %)Tag list
757 |monitorId|tag ID
758 |monitorName|tag name
759
760 **​​​​​​​3.6.2 Operating procedures**
761
762 **Step1: **Set http: [[http:~~/~~/api.v-box.net/box-data/api/we-data/monitors>>url:http://api.v-box.net/box-data/api/we-data/monitors]]
763
764 (% style="text-align:center" %)
765 [[image:V-BOX HTTP manual_html_456f00c6af3ea1b7.png||class="img-thumbnail" height="45" width="700"]]
766
767 **Step2: **Set parameters on Params
768
769 "boxId":"973"
770
771 (% style="text-align:center" %)
772 [[image:V-BOX HTTP manual_html_8bf7c3f9b3ce3897.png||class="img-thumbnail" height="185" width="700"]]
773
774 **Step3:** Get sign
775
776 boxId=973&comid=2&compvtkey=589625dce895454dbff9782c299db156&sid=2d7bfd344aa64d8ebc9beea0e4dad8ad&ts=1573897380&key=f1cd9351930d4e589922edbcf3b09a7c
777
778 MD5 sign: 9b267b7549083167954b7ede30916ff5
779
780 **Step4:** Set common of header
781
782 {"boxId":"973","sid":"2d7bfd344aa64d8ebc9beea0e4dad8ad","comid":"2","compvtkey":"589625dce895454dbff9782c299db156","ts":"1573897380","sign":"9b267b7549083167954b7ede30916ff5"}
783
784 (% style="text-align:center" %)
785 [[image:V-BOX HTTP manual_html_dba52ac718eeb66e.png||class="img-thumbnail" height="228" width="700"]]
786
787 **​​​​​​​3.6.3 Result**
788
789 {
790
791 "code": 200,
792
793 "msg": "ok",
794
795 "reqId": "1573907813693",
796
797 "result": {
798
799 "list": [
800
801 {
802
803 "monitorId": 91576,
804
805 "monitorName": "Hum",
806
807 "groupId": 7328
808
809 },
810
811 {
812
813 "monitorId": 91577,
814
815 "monitorName": "Temp",
816
817 "groupId": 7328
818
819 }
820
821 ]
822
823 }
824
825 }
826
827 (% style="text-align:center" %)
828 [[image:V-BOX HTTP manual_html_2a739377a9fb10b2.png||class="img-thumbnail" height="400" width="700"]]
829
830 == (% id="cke_bm_1218S" style="display:none" %)** **(%%)**3.7 {{id name="_Toc24963755"/}}Historical tag data list** ==
831
832 **​​​​​​​3.7.1 {{id name="_Toc24963756"/}}Parameters**
833
834 (% class="table-bordered" %)
835 |**acturl**|(% colspan="3" %)we-data/historydata
836 |**Functions**|(% colspan="3" %)Get historical data
837 |(% rowspan="6" %)**Parameters**|Parameter|(% colspan="2" %)Description
838 |monitorId|(% colspan="2" %)tag ID, (Required)
839 |monitorBeginTime|(% colspan="2" %)Monitoring start time, (Not required)
840 |monitorEndTime|(% colspan="2" %)Monitoring end time, (Not required)
841 |pageSize|(% colspan="2" %)Number of each page, 10 by default
842 |pageIndex|(% colspan="2" %)Number of current page, start from 1
843 |(% rowspan="8" %)**Return value**|Field name|(% colspan="2" %)Description
844 |(% rowspan="4" %)list|(% colspan="2" %)Historical data list
845 |monitorName|tag name
846 |monitorTime|Monitoring time
847 |value|Value
848 |totalPage|(% colspan="2" %)Total pages
849 |totalRecord|(% colspan="2" %)Total records
850 |currentPage|(% colspan="2" %)Current page
851
852 ​​​​​​​**3.7.2 Operating procedures**
853
854 **Step:** Set http: [[http:~~/~~/api.v-box.net/box-data/api/we-data/historydata>>url:http://api.v-box.net/box-data/api/we-data/historydata]]
855
856 (% style="text-align:center" %)
857 [[image:V-BOX HTTP manual_html_cd2fdea1493dc20e.png||class="img-thumbnail" height="47" width="700"]]
858
859 **Step2:** Set parameters on Params
860
861 "monitorId": 91577
862
863 "monitorBeginTime":"2019-11-16 10:45:44.000"
864
865 "monitorEndTime":"2019-11-16 20:45:44.000"
866
867 "pageSize":"10"
868
869 "pageIndex":"2"
870
871 (% style="text-align:center" %)
872 [[image:V-BOX HTTP manual_html_f169ff87c20ce6c4.png||class="img-thumbnail" height="302" width="700"]]
873
874 **Step3: **Get sign
875
876 comid=2&compvtkey=589625dce895454dbff9782c299db156&monitorBeginTime=2019-11-16 10:45:44.000&monitorEndTime=2019-11-16 20:45:44.000&monitorId=91577&pageIndex=2&pageSize=10&sid=2d7bfd344aa64d8ebc9beea0e4dad8ad&ts=1573897380&key=f1cd9351930d4e589922edbcf3b09a7c
877
878 MD5 sign: feeae8ddb4014951cfc2c02de4744bc4
879
880 **Step4:** Set common of header
881
882 {"monitorId":"91577","monitorBeginTime":"2019-11-16 10:45:44.000","monitorEndTime":"2019-11-16 20:45:44.000","pageSize":"10","pageIndex":"2","sid":"2d7bfd344aa64d8ebc9beea0e4dad8ad","comid":"2","compvtkey":"589625dce895454dbff9782c299db156","ts":"1573897380","sign":"feeae8ddb4014951cfc2c02de4744bc4"}
883
884 (% style="text-align:center" %)
885 [[image:V-BOX HTTP manual_html_fac48b1179b555ee.png||class="img-thumbnail" height="291" width="700"]]
886
887 **3.7.3 Result**
888
889 {
890
891 "code": 200,
892
893 "msg": "ok",
894
895 "reqId": "1573909705772",
896
897 "result": {
898
899 "totalPage": 12,
900
901 "list": [
902
903 {
904
905 "monitorTime": 1573905337000,
906
907 "groupName": "His",
908
909 "monitorTime_show": "2019-11-16 19:55:37.000",
910
911 "monitorName": "Temp",
912
913 "groupId": 7328,
914
915 "value": "914"
916
917 },
918
919 ……………
920
921 {
922
923 "monitorTime": 1573902637000,
924
925 "groupName": "His",
926
927 "monitorTime_show": "2019-11-16 19:10:37.000",
928
929 "monitorName": "Temp",
930
931 "groupId": 7328,
932
933 "value": "422"
934
935 }
936
937 ],
938
939 "totalRecord": 120,
940
941 "currentPage": 2
942
943 }
944
945 }
946
947 (% style="text-align:center" %)
948 [[image:V-BOX HTTP manual_html_f3b62eb69687a214.png||class="img-thumbnail" height="476" width="700"]]
949
950 == **3.8 Alarm tags data list** ==
951
952 **​​​​​​​​​​​​​​3.8.1 {{id name="_Toc24963760"/}}Parameters**
953
954 (% class="table-bordered" %)
955 |**acturl**|(% colspan="3" %)we-data/alarmdata
956 |**Function**|(% colspan="3" %)Get alarm data
957 |(% rowspan="9" %)**Parameters**|Parameter|(% colspan="2" %)Description
958 |boxId|(% colspan="2" %)VBoxID, (Required)
959 |monitorBeginTime|(% colspan="2" %)Monitoring start time, (Not required)
960 |monitorEndTime|(% colspan="2" %)Monitoring end time, (Not required)
961 |pageSize|(% colspan="2" %)Number of each page, 10 by default
962 |pageIndex|(% colspan="2" %)Number of current page, start from 1
963 |state|(% colspan="2" %)Status 1-unconfirmed, 2-confirm
964 |alarmType|(% colspan="2" %)Alarm events: 1-trigger alarm, 0-disarm (Not necessary)
965 |alarmLevel|(% colspan="2" %)(((
966 Alarm level: 1 general alarm,
967
968 2 serious alarm,
969
970 3 particularly serious alarm
971
972 (Not necessary)
973 )))
974 |(% rowspan="12" %)**Return value**|Field name|(% colspan="2" %)Description
975 |(% rowspan="8" %)List|(% colspan="2" %)Alarm data list
976 |monitorId|tag ID
977 |monitorName|tag name
978 |state|status
979 |value|Value
980 |monitorTime|Monitoring time
981 |alarmType|Alarm event
982 |alarmLevel|Alarm level
983 |totalPage|(% colspan="2" %)Total pages
984 |totalRecord|(% colspan="2" %)Total records
985 |currentPage|(% colspan="2" %)Current page
986
987 **​​​​​​​​​​​​​​3.8.2 {{id name="_Toc24963761"/}}Operating procedures**
988
989 **Step1:** Set http: [[http:~~/~~/api.v-box.net/box-data/api/we-data/alarmdata>>url:http://api.v-box.net/box-data/api/we-data/alarmdata]]
990
991 (% style="text-align:center" %)
992 [[image:V-BOX HTTP manual_html_4ebee4d4fcf0097c.png||class="img-thumbnail" height="45" width="700"]]
993
994 **Step2:** Set parameters on Params
995
996 "monitorId":"91931"
997
998 "monitorBeginTime":"2019-11-16 20:30:44.000"
999
1000 "monitorEndTime":"2019-11-16 21:30:44.000"
1001
1002 "pageSize":"10"
1003
1004 "pageIndex":"1"
1005
1006 "state":"2"
1007
1008 (% style="text-align:center" %)
1009 [[image:V-BOX HTTP manual_html_2361d0eaa7447a9c.png||class="img-thumbnail" height="327" width="700"]]
1010
1011 **Step3:** Get sign
1012
1013 comid=2&compvtkey=589625dce895454dbff9782c299db156&monitorBeginTime=2019-11-16 20:30:44.000&monitorEndTime=2019-11-16 21:30:44.000&monitorId=91931&pageIndex=1&pageSize=10&sid=2d7bfd344aa64d8ebc9beea0e4dad8ad&state=2&ts=1573897380&key=f1cd9351930d4e589922edbcf3b09a7c
1014
1015 MD5 sign: 4056006bbc71bd80a3c632987626e15b
1016
1017 **Step4: **Set common of header
1018
1019 {"monitorId":"91931","monitorBeginTime":"2019-11-16 20:30:44.000","monitorEndTime":"2019-11-16 21:30:44.000","pageSize":"10","pageIndex":"1","state":"2","sid":"2d7bfd344aa64d8ebc9beea0e4dad8ad","comid":"2","compvtkey":"589625dce895454dbff9782c299db156","ts":"1573897380","sign":"4056006bbc71bd80a3c632987626e15b"}
1020
1021 (% style="text-align:center" %)
1022 [[image:V-BOX HTTP manual_html_cd9ce84648b86cb9.png||class="img-thumbnail" height="269" width="700"]]
1023
1024 **3.8.3 Result**
1025
1026 {
1027
1028 "code": 200,
1029
1030 "msg": "ok",
1031
1032 "reqId": "1573911745258",
1033
1034 "result": {
1035
1036 "totalPage": 1,
1037
1038 "list": [
1039
1040 {
1041
1042 "monitorTime": 1573910934000,
1043
1044 "alarmType": 0,
1045
1046 "monitorId": 4437,
1047
1048 "monitorTime_show": "2019-11-16 21:28:54",
1049
1050 "monitorName": "Temperature alarm",
1051
1052 "alarmLevel": 2,
1053
1054 "state": 2,
1055
1056 "text": "The temperature is too high",
1057
1058 "value": "1",
1059
1060 "alarm_role": 0
1061
1062 },
1063
1064 …………
1065
1066 {
1067
1068 "monitorTime": 1573910855000,
1069
1070 "alarmType": 1,
1071
1072 "monitorId": 4437,
1073
1074 "monitorTime_show": "2019-11-16 21:27:35",
1075
1076 "monitorName": "Temperature alarm",
1077
1078 "alarmLevel": 2,
1079
1080 "state": 2,
1081
1082 "text": "The temperature is too high",
1083
1084 "value": "18",
1085
1086 "alarm_role": 0
1087
1088 }
1089
1090 ],
1091
1092 "totalRecord": 6,
1093
1094 "currentPage": 1
1095
1096 }
1097
1098 }
1099
1100 (% style="text-align:center" %)
1101 [[image:V-BOX HTTP manual_html_d4a3e0114c402c27.png||class="img-thumbnail" height="475" width="700"]]
1102
1103 == **3.9 Get device state** ==
1104
1105 **3.9.1 {{id name="_Toc24963760"/}}Parameters**
1106
1107 (% class="table-bordered" %)
1108 |**acturl**|(% colspan="3" %)we-data/getDeviceState
1109 |**Function**|(% colspan="3" %)Get vbox state based on machine code
1110 |(% colspan="1" rowspan="2" %)**Parameters**|Parameter|(% colspan="2" %)Description
1111 |machineCode|(% colspan="2" %)machineCode(required)
1112 |(% rowspan="2" %)**Return value**|Field name|(% colspan="2" %)Description
1113 |state|(% colspan="2" %)vbox state: 1-online,  0-offline
1114
1115 == **3.10 Send switch to device** ==
1116
1117 **3.10.1 {{id name="_Toc24963760"/}}Parameters**
1118
1119 (% class="table-bordered" %)
1120 |(% style="width:102px" %)**acturl**|(% colspan="3" style="width:1059px" %)we-data/sendSwitchToDevice
1121 |(% style="width:102px" %)**Function**|(% colspan="3" style="width:1059px" %)Enable vbox reports real-time data, because now the vbox has added a real-time data switch function, only in the real-time data page vbox will report real-time data, otherwise it will not be reported. So if you need to keep to get real-time data, you need to call this interface first, and call it every 20 seconds, so that the vbox will continue to report real-time data.
1122 |(% colspan="1" rowspan="2" style="width:102px" %)**Parameters**|(% style="width:450px" %)Parameter|(% colspan="2" %)Description
1123 |(% style="width:450px" %)boxId|(% colspan="2" %)boxId(required)
1124 |(% rowspan="1" style="width:102px" %)**Return value**|(% style="width:450px" %)Field name|(% colspan="2" %)Description
1125
1126 = **4 Appendix** =
1127
1128 == (% style="color:inherit; font-family:inherit; font-size:26px" %)**4.1 Data type**(%%) ==
1129
1130 100: 16-bit binary
1131
1132 101: 16-bit octal
1133
1134 102: 16-bit hexadecimal
1135
1136 103: 16-bit BCD code
1137
1138 104: 16-bit signed decimal
1139
1140 105: 16-bit unsigned decimal
1141
1142 200: 32-bit binary
1143
1144 201: 32-bit octal
1145
1146 202: 32-bit hexadecimal
1147
1148 203: 32-bit BCD
1149
1150 204: 32-bit signed decimal
1151
1152 205: 32-bit unsigned decimal
1153
1154 206: 32-bit floating
1155
1156 400: 64-bit binary
1157
1158 401: 64-bit octal
1159
1160 402: 64-bit hexadecimal
1161
1162 403: 64-bit BCD
1163
1164 404: 64-bit signed decimal
1165
1166 405: 64-bit unsigned decimal
1167
1168 406: 64-bit floating
1169
1170 1000: string
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180 Version: V1.1.0
1181
1182 Date: Nov 2019