Wiki source code of 05 HTTP API

Version 3.1 by Hunter on 2022/07/11 10:41

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