Wiki source code of HTTPS API

Version 2.1 by Devin Chen on 2025/09/24 09:56

Hide last authors
Wecon 1.1 1 {{warning}}
2 Important Notice:
3
4
5 This standard defines Wecon's proprietary access protocol. Third-party API integration requires explicit authorization through our V-net V2.0 platform, with all API access strictly monitored and regulated. Wecon reserves all rights to interpret and modify these specifications without prior notice.
6 \\To prevent API abuse,this feature will not be enabled by default for all users. Access requires submitting an application, with a monthly free quota of 10,000 times.
7 {{/warning}}
8
9 = 1.Third-party account =
10
11 On the V-NET 2.0 platform, API functions require integration with third-party accounts.
12
13 == 1.1 Create a third-party account ==
14
15 (% style="text-align:center" %)
16 [[image:hj18xtdG0np.png||height="498" width="1200"]]
17
18 (% style="text-align:center" %)
19 [[image:PixPin_2025-07-09_11-27-51.png]]
20
21 {{info}}
Devin Chen 2.1 22 Noted:
23
24 ~1. After clicking "OK", the third-party account password will no longer be visible. Please back it up promptly.
25
26 2.** An admin account only allows to create one third-party account.**
Wecon 1.1 27 {{/info}}
28
29 == 1.2 Assign device to third-party account ==
30
31 1.choose the third-party account
32
33 (% style="text-align:center" %)
34 [[image:bu3lT1iyiV.png||height="601" width="1200"]]
35
36 2.select a device to bind
37
38 (% style="text-align:center" %)
39 [[image:v1U3oIZDMH.png||height="880" width="1200"]]
40
41 3.Binded successfully
42
43 (% style="text-align:center" %)
44 [[image:1752032411880-592.png||height="820" width="1200"]]
45
46 = 2.Operational process =
47
48 == 2.1 Basic information ==
49
50 * (((
51 **Request url**: https:~/~/api.asean.v-iec.com/m16/{acturl}
52 )))
53 * (((
54 **Protocol: **https
55 )))
56 * (((
57 **Interface Parameter Description:**
58 )))
59
60 Global Parameters (HTTP Headers)
61
62 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)
63
64 |=**Parameter**|=**Description**
65 |sid|session ID (Obtained after login, and is used for all acturls after login)
66 |ts|Millisecond-level timestamp;( e.g. ,1750818494344)
67 |sign|(((
68 How to get sign:
69
70 Concatenate all parameters, including the header parameters above and the individual business parameters of each interface, in the format **key=value**, separated by & symbols. For example, for the login interface, the concatenated result would be:
71 **alias=test&cuid=123456789&password=dc6e6a331dc2b23420d99c53a0d4962e&pid=1&sv=1.0&mt=255&ts=1595381946008&lan=zh&sign=sign**
72
73 Here, alias and password are the business parameters specific to the login interface, while the others are header parameters (**Note**: The sid parameter is excluded for the login interface but must be included for other interfaces).
74
75 1. **Sort all parameters alphabetically**:
76 1*. Order by the first letter; if the first letters are identical, proceed to the second letter, and so on.
77 1. **Append the fixed parameter key=5cee621329f24e5cbdc43daa959ce9a1 at the end**:
78 1*. This parameter is mandatory for all interfaces and must always be placed last.
79
80 Finally, calculate the MD5 hash of the concatenated string to generate the sign
81 )))
82
83 The final header parameters are as follows (Note: The login interface does not require 'sid', while other interfaces must include 'sid'. The value of 'ts' must be identical to the 'ts' used in the above sign calculation):
84
85 wcommon:{"dap":"","cuid":"123456789","sv":"1.0","mt":"255","lan":"zh","sign":"XXX","pid":"1","ts":1742612007058}
86
87 **Return the result in JSON format, case-sensitive, for example:**
88
89 1) Client error responses
90
91 {{code language="none"}}
92 {"code" : 403, "msg" : "session timeout", "reqId":"1502074141465", "result":{}}
93 {{/code}}
94
95 2) Successful responses
96
97 {{code language="none"}}
98 {"code" : 200 , "result": {}, "msg" : "ok", "reqId":"1502074141465"}
99 {{/code}}
100
101 **HTTP response status codes**
102
103 |=**Status codes**|=**Description**
104 |(% style="text-align:center" %)200|(% style="text-align:center" %)The request succeeded
105 |(% style="text-align:center" %)400|(% style="text-align:center" %)Bad Request
106 |(% style="text-align:center" %)403|(% style="text-align:center" %)Forbidden (invalid Session ID)
107 |(% style="text-align:center" %)503|(% style="text-align:center" %)Bad Request
108
109 == 2.2 Recommended tools ==
110
111 1) [[Current Millis>>https://currentmillis.com/]] - Provides the current time in milliseconds elapsed since the UNIX epoch (Jan 1, 1970) as well as in other common formats including local / UTC time
112
113 (% style="text-align:center" %)
114 [[image:1750850646536-560.png]]
115
116 2) [[MD5 Encryption>>https://10015.io/tools/md5-encrypt-decrypt]] - Online tool for generating MD5 hashes from strings
117
118 (% style="text-align:center" %)
119 [[image:1750850693417-516.png]]
120
121 = 3.Third-party API invocation Method =
122
123 **Example parameter and value**
124
125 alias:3af2a002690b4becbd3d4fbced0d2df3
126
127 password:87845c1edaa92c4b24b64b65bb5fd2bb
128
129 ts:1750818494344
130
131 == 3.1 Login operation ==
132
133 (% style="margin-left:auto; margin-right:auto; width:800px" %)
134 |**acturl**|(% colspan="2" rowspan="1" %)we-data/sign/login
135 |**Function**|(% colspan="2" rowspan="1" %)Use username to login
136 |(% colspan="1" rowspan="4" %)**Parameters**|**Items**|**Description**
137 |alias|Username
138 |password|32-bit password (MD5 encryption)
139 |isRemember|0(Optional)
140 |(% colspan="1" rowspan="5" %)**Return value**|**Items**|**Description**
141 |utype|User Type:
142 |sid|User session ID (Only available for 12 hours)
143 |ztRole|(((
144 Cloud SCADA permissions:
145
146 1 - Has permission, 0 - No permission
147 )))
148 |userName|user name
149 |**Example**|(% colspan="2" rowspan="1" %)(((
150 {
151
152 "utype":5,
153
154 "ztRole":1,
155
156 "userName":"0edc4188a48f4bdcb7e89d35c6e7986f",
157
158 "sid":"c253a6a9635646a98bb46fba22411568"
159
160 }
161 )))
162
163 **Operating procedures**
164
165 **Setp1: ** Set URL: https:~/~/api.asean.v-iec.com/m16/we-data/sign/login
166
167 **Setp2: ** Set parameters on Params
168
169 alias: 3af2a002690b4becbd3d4fbced0d2df3
170
171 password: 9fa4250f6d70b341199f6dace528120f(The md5 encryption result of 87845c1edaa92c4b24b64b65bb5fd2bb)
172
173 (% style="text-align:center" %)
174 [[image:1750852260814-901.png]]
175
176 **Step3:**  Get sign
177
178 alias=3af2a002690b4becbd3d4fbced0d2df3&cuid=123456789&lan=zh&mt=255&password=9fa4250f6d70b341199f6dace528120f&pid=1&sv=1.0&ts=1750818494344&key=5cee621329f24e5cbdc43daa959ce9a1
179
180 Put the whole string above encrypted by MD5, so will get the value of "sign"
181
182 "sign":"d3071131ae5c7ab032fca3c623101e89"
183
184 **Step4: ** Set wcommon of header
185
186 {"dap":"","cuid":"123456789","sv":"1.0","mt":"255","lan":"zh","sign":"d3071131ae5c7ab032fca3c623101e89","pid":"1","ts":1750818494344}
187
188 (% style="text-align:center" %)
189 [[image:1750852478079-903.png]]
190
191 **Result**
192
193 (% style="text-align:center" %)
194 [[image:1750852594291-467.png]]
195
196 Now, we got the sid for other API invocation
197
198 == 3.2 Get the device list ==
199
200 (% style="margin-left:auto; margin-right:auto; width:800px" %)
201 |**acturl**|(% colspan="2" %)we-data/device/getList
202 |**Function**|(% colspan="2" rowspan="1" %)Get the device list
203 |(% colspan="1" rowspan="2" %)**Parameters**|**Item**|**Description**
204 | |
205 |(% colspan="1" rowspan="3" %)**Return value**|**Item**|**Description**
206 |boxList|Devices supporting WVPN
207 |list|Device List
208 |**Example**|(% colspan="2" rowspan="1" %){
209 "reqId": "1667285652454",
210 "code": 200,
211 "msg": "ok",
212 "result": {
213 "boxList": [
214 {
215 "code": "U370H1220307220W0001c75b693b2955",
216 "lev_name": "Group",
217 "name": "name1",
218 "f_name": " Group ",
219 "model": "PI3070ig",
220 "boxType": 1,
221 "id": 444860,
222 "state": 1,
223 "f_id": 226038,
224 "type": "1",
225 "lev_id": "226038",
226 "create_date": 1653985793000
227 },
228 {
229 "code": "V02001211222999a2d12c52a355",
230 "lev_name": "Default group",
231 "name": " V-BOX ",
232 "f_name": "Default group",
233 "model": "V-BOX S-4G",
234 "boxType": 0,
235 "id": 444848,
236 "state": 0,
237 "f_id": 225922,
238 "type": "1",
239 "lev_id": "225922",
240 "create_date": 1652378606000
241 }
242 ],
243 "list": [
244 {
245 "all": 3,
246 "offline": 0,
247 "lev_name": " group",
248 "children": [
249 {
250 "all": 0,
251 "offline": 0,
252 "lev_name": " group 1, group ",
253 "children": [],
254 "name": " group 1",
255 "f_name": " group ",
256 "online": 0,
257 "id": 225986,
258 "f_id": 226038,
259 "type": "0",
260 "lev_id": "225986,226038",
261 "create_date": 1657010779000
262 },
263 {
264 "code": "U370H1220307220W0001c75b693b2955",
265 "lev_name": "group",
266 "name": "aaaaa",
267 "f_name": " group ",
268 "model": "PI3070ig",
269 "boxType": 1,
270 "id": 444860,
271 "state": 1,
272 "f_id": 226038,
273 "type": "1",
274 "lev_id": "226038",
275 "create_date": 1653985793000
276 }
277 ],
278 "name": "Group",
279 "online": 3,
280 "id": 226038,
281 "f_id": 0,
282 "type": "0",
283 "lev_id": "226038",
284 "create_date": 1659618529000
285 },
286 {
287 "all": 1,
288 "offline": 1,
289 "lev_name": "Default group",
290 "children": [
291 {
292 "all": 0,
293 "offline": 0,
294 "lev_name": "Test 2,Default group",
295 "children": [],
296 "name": " Test 2",
297 "f_name": "Default group",
298 "online": 0,
299 "id": 225987,
300 "f_id": 225922,
301 "type": "0",
302 "lev_id": "225987,225922",
303 "create_date": 1657010789000
304 },
305 {
306 "code": "V02001211222999a2d12c52a355",
307 "lev_name": "Default group",
308 "name": "V-BOX",
309 "f_name": "Default group",
310 "model": "V-BOX S-4G",
311 "boxType": 0,
312 "id": 444848,
313 "state": 0,
314 "f_id": 225922,
315 "type": "1",
316 "lev_id": "225922",
317 "create_date": 1652378606000
318 }
319 ],
320 "name": "Default group",
321 "online": 0,
322 "id": 225922,
323 "f_id": 0,
324 "type": "0",
325 "lev_id": "225922",
326 "create_date": 1653984617000
327 }
328 ]
329 }
330 }
331
332 **Operating procedures(Dome)**
333
334 **Step1:**  Set URL:https:~/~/api.asean.v-iec.com/m16/we-data/device/getList
335
336 **Step2:**  Get sign (Using the sid obtained from calling the login API;demonstrated here as "e95ae840f7f147718d2b7650abe6c05f")
337
338 cuid=123456789&lan=zh&machineCode=V1400023040700790f5e19a1b55&mt=255&pid=1&sid=e95ae840f7f147718d2b7650abe6c05f&sv=1.0&ts=1750818494344&key=5cee621329f24e5cbdc43daa959ce9a1
339
340 Put the whole string above encrypted by MD5, so will get the value of "sign" 
341
342 "sign":"f0889257ce45e561959928ba5475fbf1"
343
344 **Step4: ** Set wcommon of header
345
346 {"dap":"","cuid":"123456789","sv":"1.0","mt":"255","lan":"zh","sign":"f0889257ce45e561959928ba5475fbf1","pid":"1","ts":1750818494344,"sid":"e95ae840f7f147718d2b7650abe6c05f"}
347
348 [[image:1750906712204-462.png]]
349
350 **Result**
351
352 (% style="text-align:center" %)
353 [[image:1750924923320-272.png||height="566" width="475"]]
354
355 == 3.3 Get device state ==
356
357 (% style="margin-left:auto; margin-right:auto; width:800px" %)
358 |**acturl**|(% colspan="2" %)we-data/device/getDeviceState
359 |**Function**|(% colspan="2" rowspan="1" %)Get device state
360 |(% colspan="1" rowspan="2" %)**Parameters**|**Item**|**Description**
361 |machineCode|Machine Code
362 |(% colspan="1" rowspan="2" %)**Return value**|**Item**|**Description**
363 |state|0:Offline 1: Online
364 |(% colspan="1" %)**Example**|(% colspan="2" rowspan="1" %){
365 "code": 200,
366 "msg": "ok",
367 "result": {
368 "state": 1 
369 }
370 }
371
372 **Operating procedures(Dome)**
373
374 **Step1:**  Set URL:https:~/~/api.asean.v-iec.com/m16/we-data/device/getDeviceState
375
376 **Step2: **Set parameters on Params
377
378 "machineCode": "V1400023040700790f5e19a1b55"
379
380 [[image:1750925468847-205.png]]
381
382 **Step3: **Get sign
383
384 cuid=123456789&lan=zh&machineCode=V1400023040700790f5e19a1b55&mt=255&pid=1&sid=e95ae840f7f147718d2b7650abe6c05f&sv=1.0&ts=1750818494344&key=5cee621329f24e5cbdc43daa959ce9a1
385
386 Put the whole string above encrypted by MD5, so will get the value of "sign" 
387
388 "sign":"f0889257ce45e561959928ba5475fbf1"
389
390 **Step4: ** Set wcommon of header
391
392 {"dap":"","cuid":"123456789","sv":"1.0","mt":"255","lan":"zh","sign":"f0889257ce45e561959928ba5475fbf1","pid":"1","ts":1750818494344,"sid":"e95ae840f7f147718d2b7650abe6c05f"}
393
394 **Result**
395
396 (% style="text-align:center" %)
397 [[image:1750925773973-469.png]]
398
399
400 == (% id="cke_bm_206555S" style="display:none" %) (%%)3.4 Get real-time tag list ==
401
402 (% style="margin-left:auto; margin-right:auto; width:800px" %)
403 |**acturl**|(% colspan="3" %)we-data/actGroup
404 |**Function**|(% colspan="3" rowspan="1" %)Get real-time tag list
405 |(% colspan="1" rowspan="2" %)**Parameters**|**Item**|(% colspan="2" %)**Description**
406 |boxId|(% colspan="2" %)V-box ID
407 |(% colspan="1" rowspan="4" %)**Return value**|**Item**|(% colspan="2" %)**Description**
408 |(% rowspan="3" %)list|(% colspan="2" %)Group list
409 |groupId|Group Id
410 |groupName|Group Name
411 |(% colspan="1" %)**Example**|(% colspan="3" rowspan="1" %){
412 "code": 200,
413 "msg": "ok",
414 "result": {
415 "list": [
416 {
417 "groupId": 1,
418 "groupName": "group 1"
419 },
420 {
421 "groupId": 2,
422 "groupName": "group 2"
423 }
424 ]
425 }
426 }
427
428 **Operating procedures(Dome)**
429
430 **Step1:**  Set URL:https:~/~/api.asean.v-iec.com/m16/we-data/actGroup
431
432 **Step2: **Set parameters on Params
433
434 "boxId": "10108"
435
436 [[image:1750926881603-584.png]]
437
438 **Step3: **Get sign
439
440 boxId=10108&cuid=123456789&lan=zh&mt=255&pid=1&sid=e95ae840f7f147718d2b7650abe6c05f&sv=1.0&ts=1750818494344&key=5cee621329f24e5cbdc43daa959ce9a1
441
442 Put the whole string above encrypted by MD5, so will get the value of "sign" 
443
444 "sign":"9e933e16e03f2821a58aa9694de49969"
445
446 **Step4: ** Set wcommon of header
447
448 {"dap":"","cuid":"123456789","sv":"1.0","mt":"255","lan":"zh","sign":"9e933e16e03f2821a58aa9694de49969","pid":"1","ts":1750818494344,"sid":"e95ae840f7f147718d2b7650abe6c05f"}
449
450 [[image:1750926908151-938.png]]
451
452 **Result**
453
454 (% style="text-align:center" %)
455 [[image:1750926982185-137.png]]
456
457 == (% id="cke_bm_294214S" style="display:none" %) (%%)3.5 Get real-time tag configuration ==
458
459 (% style="margin-left:auto; margin-right:auto; width:800px" %)
460 |**acturl**|(% colspan="3" %)/we-data/realcfgs
461 |**Function**|(% colspan="3" rowspan="1" %)Get real-time tag configuration
462 |(% colspan="1" rowspan="6" %)**Parameters**|**Item**|(% colspan="2" %)**Description**
463 |boxId|(% colspan="2" %)V-box ID (Required)
464 |groupId|(% colspan="2" %)Group ID (Required)
465 |pageSize|(% colspan="2" %)Number of items per page (defaults to 10 if not specified)
466 |pageIndex|(% colspan="2" %)Page number, starting from 1
467 |devtype|(% colspan="2" %)0: V-Box ,1: HMI (Required)
468 |(% colspan="1" rowspan="16" %)**Return value**|**Item**|(% colspan="2" %)**Description**
469 |(% colspan="1" rowspan="12" %)cfgList|(% colspan="2" %)Configuration list
470 |monitorId|Monitor ID
471 |monitorName|Monitor Name
472 |updTime|Last Update Time
473 |dataId|(((
474 Data Type:
475
476 100 - 16-bit Binary
477
478 101 - 16-bit Octal
479
480 ... (Refer to Appendix 1)
481 )))
482 |addr|Address
483 |addrType|(((
484 0:bit address
485
486 1:byte address
487
488 2:word address
489
490 3:double word
491 )))
492 |digitCount|integer digits, decimal digits
493 |digitBinary|carry system
494 |dataLimit|Data Range
495 |rid|Register Address
496 |roleType|(((
497 Access Permission:
498
499 1 - Read Only
500
501 2 - Write Only
502
503 3 - Read/Write
504 )))
505 |(% colspan="1" %)totalPage|(% colspan="2" rowspan="1" %)Total Pages
506 |(% colspan="1" %)totalRecord|(% colspan="2" %)Total Records
507 |(% colspan="1" %)currentPage|(% colspan="2" %)Current Page
508 |(% colspan="1" %)**Example**|(% colspan="3" rowspan="1" %){
509 "code":200,
510 "msg":"ok",
511 "reqId":"1595385125344",
512 "result":
513 {
514 "cfgList":
515 [
516 {
517 "monitorId":544225,
518 "dataId":105,
519 "monitorName":"00",
520 "updTime":1589506814000,
521 "dataLimit":"0 99999",
522 "digitBinary":" decimal",
523 "addr":"0",
524 "rid":"0",
525 "roleType":3,
526 "digitCount":"",
527 "addrType":0
528 },
529 {
530 "monitorId":544224,
531 "dataId":105,
532 "monitorName":"40",
533 "updTime":1589507516000,
534 "dataLimit":"0 99999",
535 "digitBinary":" decimal",
536 "addr":"0",
537 "rid":"4",
538 "roleType":3,
539 "digitCount":"5,
540 0",
541 "addrType":2
542 }
543 ],
544 "totalPage":1,
545 "totalRecord":2,
546 "currentPage":1
547 }
548 }
549
550 **Operating procedures(Dome)**
551
552 **Step1:**  Set URL:https:~/~/api.asean.v-iec.com/m16~/~/we-data/realcfgs
553
554 **Step2: **Set parameters on Params
555
556 "boxId": "10108"
557
558 "groupId": "307096"
559
560 "devtype": "0"
561
562 [[image:1750930526412-753.png]]
563
564 **Step3: **Get sign
565
566 boxId=10108&cuid=123456789&devtype=0&groupId=307096&lan=zh&mt=255&pid=1&sid=e95ae840f7f147718d2b7650abe6c05f&sv=1.0&ts=1750818494344&key=5cee621329f24e5cbdc43daa959ce9a1
567
568 Put the whole string above encrypted by MD5, so will get the value of "sign" 
569
570 "sign":"60fafbd0d795036e2ae09b4053c65671"
571
572 **Step4: ** Set wcommon of header
573
574 {"dap":"","cuid":"123456789","sv":"1.0","mt":"255","lan":"zh","sign":"60fafbd0d795036e2ae09b4053c65671","pid":"1","ts":1750818494344,"sid":"e95ae840f7f147718d2b7650abe6c05f"}
575
576 [[image:1750930595350-219.png]]
577
578 **Result**
579
580 (% style="text-align:center" %)
581 [[image:1750930627007-466.png]]
582
583 == 3.6 Get Real-time data list ==
584
585 (% style="margin-left:auto; margin-right:auto; width:800px" %)
586 |**acturl**|(% colspan="3" %)we-data/realdata
587 |**Function**|(% colspan="3" rowspan="1" %)Get Real-time data list
588 |(% colspan="1" rowspan="6" %)**Parameters**|**Item**|(% colspan="2" %)**Description**
589 |boxId|(% colspan="2" %)V-box ID (Required)
590 |groupId|(% colspan="2" %)Group ID (Required)
591 |pageSize|(% colspan="2" %)The number of each page, default 10
592 |pageIndex|(% colspan="2" %)Pages, starting from 1
593 |devtype|(% colspan="2" %)Device type (0:box,1:hmi) (Required)
594 |(% colspan="1" rowspan="11" %)**Return value**|**Item**|(% colspan="2" %)**Description**
595 |(% colspan="1" rowspan="7" %)list|(% colspan="2" %)Real-time data list
596 |com|Com port ID
597 |monitorId|Monitor ID
598 |monitorName|Monitor Name
599 |state|State
600 |value|Value
601 |groupId|Group ID
602 |(% colspan="1" %)totalPage|(% colspan="2" rowspan="1" %)Total Pages
603 |(% colspan="1" %)totalRecord|(% colspan="2" %)Total Records
604 |(% colspan="1" %)currentPage|(% colspan="2" %)Current Page
605 |(% colspan="1" %)**Example**|(% colspan="3" rowspan="1" %)(((
606 {
607 "code": 200,
608 "msg": "ok",
609 "result": {
610 "list": [
611 {
612 "com": 1, ~/~/ com port ID
613 "monitorId": 1, ~/~/Monitor ID
614 "monitorName": "plc1", ~/~/Monitor Name
615 "state": 1, ~/~/State
616 "value": 12, ~/~/value
617 "groupId": 8~/~/ Group ID
618
619 },
620 {
621 "com": 2, ~/~/com port ID
622 "monitorId": 2,
623 "monitorName": "plc2",
624 "state": 1,
625 "value": 13,
626 "groupId": 8~/~/Group ID
627 }
628 ],
629 totalPage:10,
630 totalRecord:500,
631 currentPage:2
632 }
633 }
634 )))
635
636 **Operating procedures(Dome)**
637
638 **Step1:**  Set URL:https:~/~/api.asean.v-iec.com/m16/we-data/realdata
639
640 **Step2: **Set parameters on Params
641
642 "boxId": "10108"
643
644 "groupId": "307096"
645
646 "devtype": "0"
647
648 [[image:1750931496306-864.png]]
649
650 **Step3: **Get sign
651
652 boxId=10108&cuid=123456789&devtype=0&groupId=307096&lan=zh&mt=255&pid=1&sid=1750818494344&sv=1.0&ts=1750818494344&key=5cee621329f24e5cbdc43daa959ce9a1
653
654 Put the whole string above encrypted by MD5, so will get the value of "sign" 
655
656 "sign":"aa65f3d58da6dff1da04dc2f9babd931"
657
658 **Step4: ** Set wcommon of header
659
660 {"dap":"","cuid":"123456789","sv":"1.0","mt":"255","lan":"zh","sign":"aa65f3d58da6dff1da04dc2f9babd931","pid":"1","ts":1750818494344,"sid":"e95ae840f7f147718d2b7650abe6c05f"}
661
662 [[image:1750931571632-223.png]]
663
664 **Result**
665
666 (% style="text-align:center" %)
667 [[image:1750931696007-370.png]]
668
669 == 3.7 Modify the data of real-time tag ==
670
671 (% style="margin-left:auto; margin-right:auto; width:800px" %)
672 |**acturl**|(% colspan="3" %)we-data/updrealdata
673 |**Function**|(% colspan="3" rowspan="1" %)Modify the data of real-time tag
674 |(% colspan="1" rowspan="5" %)**Parameters**|**Item**|(% colspan="2" %)**Description**
675 |boxId|(% colspan="2" %)V-box ID (Required)
676 |monitorId|(% colspan="2" %)Monitor ID
677 |value|(% colspan="2" %)value
678 |devtype|(% colspan="2" %)Device type (0:box,1:hmi) (Required)
679 |(% colspan="1" rowspan="2" %)**Return value**|**Item**|(% colspan="2" %)**Description**
680 |(% colspan="1" %) |(% colspan="2" %)
681 |(% colspan="1" %)**Example**|(% colspan="3" rowspan="1" %){
682 "code":200
683 "msg":"ok",
684 "result":{
685
686 }
687
688 **Operating procedures(Dome)**
689
690 **Step1:**  Set URL:https:~/~/api.asean.v-iec.com/m16/we-data/updrealdata
691
692 **Step2: **Set parameters on Params
693
694 "boxId": "10108"
695
696 "monitorId": "10002423"
697
698 "value": "33"
699
700 "devtype": "0"
701
702 [[image:1750932160187-949.png]]
703
704 **Step3: **Get sign
705
706 boxId=10108&cuid=123456789&devtype=0&lan=zh&monitorId=10002423&mt=255&pid=1&sid=e95ae840f7f147718d2b7650abe6c05f&sv=1.0&ts=1750818494344&value=33&key=5cee621329f24e5cbdc43daa959ce9a1
707
708 Put the whole string above encrypted by MD5, so will get the value of "sign" 
709
710 "sign":"d8cd8c57e3220c8327be1895ed2b3ca8"
711
712 **Step4: ** Set wcommon of header
713
714 {"dap":"","cuid":"123456789","sv":"1.0","mt":"255","lan":"zh","sign":"d8cd8c57e3220c8327be1895ed2b3ca8","pid":"1","ts":1750818494344,"sid":"e95ae840f7f147718d2b7650abe6c05f"}
715
716 [[image:1750932298989-982.png]]
717
718 **Result**
719
720 (% style="text-align:center" %)
721 [[image:1750932371164-131.png]]
722
723 == 3.8 Get Historical tags name list ==
724
725 (% style="margin-left:auto; margin-right:auto; width:800px" %)
726 |**acturl**|(% colspan="3" %)we-data/monitors
727 |**Function**|(% colspan="3" rowspan="1" %)Get a list of historical tags
728 |(% colspan="1" rowspan="3" %)**Parameters**|**Item**|(% colspan="2" %)**Description**
729 |boxId|(% colspan="2" %)V-box ID (Required)
730 |devtype|(% colspan="2" %)Device type (0:box,1:hmi) (Required)
731 |(% colspan="1" rowspan="5" %)**Return value**|**Item**|(% colspan="2" %)**Description**
732 |(% colspan="1" rowspan="4" %)list|(% colspan="2" %)Tag list
733 |monitorId|Monitor ID
734 |monitorName|Monitor Name
735 |groupId|Group ID
736 |(% colspan="1" %)**Example**|(% colspan="3" rowspan="1" %){
737 "code": 200,
738 "msg": "ok",
739 "result": {
740 "list": [
741 {
742 "monitorId": 1,
743 "monitorName": "tag 1"
744 "groupId": "00000001" 
745 },
746 {
747 "monitorId": 2,
748 "monitorName": "tag 2"
749 "groupId": "00000002"
750 }
751 ]
752 }
753 }
754
755 **Operating procedures(Dome)**
756
757 **Step1:**  Set URL:https:~/~/api.asean.v-iec.com/m16/we-data/monitors
758
759 **Step2: **Set parameters on Params
760
761 "boxId": "10108"
762
763 "devtype": "0"
764
765 (% style="text-align:center" %)
766 [[image:1750937987348-940.png]]
767
768
769 **Step3: **Get sign
770
771 boxId=10108&cuid=123456789&devtype=0&lan=zh&mt=255&pid=1&sid=e95ae840f7f147718d2b7650abe6c05f&sv=1.0&ts=1750818494344&key=5cee621329f24e5cbdc43daa959ce9a1
772
773 Put the whole string above encrypted by MD5, so will get the value of "sign" 
774
775 "sign":"066fd57475cbb808e1c095205b334e6e"
776
777 **Step4: ** Set wcommon of header
778
779 {"dap":"","cuid":"123456789","sv":"1.0","mt":"255","lan":"zh","sign":"066fd57475cbb808e1c095205b334e6e","pid":"1","ts":1750818494344,"sid":"e95ae840f7f147718d2b7650abe6c05f"}
780
781 (% style="text-align:center" %)
782 [[image:1750938105712-443.png]]
783
784 **Result**
785
786 (% style="text-align:center" %)
787 [[image:1750938200648-249.png]]
788
789 == 3.9 Get Historical tag data list ==
790
791 (% style="margin-left:auto; margin-right:auto; width:800px" %)
792 |**acturl**|(% colspan="3" %)we-data/historydata
793 |**Function**|(% colspan="3" rowspan="1" %)Get historical data
794 |(% colspan="1" rowspan="8" %)**Parameters**|**Item**|(% colspan="2" %)**Description**
795 |boxId|(% colspan="2" %)V-box ID (Required)
796 |monitorId|(% colspan="2" %)tag ID, (Required)
797 |groupId|(% colspan="2" %)Group ID
798 |monitorBeginTime|(% colspan="2" %)Monitoring start time, (Not required)
799 |monitorEndTime|(% colspan="2" %)Monitoring end time, (Not required)
800 |pageSize|(% colspan="2" %)Number of each page, 10 by default
801 |pageIndex|(% colspan="2" %)Number of current page, start from 1
802 |(% colspan="1" rowspan="11" %)**Return value**|**Item**|(% colspan="2" %)**Description**
803 |(% colspan="1" rowspan="7" %)list|(% colspan="2" %)Historical data list
804 |monitorName|Tag Name
805 |monitorTime|Monitoring Time (timestamp)
806 |monitorTime_show|Monitoring time (formatted string)
807 |value|Value
808 |groupName|Group Name
809 |groupId|Group ID
810 |(% colspan="1" %)totalPage|(% colspan="2" rowspan="1" %)Total Pages
811 |(% colspan="1" %)totalRecord|(% colspan="2" %)Total Records
812 |(% colspan="1" %)currentPage|(% colspan="2" %)Current Page
813 |(% colspan="1" %)**Example**|(% colspan="3" rowspan="1" %){
814 "code": 200,
815 "msg": "ok",
816 "result": {
817 "list": [
818 {
819 "monitorName": "plc1", ~/~/Monitor Name
820 "value": 12, ~/~/value
821 "monitorTime": "15645122555", ~/~/monitoring time
822 "monitorTime_show": "2017-05-25 12:18:30", ~/~/monitoring time
823 "groupName": "", ~/~/ group name
824 "groupId": 1 ~/~/ group ID
825 },
826 {
827 "monitorName": "plc2",
828 "value": 13,
829 "monitorTime": "2017-05-25 12:18:30"
830 "monitorTime_show": "2017-05-25 12:18:30", ~/~/monitoring time
831 "groupName": "", ~/~/ group name
832 "groupId": 1 ~/~/group ID
833 }
834 ],
835 totalPage:10,
836 totalRecord:500,
837 currentPage:2
838 }
839 }
840
841 **Operating procedures(Dome)**
842
843 **Step1:**  Set URL:https:~/~/api.asean.v-iec.com/m16/we-data/historydata
844
845 **Step2: **Set parameters on Params
846
847 "boxId": "10108"
848
849 "groupId": "10000683"
850
851 "monitorId": "10002467"
852
853 [[image:1751251214664-153.png]]
854
855 **Step3: **Get sign
856
857 boxId=10108&cuid=123456789&groupId=10000683&lan=zh&monitorId=10002467&mt=255&pid=1&sid=e95ae840f7f147718d2b7650abe6c05f&sv=1.0&ts=1750818494344&key=5cee621329f24e5cbdc43daa959ce9a1
858
859 Put the whole string above encrypted by MD5, so will get the value of "sign" 
860
861 "sign":"6aabcd106be192898ac8cdc683a27bdf"
862
863 **Step4: ** Set wcommon of header
864
865 {"dap":"","cuid":"123456789","sv":"1.0","mt":"255","lan":"zh","sign":"6aabcd106be192898ac8cdc683a27bdf","pid":"1","ts":1750818494344,"sid":"e95ae840f7f147718d2b7650abe6c05f"}
866
867 [[image:1751251262825-117.png]]
868
869 **Result**
870
871 (% style="text-align:center" %)
872 [[image:1751251300796-556.png]]
873
874
875 == 3.10 Get Alarm tags data list ==
876
877 (% style="margin-left:auto; margin-right:auto; width:800px" %)
878 |**acturl**|(% colspan="3" %)we-data/alarmdata
879 |**Function**|(% colspan="3" rowspan="1" %)Get alarm data
880 |(% colspan="1" rowspan="8" %)**Parameters**|**Item**|(% colspan="2" %)**Description**
881 |boxId|(% colspan="2" %)V-box ID (Required)
882 |monitorBeginTime|(% colspan="2" %)Monitoring start time, (Not required)
883 |monitorEndTime|(% colspan="2" %)Monitoring end time, (Not required)
884 |pageSize|(% colspan="2" %)Number of each page, 10 by default
885 |pageIndex|(% colspan="2" %)Number of current page, start from 1
886 |state|(% colspan="2" %)Status 1-unconfirmed, 2-confirm
887 |alarmType|(% colspan="2" %)Alarm events: 1-trigger alarm, 0-disarm
888 |(% colspan="1" %) |alarmLevel|(% colspan="2" %)(((
889 Alarm level:
890
891 1 general alarm,2 serious alarm,3 particularly serious alarm
892 )))
893 |(% colspan="1" %) |devtype|(% colspan="2" %)0: V-Box ,1: HMI (Required)
894 |(% colspan="1" rowspan="15" %)**Return value**|**Item**|(% colspan="2" %)**Description**
895 |(% colspan="1" rowspan="11" %)list|(% colspan="2" %)Alarm data list
896 |monitorId|Monitor ID
897 |monitorName|Monitor Name
898 |state|State
899 |value|Value
900 |monitorTime|Monitoring time ( timestamp )
901 |monitorTime_show|Monitoring time (formatted string)
902 |alarmType|Alarm Type
903 |alarmLevel|Alarm Level
904 |text|Alarm content
905 |alarm_role|Alarm permissions
906 |(% colspan="1" %)totalPage|(% colspan="2" rowspan="1" %)Total Pages
907 |(% colspan="1" %)totalRecord|(% colspan="2" %)Total Records
908 |(% colspan="1" %)currentPage|(% colspan="2" %)Current Page
909 |(% colspan="1" %)**Example**|(% colspan="3" rowspan="1" %){
910 "code": 200,
911 "msg": "ok",
912 "result": {
913 "list": [
914 {
915 "monitorId": 1,
916 "monitorName": "plc1", 
917 "state": 1, 
918 "value": 12, 
919 "monitorTime": "15215452111", 
920 "monitorTime_show": "2017-05-25 12:18:30",
921 "alarmType": "", 
922 "alarmLevel": "",
923 "text": "",
924 "alarm_role": ""
925 },
926 {
927 "monitorId": 1,
928 "monitorName": "plc2",
929 "state": 1,
930 "value": 13,
931 "monitorTime": "621554211225",
932 "monitorTime_show": "2017-05-25 12:18:30",
933 "alarmType": "", 
934 "alarmLevel": "",
935 "text": "",
936 "alarm_role": "" 
937 }
938 ],
939 totalPage:10,
940 totalRecord:500,
941 currentPage:2
942 }
943 }
944
945 **Operating procedures(Dome)**
946
947 **Step1:**  Set URL:https:~/~/api.asean.v-iec.com/m16/we-data/alarmdata
948
949 **Step2: **Set parameters on Params
950
951 "boxId": "10108"
952
953 "state": "2"
954
955 "devtype": "0"
956
957 [[image:1751590830927-952.png]]
958
959
960 **Step3: **Get sign
961
962 boxId=10108&cuid=123456789&devtype=0&lan=zh&mt=255&pid=1&sid=e95ae840f7f147718d2b7650abe6c05f&state=2&sv=1.0&ts=1750818494344&key=5cee621329f24e5cbdc43daa959ce9a1
963
964 Put the whole string above encrypted by MD5, so will get the value of "sign" 
965
966 "sign":"d689e54257984a9804bc0822df97d1a8"
967
968 **Step4: ** Set wcommon of header
969
970 {"dap":"","cuid":"123456789","sv":"1.0","mt":"255","lan":"zh","sign":"d689e54257984a9804bc0822df97d1a8","pid":"1","ts":1750818494344,"sid":"e95ae840f7f147718d2b7650abe6c05f"}
971
972 [[image:1751590858077-283.png]]
973
974
975 **Result**
976
977 (% style="text-align:center" %)
978 [[image:1751590880404-167.png]]
979
980 == 3.11 Notify the device to report real-time data ==
981
982 (% style="margin-left:auto; margin-right:auto; width:800px" %)
983 |**acturl**|(% colspan="3" %)we-data/sendSwitchToDevice
984 |**Function**|(% colspan="3" rowspan="1" %)Notify the device to report real-time data. Since the device now has a real-time data toggle feature, it will only report real-time data when on the real-time data page. Otherwise, it will not report. Therefore, to continuously obtain real-time data, you must first call this interface and then invoke it every 20 seconds to ensure the device keeps reporting real-time data.
985 |(% colspan="1" rowspan="2" %)**Parameters**|**Item**|(% colspan="2" %)**Description**
986 |boxId|(% colspan="2" %)V-box ID (Required,supports batch operations with comma-separated values (maximum 5,000 box IDs per request), e.g., 3012,4021,5036)
987 |(% colspan="1" %)**Example**|(% colspan="3" rowspan="1" %){
988 "code": 200,
989 "msg": "ok",
990 "result": {}
991 }
992
993 **Operating procedures(Dome)**
994
995 **Step1:**  Set URL:https:~/~/api.asean.v-iec.com~/~/m16/we-data/sendSwitchToDevice
996
997 **Step2: **Set parameters on Params
998
999 "boxId": "10108"
1000
1001 [[image:1751590928746-181.png]]
1002
1003 **Step3: **Get sign
1004
1005 boxId=10108&cuid=123456789&groupId=10000683&lan=zh&monitorId=10002467&mt=255&pid=1&sid=e95ae840f7f147718d2b7650abe6c05f&sv=1.0&ts=1750818494344&key=5cee621329f24e5cbdc43daa959ce9a1
1006
1007 Put the whole string above encrypted by MD5, so will get the value of "sign" 
1008
1009 "sign":"9e933e16e03f2821a58aa9694de49969"
1010
1011 **Step4: ** Set wcommon of header
1012
1013 {"dap":"","cuid":"123456789","sv":"1.0","mt":"255","lan":"zh","sign":"9e933e16e03f2821a58aa9694de49969","pid":"1","ts":1750818494344,"sid":"e95ae840f7f147718d2b7650abe6c05f"}
1014
1015 [[image:1751590956278-632.png]]
1016
1017 **Result**
1018
1019 (% style="text-align:center" %)
1020 [[image:1751590971071-144.png]]
1021
1022 == 3.12 Confirm the alarm data (V-Box/HMI) ==
1023
1024 (% style="margin-left:auto; margin-right:auto; width:800px" %)
1025 |**acturl**|(% colspan="3" %)we-data/historydata  ~-~-  (V-BOX)
1026 we-data/hmiDataAction/confirmData  ~-~-  (HMI)
1027 |**Function**|(% colspan="3" rowspan="1" %)Confirm the alarm data (V-BOX / HMI)
1028 |(% colspan="1" rowspan="5" %)**Parameters**|**Item**|(% colspan="2" %)**Description**
1029 |alarm_cfg_ids|(% colspan="2" %)Alarm confirmation ID (Required)
1030 |monitor_times|(% colspan="2" %)Monitor time  (Required)
1031 |deviceId|(% colspan="2" %)Device ID (Required)
1032 |alarm_types (HMI only)|(% colspan="2" %)Alarm Type:1: Triggered, 0: Cancelled
1033 |(% colspan="1" %)**Example**|(% colspan="3" rowspan="1" %){
1034 "code": 200,
1035 "msg": "ok",
1036 "reqId": "1663749297007",
1037 "result": {}
1038 }
1039
1040 **Operating procedures(Dome for V-BOX)**
1041
1042 **Step1:**  Set URL:https:~/~/api.asean.v-iec.com/m16/we-data/alarmDataAction/confirmData
1043
1044 **Step2: **Set parameters on Params
1045
1046 "alarm_cfg_ids": "10000017"
1047
1048 "deviceId": "10108"
1049
1050 "monitor_times": "1748588490783"
1051
1052 [[image:1751592962453-264.png]]
1053
1054 **Step3: **Get sign
1055
1056 alarm_cfg_ids=10000017&cuid=123456789&deviceId=10108&lan=zh&monitor_times=1748588490783&mt=255&pid=1&sid=e95ae840f7f147718d2b7650abe6c05f&sv=1.0&ts=1750818494344&key=5cee621329f24e5cbdc43daa959ce9a1
1057
1058 Put the whole string above encrypted by MD5, so will get the value of "sign" 
1059
1060 "sign":"93e7cd5abe03040b16e645d2869706f2"
1061
1062 **Step4: ** Set wcommon of header
1063
1064 {"dap":"","cuid":"123456789","sv":"1.0","mt":"255","lan":"zh","sign":"93e7cd5abe03040b16e645d2869706f2","pid":"1","ts":1750818494344,"sid":"e95ae840f7f147718d2b7650abe6c05f"}
1065
1066 [[image:1751593015952-261.png]]
1067
1068 **Result**
1069
1070 (% style="text-align:center" %)
1071 [[image:1751593034158-244.png]]
1072
1073 == 3.12 Get remote monitoring Url ==
1074
1075 (% style="margin-left:auto; margin-right:auto; width:800px" %)
1076 |**acturl**|(% colspan="3" %)we-data/getMonitorUrl
1077 |**Function**|(% colspan="3" rowspan="1" %)Get remote monitoring Url
1078 |(% colspan="1" rowspan="2" %)**Parameters**|**Item**|(% colspan="2" %)**Description**
1079 |deviceId|(% colspan="2" %)Device ID (Required)
1080 |(% colspan="1" rowspan="2" %)**Return value**|f_ver|(% colspan="2" %)Version
1081 |Url|(% colspan="2" %)Remote monitoring URL
1082 |(% colspan="1" %)**Example**|(% colspan="3" rowspan="1" %){
1083 "code": 200,
1084 "msg": "ok",
1085 "reqId": "1663749297007",
1086 "result": {“f_ver”:”V_0.5”,“url”:http:~/~/245646468...52.hmi.we-con.com.cn:1142/index.html?d=115...&token=42354...}
1087 }
1088
1089 **Operating procedures(Dome)**
1090
1091 **Step1:**  Set URL:https:~/~/api.asean.v-iec.com/m16/we-data/getMonitorUrl
1092
1093 **Step2: **Set parameters on Params
1094
1095 "deviceId": "10000467"
1096
1097 (% style="text-align:center" %)
1098 [[image:1751593657691-677.png]]
1099
1100 **Step3: **Get sign
1101
1102 cuid=123456789&deviceId=10000467&lan=zh&mt=255&pid=1&sid=e95ae840f7f147718d2b7650abe6c05f&sv=1.0&ts=1750818494344&key=5cee621329f24e5cbdc43daa959ce9a1
1103
1104 Put the whole string above encrypted by MD5, so will get the value of "sign" 
1105
1106 "sign":"dd1324f34dc90683373504f31aaf24cf"
1107
1108 **Step4: ** Set wcommon of header
1109
1110 {"dap":"","cuid":"123456789","sv":"1.0","mt":"255","lan":"zh","sign":"dd1324f34dc90683373504f31aaf24cf","pid":"1","ts":1750818494344,"sid":"e95ae840f7f147718d2b7650abe6c05f"}
1111
1112 [[image:1751594984300-563.png]]
1113
1114 **Result**
1115
1116 [[image:1751595028434-214.png]]
1117
1118