Wiki source code of 07 HTTP API

Last modified by Devin Chen on 2025/04/10 16:16

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