Wiki source code of 7 HTTP API

Version 11.1 by hunter123 on 2023/08/03 15:00

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