https://127.0.0.1:33170/api/serverinfo https://127.0.0.1:33170/wa/api/serverinfo
{ "data": { "Version": "1.0.0.0", "MachineName": "MYSERVER", "ServerTimeUTC": "2020-08-01T23:30:24.0414514Z", "TagCount": 7, "IsLicensed": false, "TagCountLicensedLimit": 3000, "License": null } }
var xhttp = new XMLHttpRequest(); xhttp.open("POST", "https://127.0.0.1:33170/api/authenticate", true); xhttp.setRequestHeader('Authorization', 'Basic ' + window.btoa('USERNAME:PASSWORD')); xhttp.send(); xhttp.onreadystatechange = function(){ if (xhttp.readyState === XMLHttpRequest.DONE) { if (xhttp.status === 200) document.write("SUCCESS!"); else document.write("FAILED!"); } };
var xhttp = new XMLHttpRequest(); xhttp.open("POST", "https://127.0.0.1:33170/wa/api/authenticate", true); xhttp.withCredentials = true; xhttp.send(); xhttp.onreadystatechange = function(){ if (xhttp.readyState === XMLHttpRequest.DONE) { if (xhttp.status === 200) document.write("SUCCESS!"); else document.write("FAILED!"); } };
https://127.0.0.1:33170/api/authenticate https://127.0.0.1:33170/api/authenticate?twofactorkey=312345 https://127.0.0.1:33170/wa/api/authenticate
{ "AuthenticationResult": true, "data": { "Username": "Administrator", "UserRole": 10, "AccessLevel": 10, "FullName": "aaa", "Email": "aaa", "AccountType": 0, "Google2FactAuthEnable": false, "API": true, "Custom1": "", "Custom2": "", "Custom3": "", "Custom4": "", "Custom5": "", "Custom6": "", "Custom7": "", "Custom8": "", "Custom9": "" } }
https://127.0.0.1:33170/api/users/?username=azrinsani https://127.0.0.1:33170/api/users/?username=administrator https://127.0.0.1:33170/api/users/?username=AZRINLAPTOP2\azrin https://127.0.0.1:33170/wa/api/users/?username=AZRINLAPTOP2\azrin
{ "data": { "Username": "AZRINLAPTOP2\azrin", "UserRole": "Administrator", "AccessLevel": 10, "FullName": "", "Email": "", "AccountType": 1, "AccountTypeName": "WindowsUser", "Google2FactAuthEnable": false, "API": true, "Custom1": "", "Custom2": "", "Custom3": "", "Custom4": "", "Custom5": "", "Custom6": "", "Custom7": "", "Custom8": "", "Custom9": "" } }
https://127.0.0.1:33170/api/users https://127.0.0.1:33170/api/users?wildcard=*administ* https://127.0.0.1:33170/wa/api/users
{ "data": [ { "Username": "Administrator", "UserRole": "Administrator", "AccessLevel": 10, "FullName": "", "Email": "", "AccountType": 0, "AccountTypeName": "Standard", "Google2FactAuthEnable": false, "API": true, "Custom1": "", "Custom2": "", "Custom3": "", "Custom4": "", "Custom5": "", "Custom6": "", "Custom7": "", "Custom8": "", "Custom9": "" }, { "Username": "AZRINLAPTOP2\azrin", "UserRole": "Administrator", "AccessLevel": 10, "FullName": "", "Email": "", "AccountType": 1, "AccountTypeName": "WindowsUser", "Google2FactAuthEnable": false, "API": true, "Custom1": "", "Custom2": "", "Custom3": "", "Custom4": "", "Custom5": "", "Custom6": "", "Custom7": "", "Custom8": "", "Custom9": "" } ] }
{ "data": [ { "Username": "Administrator", "UserRole": "Administrator", "AccessLevel": 10, "FullName": "", "Email": "", "AccountType": 0, "AccountTypeName": "Standard", "Google2FactAuthEnable": false, "API": true, "Custom1": "", "Custom2": "", "Custom3": "", "Custom4": "", "Custom5": "", "Custom6": "", "Custom7": "", "Custom8": "", "Custom9": "" } ] }
https://localhost:33170/api/users/?username=Jack&password=Cr@zy\Pa55w0Rd/\*. https://localhost:33170/api/users/?username=Jack&password=Cr@zy\Pa55w0Rd/\*.&accounttype=1 https://localhost:33170/api/users/?username=Jack&password=Cr@zy\Pa55w0Rd/\*.&accounttype=0&accesslevel=10 https://localhost:33170/api/users/?username=Jack&password=Cr@zy\Pa55w0Rd/\*.&accounttype=0&accesslevel=9&tfaenable=true&custom1=CUSTOM PARAMETER FOR USER&custom7=CUSTOME PARAMETER FOR USE2 https://localhost:33170/api/users/?username=MYDOMAIN\Jack&accounttype=2 https://localhost:33170/wa/api/users/?username=Jack&password=Cr@zy\Pa55w0Rd/\*.
{ "data": { "Username": "MYDOMAIN\Jack", "UserRole": "Manager", "AccessLevel": 9, "FullName": null, "Email": null, "AccountType": 1, "AccountTypeName": "WindowsUser", "TwoFactorAuthEnable": false, "API": true, "Custom1": "CUSTOM PARAMETER FOR USER", "Custom2": null, "Custom3": null, "Custom4": null, "Custom5": null, "Custom6": null, "Custom7": "CUSTOME PARAMETER FOR USE2", "Custom8": null, "Custom9": null } }
{ "data": { "Username": "Jack", "UserRole": "Manager", "AccessLevel": 9, "FullName": null, "Email": null, "AccountType": 0, "AccountTypeName": "Standard", "TwoFactorAuthEnable": true, "API": true, "Custom1": "CUSTOM PARAMETER FOR USER", "Custom2": null, "Custom3": null, "Custom4": null, "Custom5": null, "Custom6": null, "Custom7": "CUSTOME PARAMETER FOR USE2", "Custom8": null, "Custom9": null, "TwoFactorAuthQRCodeURL": "http://chart.googleapis.com/chart?cht=qr&chs=300x300&chl=otpauth%3A%2F%2Ftotp%2FLogin%3Fsecret%3DMQ2WMNTBGI4WIMRSGIZA%26issuer%3DOpen-Plant", "TwoFactorAuthManualEntry": "MQ2WMNTBGI4WIMRSGIZA" } }
https://localhost:33170/api/users/?username=jack&newusername=jack2 https://localhost:33170/api/users/?username=Jack&password=Cr@zy\Pa55w0Rd/\*. https://localhost:33170/api/users/?username=Jack&resettfa=true https://localhost:33170/api/users/?username=Jack&accounttype=0&accesslevel=9&tfaenable=true&custom1=CUSTOM PARAMETER FOR USER&custom7=CUSTOME PARAMETER FOR USE2 https://localhost:33170/api/users/?username=jack&newusername=MYDOMAIN\Jack&accounttype=2 https://localhost:33170/wa/api/users/?username=jack&newusername=jack2
{ "data": { "Username": "jack2", "UserRole": "Manager", "AccessLevel": 9, "FullName": "", "Email": "", "AccountType": 0, "AccountTypeName": "Standard", "TwoFactorAuthEnable": true, "API": true, "Custom1": "CUSTOM PARAMETER FOR USER", "Custom2": "this is a custom property", "Custom3": "", "Custom4": "", "Custom5": "", "Custom6": "", "Custom7": "CUSTOME PARAMETER FOR USE2", "Custom8": "", "Custom9": "" } }
{ "data": { "Username": "jack2", "UserRole": "Manager", "AccessLevel": 9, "FullName": "", "Email": "", "AccountType": 0, "AccountTypeName": "Standard", "TwoFactorAuthEnable": true, "API": true, "Custom1": "CUSTOM PARAMETER FOR USER", "Custom2": "this is a custom property", "Custom3": "", "Custom4": "", "Custom5": "", "Custom6": "", "Custom7": "CUSTOME PARAMETER FOR USE2", "Custom8": "", "Custom9": "", "TwoFactorAuthQRCodeURL": "http://chart.googleapis.com/chart?cht=qr&chs=300x300&chl=otpauth%3A%2F%2Ftotp%2FLogin%3Fsecret%3DGU2TMOBWGEYDMMBTG5SQ%26issuer%3DOpen-Plant", "TwoFactorAuthManualEntry": "GU2TMOBWGEYDMMBTG5SQ" } }
https://localhost:33170/api/users/?username=jack https://localhost:33170/api/users/?username=MYDOMAIN\domainuser https://localhost:33170/wa/api/users/?username=jack
{ "data": { "Username": "jack2", "UserRole": "Manager", "AccessLevel": 9, "FullName": "", "Email": "", "AccountType": 0, "AccountTypeName": "Standard", "TwoFactorAuthEnable": true, "API": true, "Custom1": "CUSTOM PARAMETER FOR USER", "Custom2": "this is a custom property", "Custom3": "", "Custom4": "", "Custom5": "", "Custom6": "", "Custom7": "CUSTOME PARAMETER FOR USE2", "Custom8": "", "Custom9": "" } }
https://127.0.0.1:33170/api/taglist https://127.0.0.1:33170/api/taglist?wildcard=*.pv https://127.0.0.1:33170/wa/api/taglist?wildcard=*.pv
{ "data": [ "random1.value", "myplant\tag.value", "random2.value" ] }
{ "data": [] }
https://127.0.0.1:33170/api/tags/?tagid=FIC101.Value https://127.0.0.1:33170/api/tags/?tagid=fic101.value //This is same as above. Tag Ids are not case sensitive. https://127.0.0.1:33170/wa/api/tags?tagid=FIC101.Value
{ "data": { "Id": "Random1.Value", "TagName": "Random1", "Parameter": "Value", "UnitOfMeasure": "", "Description": "", "Corporate": "", "Plant": "", "Area": "", "Unit": "", "Param1": "", "Param2": "", "Param3": "", "Param4": "", "Param5": "", "Param6": "", "Param7": "", "Param8": "", "Param9": "", "DataType": 0, "InterpType": 1, "SampleTimeoutInS": 180, "CacheSizeInNumberOfItems": 3600, "DuplicateThresholdInMS": 250, "DatabaseLocation": "pv_random1.value", "DatabaseLocationId": null, "LiveValue": null, "LastValue": { "TSUTC": "2020-07-28T03:28:01Z", "Value": -46.873633974173, "IsError": false }, "Historize": true } }
https://127.0.0.1:33170/api/tags https://127.0.0.1:33170/api/tags?wildcard=random.real4 https://127.0.0.1:33170/api/tags?wildcard=random* https://127.0.0.1:33170/wa/api/tags?wildcard=random*
{ "data": [ { "Id": "Random1.Value", "TagName": "Random1", "Parameter": "Value", "UnitOfMeasure": "", "Description": "", "Corporate": "", "Plant": "", "Area": "", "Unit": "", "Param1": "", "Param2": "", "Param3": "", "Param4": "", "Param5": "", "Param6": "", "Param7": "", "Param8": "", "Param9": "", "DataType": 0, "InterpType": 1, "SampleTimeoutInS": 180, "CacheSizeInNumberOfItems": 3600, "DuplicateThresholdInMS": 250, "DatabaseLocation": "pv_random1.value", "DatabaseLocationId": null, "LiveValue": null, "LastValue": { "TSUTC": "2020-07-28T03:28:01.000Z", "Value": -46.873633974173, "IsError": false }, "Historize": true }, { "Id": "Random2.Value", "TagName": "Random2", "Parameter": "Value", "UnitOfMeasure": "", "Description": "", "Corporate": "", "Plant": "", "Area": "", "Unit": "", "Param1": "", "Param2": "", "Param3": "", "Param4": "", "Param5": "", "Param6": "", "Param7": "", "Param8": "", "Param9": "", "DataType": 0, "InterpType": 1, "SampleTimeoutInS": 180, "CacheSizeInNumberOfItems": 3600, "DuplicateThresholdInMS": 250, "DatabaseLocation": "pv_random2.value", "DatabaseLocationId": null, "LiveValue": null, "LastValue": { "TSUTC": "2020-07-28T03:28:01.000Z", "Value": 57.1790787196621, "IsError": false }, "Historize": true } ] }
{ "data": [ { "Id": "Random1.Value", "TagName": "Random1", "Parameter": "Value", "UnitOfMeasure": "m3hr", "Description": "This is a description", "Corporate": "Open-Plant", "Plant": "Refinery", "Area": "P1", "Unit": "CDU", "Param1": "", "Param2": "", "Param3": "", "Param4": "", "Param5": "", "Param6": "", "Param7": "", "Param8": "", "Param9": "", "DataType": 0, "InterpType": 1, "SampleTimeoutInS": 180, "CacheSizeInNumberOfItems": 3600, "DuplicateThresholdInMS": 250, "DatabaseLocation": "pv_random1.value", "DatabaseLocationId": null, "LiveValue": null, "LastValue": { "TSUTC": "2020-07-28T03:28:01.000Z", "Value": -46.873633974173, "IsError": false }, "Historize": true } ] }
https://127.0.0.1:33170/api/tags/?tagid=MyNewTag.pv https://127.0.0.1:33170/api/tags/?tagname=MyNewTag¶meter=pv //this will create the same Tag as above https://127.0.0.1:33170/api/tags/?tagid=TIC1.pv&unitofmeasure=DegC&datatype=real&interpolation=linear https://127.0.0.1:33170/api/tags/?tagid=TIC1.pv&unitofmeasure=DegC //this will create the same Tag as above. Default 'datatype' is real and default 'interpolation' is linear https://127.0.0.1:33170/api/tags/?tagid=FIC1.pv&unitofmeasure=M3HR&corporate=Open-Plant&plant=Refinery&area=Process&Unit=CDU https://127.0.0.1:33170/api/tags/?tagid=FIC2.pv&unitofmeasure=M3HR&corporate=Open-Plant&plant=Refinery&area=Process&Unit=CDU&p1=First Custom Stuff&p2=Custom Stuff&p3=Custom Stuff&p4=Custom Stuff&p5=Custom Stuff&p6=Custom Stuff&p7=Custom Stuff&p8=Custom Stuff&p9=Last Custom Stuff https://127.0.0.1:33170/wa/api/tags/?tagid=MyNewTag.pv
{ "data": { "Id": "FIC102.value", "TagName": "FIC102", "Parameter": "value", "UnitOfMeasure": null, "Description": null, "Corporate": null, "Plant": null, "Area": null, "Unit": null, "Param1": null, "Param2": null, "Param3": null, "Param4": null, "Param5": null, "Param6": null, "Param7": null, "Param8": null, "Param9": null, "DataType": 0, "InterpType": 1, "SampleTimeoutInS": 180, "CacheSizeInNumberOfItems": 3600, "DuplicateThresholdInMS": 250, "DatabaseLocation": "pv_fic102.value", "DatabaseLocationId": null, "LiveValue": null, "LastValue": null, "Historize": false } }
{ "data": { "Id": "FIC2.pv", "TagName": "FIC2", "Parameter": "pv", "UnitOfMeasure": "M3HR", "Description": null, "Corporate": "Open-Plant", "Plant": "Refinery", "Area": "Process", "Unit": "CDU", "Param1": "First Custom Stuff", "Param2": "Custom Stuff", "Param3": "Custom Stuff", "Param4": "Custom Stuff", "Param5": "Custom Stuff", "Param6": "Custom Stuff", "Param7": "Custom Stuff", "Param8": "Custom Stuff", "Param9": "Last Custom Stuff", "DataType": 0, "InterpType": 1, "SampleTimeoutInS": 180, "CacheSizeInNumberOfItems": 3600, "DuplicateThresholdInMS": 250, "DatabaseLocation": "pv_FIC2.pv", "DatabaseLocationId": null, "LiveValue": null, "LastValue": null } }
https://127.0.0.1:33170/api/tags/?tagid=TIC1.pv&unitofmeasure=DegF https://127.0.0.1:33170/api/tags/?tagid=FIC101.value&unitofmeasure=kg/hr&interpolation=digital https://127.0.0.1:33170/api/tags/?tagid=FIC101.value&corporate=Open-Plant&plant=Refinery&area=Process&Unit=CDU https://127.0.0.1:33170/api/tags/?tagid=FIC101.Value&unitofmeasure=M3HR&corporate=Open-Plant&plant=Refinery&area=Process&Unit=CDU&p1=First Custom Stuff&p2=Custom Stuff&p3=Custom Stuff&p4=Custom Stuff&p5=Custom Stuff&p6=Custom Stuff&p7=Custom Stuff&p8=Custom Stuff&p9=Last Custom Stuff https://127.0.0.1:33170/wa/api/tags/?tagid=TIC1.pv&unitofmeasure=DegF
{ "data": { "Id": "FIC101.value", "TagName": "FIC101", "Parameter": "value", "UnitOfMeasure": "M3HR", "Description": "", "Corporate": "Open-Plant", "Plant": "Refinery", "Area": "Process", "Unit": "CDU", "Param1": "First Custom Stuff", "Param2": "Custom Stuff", "Param3": "Custom Stuff", "Param4": "Custom Stuff", "Param5": "Custom Stuff", "Param6": "Custom Stuff", "Param7": "Custom Stuff", "Param8": "Custom Stuff", "Param9": "Last Custom Stuff\n\n", "DataType": 0, "InterpType": 2, "SampleTimeoutInS": 180, "CacheSizeInNumberOfItems": 3600, "DuplicateThresholdInMS": 250, "DatabaseLocation": "pv_fic101.value", "DatabaseLocationId": null, "LiveValue": null, "LastValue": null, "Historize": false } }
https://127.0.0.1:33170/api/tags/?tagid=fic1.pv https://127.0.0.1:33170/api/tags/?tagid=fic1.pv&deletedata=true https://127.0.0.1:33170/api/tags/?tagid=fic1.pv&deletedata=false https://127.0.0.1:33170/wa/api/tags/?tagid=fic1.pv&deletedata=false
{ "tagdeleted": true, "datadeleted": false }
https://127.0.0.1:33170/api/value?tagid=Random.Real4 https://127.0.0.1:33170/api/value?tagid=Random.Real4×tamp=now //Get current data. Same as above. https://127.0.0.1:33170/api/value?tagid=Random.Real4×tamp=now-1d //Get data 1 day ago https://127.0.0.1:33170/api/value?tagid=Random.Real4×tamp=now-10m //Get data 10 minues ago https://127.0.0.1:33170/api/value?tagid=Random.Real4×tamp=now-3h //Get data 3 hours ago https://127.0.0.1:33170/api/value?tagid=Random.Real4×tamp=now-5s //Get data 5 seconds ago https://127.0.0.1:33170/api/value?tagid=Random.Real4×tamp=2019-08-16 13:43:10 https://127.0.0.1:33170/api/value?tagid=Random.Real4×tamp=2019-08-16 03:43:12.432 https://127.0.0.1:33170/api/value?tagid=Random.Real4×tamp=2019-08-16T03:43:12.432Z https://127.0.0.1:33170/api/lastvalue?tagid=Random.Real4 https://127.0.0.1:33170/wa/api/lastvalue?tagid=Random.Real4
{ "data": null }
{ "data": 18379.64 }
https://127.0.0.1:33170/api/values?tagids=Random.Real4,Random.Int1 https://127.0.0.1:33170/api/values?tagids=Random.Real4,Random.Int1×tamp=now //Get current. Same as above. https://127.0.0.1:33170/api/values?tagids=Random.Real4,Random.Int1×tamp=now-1d //Get data 1 day ago. https://127.0.0.1:33170/api/values?tagids=Random.Real4,Random.Int1×tamp=now-10m //Get data 10 minues ago. https://127.0.0.1:33170/api/values?tagids=Random.Real4,Random.Int1×tamp=now-3h //Get data 3 hours ago. https://127.0.0.1:33170/api/values?tagids=Random.Real4,Random.Int1×tamp=now-5s //Get data 5 seconds ago. https://127.0.0.1:33170/api/values?tagids=Random.Real4,Random.Int1×tamp=2019-08-16 13:43:10 https://127.0.0.1:33170/api/values?tagids=Random.Real4,Random.Int1×tamp=2019-08-16T03:43:12.432Z https://127.0.0.1:33170/api/lastvalues?tagids=Random.Real4,Random.Int1 https://127.0.0.1:33170/wa/api/lastvalues?tagids=Random.Real4,Random.Int1
{ "data": [ null, //A null is returned when: null, // - the TagId specified does not exist OR null // - if the value has expired (older than sample timeout) for 'values' call ] }
{ "data": [ 14095.179039999999, 41.968 ] }
https://127.0.0.1:33170/api/datatable?tagids=Random.Real4,Random.Int1&from=2019-08-16T03:43:05.432Z&to=2019-08-16T03:43:08.432Z //time stamps are at 1 seconds interval (default) https://127.0.0.1:33170/api/datatable?tagids=Random.Real4,Random.Int1&from=2019-08-16T03:30:05.432Z&to=2019-08-16T03:43:08.432Z&interval=120000 //time stamps are at 120 seconds interval https://127.0.0.1:33170/api/datatable?tagids=Random.Real4,Random.Int1&from=now-1m&to=now //time stamps are at 1 second interval (default) https://127.0.0.1:33170/api/datatable?tagids=Random.Real4,Random.Int1&from=now-1m&to=now&interval=30000 //time stamps are at 30 seconds interval https://127.0.0.1:33170/wa/api/datatable?tagids=Random.Real4,Random.Int1&from=now-1m&to=now
{ "data": { "TagIds": [ // This is the TagId Table Columns "Random.Real4", "Random.Int1" ], "TSUTCs": [ // This is the second variation of TimeStamp (The Table Rows) "2020-07-29T01:33:22.871Z", "2020-07-29T01:33:23.871Z", "2020-07-29T01:33:24.871Z" ], "ValuesRows": [ // This is the Data Table Rows, each element is a Table Row [ 10448.72, // Corresponds to "Random.Real4" @ "2019-08-16T03:30:05.432Z" 27122 // Corresponds to "Random.Int1" @ "2019-08-16T03:30:05.432Z" ], [ 10448.72, // Corresponds to "Random.Real4" @ "2019-08-16T03:33:05.432Z" 27122 // Corresponds to "Random.Int1" @ "2019-08-16T03:33:05.432Z" ], [ 10448.72, // Corresponds to "Random.Real4" @ "2019-08-16T03:36:05.432Z" 27122 // Corresponds to "Random.Int1" @ "2019-08-16T03:36:05.432Z" ] ] } }
https://127.0.0.1:33170/api/sample?tagid=fic103.value https://127.0.0.1:33170/api/sample?tagid=fic103.value×tamp=now //Get current data. Same as above. https://127.0.0.1:33170/api/sample?tagid=fic103.value×tamp=now-1d //Get data 1 day ago. https://127.0.0.1:33170/api/sample?tagid=fic103.value×tamp=now-10m //Get data 10 minues ago. https://127.0.0.1:33170/api/sample?tagid=fic103.value×tamp=now-3h //Get data 3 hours ago. https://127.0.0.1:33170/api/sample?tagid=fic103.value×tamp=now-5s //Get data 5 seconds ago. https://127.0.0.1:33170/api/sample?tagid=fic103.value×tamp=2019-08-16 13:43:10 https://127.0.0.1:33170/api/sample?tagid=fic103.value×tamp=2019-08-16 03:43:12.432 https://127.0.0.1:33170/api/sample?tagid=fic103.value×tamp=2019-08-16T03:43:12.432Z https://127.0.0.1:33170/api/lastsample?tagid=fic103.value https://127.0.0.1:33170/wa/api/lastsample?tagid=fic103.value
{ "data": { "TSUTC": "2020-07-29T01:38:28.6285625Z", "Value": -13.977528720618018, "IsError": false } }
{ "data": { "TSUTC": "2020-07-29T01:39:30.8540427Z", "Value": null, "IsError": false } }
https://127.0.0.1:33170/api/samples?tagids=Random.Real4,Random.Int1 https://127.0.0.1:33170/api/samples?tagids=Random.Real4,Random.Int1×tamp=now //Get current. Same as above. https://127.0.0.1:33170/api/samples?tagids=Random.Real4,Random.Int1×tamp=now-1d //Get data 1 day ago. https://127.0.0.1:33170/api/samples?tagids=Random.Real4,Random.Int1×tamp=now-10m //Get data 10 minues ago. https://127.0.0.1:33170/api/samples?tagids=Random.Real4,Random.Int1×tamp=now-3h //Get data 3 hours ago. https://127.0.0.1:33170/api/samples?tagids=Random.Real4,Random.Int1×tamp=now-5s //Get data 5 seconds ago. https://127.0.0.1:33170/api/samples?tagids=Random.Real4,Random.Int1×tamp=2019-08-16 13:43:10 https://127.0.0.1:33170/api/samples?tagids=Random.Real4,Random.Int1×tamp=2019-08-16T03:43:12.432Z https://127.0.0.1:33170/api/lastsamples?tagids=Random.Real4,Random.Int1 https://127.0.0.1:33170/wa/api/lastsamples?tagids=Random.Real4,Random.Int1
{ "data": [ { "TSUTC": "2020-07-29T01:44:20.0968541Z", "Value": -14.222284921082812, "IsError": false }, { "TSUTC": "2020-07-29T01:44:20.0968541Z", "Value": 24.559068368542512, "IsError": false } ] }
{ "data": [ null, //Null is returned when Tag Id Specified does not exist { "TSUTC": "2020-07-29T01:44:20.0968541Z", "Value": 24.559068368542512, "IsError": false } ] }
https://127.0.0.1:33170/api/series?tagid=Random.Real4&from=2019-08-16T03:43:05.432Z&to=2019-08-16T03:43:08.432Z //returns samples every 1 second (default) https://127.0.0.1:33170/api/series?tagid=Random.Real4&from=2019-08-16T03:30:05.432Z&to=2019-08-16T03:43:08.432Z&interval=120000 //returns samples every 120 seconds https://127.0.0.1:33170/api/series?tagid=Random.Real4&from=now-1m&to=now //returns samples every 1 second (default) https://127.0.0.1:33170/api/series?tagid=Random.Real4&from=now-1m&to=now&interval=30000 //returns samples every 30 seconds https://127.0.0.1:33170/wa/api/series?tagid=Random.Real4&from=now-1m&to=now&interval=30000
{ "data": [ { "TSUTC": "2020-07-29T04:46:00.2097341Z", "Value": -9.5293384029201, "IsError": false }, { "TSUTC": "2020-07-29T04:47:00.2097341Z", "Value": -9.5293384029201, "IsError": false }, { "TSUTC": "2020-07-29T04:48:00.2097341Z", "Value": -9.5293384029201, "IsError": false } ] }
https://127.0.0.1:33170/api/rawseries?tagid=Random.Real4&from=2019-08-16T03:43:05.432Z&to=2019-08-16T03:43:08.432Z //All samples are returned https://127.0.0.1:33170/api/rawseries?tagid=Random.Real4&from=2019-08-16T03:30:05.432Z&to=2019-08-16T03:43:08.432Z&interval=120000 //returns samples every 120 seconds https://127.0.0.1:33170/api/rawseries?tagid=Random.Real4&from=now-1m&to=now //All samples are returned https://127.0.0.1:33170/api/rawseries?tagid=Random.Real4&from=now-1m&to=now&interval=30000 //returns samples every 30 seconds https://127.0.0.1:33170/wa/api/rawseries?tagid=Random.Real4&from=now-1m&to=now
{ "data": [ { "TSUTC": "2020-07-29T06:03:07.022Z", "Value": 1.06203595225794, "IsError": false }, { "TSUTC": "2020-07-29T06:03:08.022Z", "Value": 1.68915390255356, "IsError": false }, { "TSUTC": "2020-07-29T06:03:10.022Z", "Value": 1.48192795947284, "IsError": false } ] }
https://127.0.0.1:33170/api/samples/?tagid=Random.Real4&values=0.1,0.2,0.15×tamps=now,now-1s,now-2s https://127.0.0.1:33170/api/samples/?tagid=Random.Real4&values=1.23,1.24,1.30×tamps=2019-08-16 13:03:02,2019-08-16 13:04:02,2019-08-16 13:05:02 https://127.0.0.1:33170/api/samples/?tagid=Random.Real4&values=1,2,3×tamps=2019-08-16T03:43:20.212Z,2019-08-16T03:43:21.212Z,2019-08-16T03:43:22.212Z https://127.0.0.1:33170/api/samples/?tagid=Random.Real4&values=0.1,0.2,0.15×tamps=now,now-1s,now-2s&iserrors=0,1,0 https://127.0.0.1:33170/api/samples/?tagid=Random.Real4&values=0.1,0.2,0.15×tamps=now,now-1s,now-2s&iserrors=0 https://127.0.0.1:33170/api/samples/?tagid=Random.Real4&values=0.1,0.2,0.15×tamps=now,now-1s,now-2s&iserrors=false https://127.0.0.1:33170/wa/api/samples/?tagid=Random.Real4&values=0.1,0.2,0.15×tamps=now,now-1s,now-2s&iserrors=false
{ "data": [ { "IsError": false, "TSLocal_ISO": "2019-08-16T11:43:20.212", "TSUTC": "/Date(1565927000212)/", "TSUTC_ISO": "2019-08-16T03:43:20.212Z", "Value": 1 }, { "IsError": false, "TSLocal_ISO": "2019-08-16T11:43:21.212", "TSUTC": "/Date(1565927001212)/", "TSUTC_ISO": "2019-08-16T03:43:21.212Z", "Value": 2 }, { "IsError": false, "TSLocal_ISO": "2019-08-16T11:43:22.212", "TSUTC": "/Date(1565927002212)/", "TSUTC_ISO": "2019-08-16T03:43:22.212Z", "Value": 3 } ] }
https://127.0.0.1:33170/api/samples/?tagids=random.real4,random.int1,fic1.pv&values=0.1,2,0.15×tamps=2019-08-16T03:43:20.212Z,2019-08-16T03:43:21.212Z,2019-08-16T03:43:22.212Z https://127.0.0.1:33170/api/samples/?tagids=random.real4,random.int1,fic1.pv&values=0.1,2,0.15×tamps=now,now-1s,now-2s https://127.0.0.1:33170/api/samples/?tagids=random.int1,fic1.pv&values=3,2×tamps=now,now&datatypes=int,real https://127.0.0.1:33170/api/samples/?tagids=random.int1,fic1.pv&values=3,2&datatypes=int,real&iserrors=true,false https://127.0.0.1:33170/api/samples/?tagids=random.int1,fic1.pv&values=3,2&datatypes=int,real&iserrors=true //this causes all samples inserted have iserror=true https://127.0.0.1:33170/api/samples/?tagids=random.real4,random.int1,fic1.pv&values=0.1,2,0.15 //this inserts all 3 samples at current time https://127.0.0.1:33170/api/samples/?tagids=fic1.pv&values=0.1,2,0.15×tamps=now,now-1s,now-2s //this inserts all 3 samples into 'fic1.pv' https://127.0.0.1:33170/api/samples/?tagids=random.real4,random.int1,fic1.pv&values=0.1,2,0.15×tamps=2019-08-16T03:43:20.212Z //this inserts all 3 samples at '2019-08-16T03:43:20.212Z' https://127.0.0.1:33170/wa/api/samples/insert?tagids=random.real4,random.int1,fic1.pv&values=0.1,2,0.15×tamps=2019-08-16T03:43:20.212Z
{ "totalsamplesinserted": 3, "totaltagscreated": 0 }
https://127.0.0.1:33170/api/opscriptlist https://127.0.0.1:33170/api/opscriptlist?wildcard="admin_*" https://127.0.0.1:33170/wa/api/opscriptlist?wildcard="admin_*"
{ "data": [ { "Id": "7e1da12b-ffa6-46dc-a512-9f07158f34a3", "Name": "New Analysis 1" }, { "Id": "801ce86a-9868-49c5-8a04-f2cf24072e81", "Name": "New Analysis 2" } ] }
{ "data": [] }
https://localhost:33170/api/opscripts/?id=7e1da12b-ffa6-46dc-a512-9f07158f34a3 https://localhost:33170/api/opscripts/?name=New Analysis 1 https://localhost:33170/wa/api/opscripts/?name=New Analysis 1
{ "data": { "Id": "7e1da12b-ffa6-46dc-a512-9f07158f34a3", "Name": "New Analysis 1", "Enabled": true, "ParentId": "623c2bcc-e589-4695-b04d-ccf84790de60", "RunAsAccessLevel": 6, "MinimumEditAccessLevel": 6, "Code": "using OpenPlant;\r\nusing System;\r\nusing System.Linq;\r\nusing System.Diagnostics;\r\nusing System.Data;\r\nusing System.IO;\r\nusing System.Collections.Generic;\r\nusing System.Xml;\r\nusing System.Xml.Serialization;\r\nusing System.Threading;\r\nusing System.ServiceModel;\r\nusing System.Threading.Tasks;\r\nusing System.Collections.Concurrent;\r\nusing System.Globalization;\r\n\r\npublic class OPScript\r\n{\r\n\r\npublic object Main()\r\n{\r\n//*********** ANALYTIC SCRIPT STARTS HERE (DO NOT REMOVE THIS LINE) ***********\r\rThread.Sleep(1000);\rreturn OP.ListTagIds(\"*\");\n//*********** ANALYTIC SCRIPT ENDS HERE (DO NOT REMOVE THIS LINE) *************\r\nreturn null;\r\n}\r\n\r\n}\r\n", "Schedule": { "ScheduleEnabled": false, "StartTime": null, "OPScriptId": "7e1da12b-ffa6-46dc-a512-9f07158f34a3", "ServerName": "AZRINLAPTOP2", "StartImmediately": true, "Frequency": 1, "FrequencyUnit": 1, "DaysSelected_ForWeeksFrequencyUnit": [], "MonthsSelected_ForMonthsFrequencyUnit": [], "DaysSelected_ForMonthsFrequencyUnit": [], "SpecialDayOfMonth_ForMonthsFrequencyUnit": [], "ExpiryTime": null, "FirstDayOfWeek": 1 }, "WebAPI": { "Enabled": true, "EnableTriggerURL": true, "TriggerURLRegexMatch": "/test/for/alternative", "TriggerURLMethod": "GET", "MatchWithRegex": true }, "MethodName": "Main" } }
https://127.0.0.1:33170/api/opscripts https://127.0.0.1:33170/api/opscripts?wildcard="admin_*" https://127.0.0.1:33170/wa/api/opscrips?wildcard="admin_*"
{ "data": [ { "Id": "7e1da12b-ffa6-46dc-a512-9f07158f34a3", "Name": "New Analysis 1", "Enabled": true, "ParentId": "623c2bcc-e589-4695-b04d-ccf84790de60", "RunAsAccessLevel": 6, "MinimumEditAccessLevel": 6, "Code": "using OpenPlant;\r\nusing System;\r\nusing System.Linq;\r\nusing System.Diagnostics;\r\nusing System.Data;\r\nusing System.IO;\r\nusing System.Collections.Generic;\r\nusing System.Xml;\r\nusing System.Xml.Serialization;\r\nusing System.Threading;\r\nusing System.ServiceModel;\r\nusing System.Threading.Tasks;\r\nusing System.Collections.Concurrent;\r\nusing System.Globalization;\r\n\r\npublic class OPScript\r\n{\r\n\r\npublic object Main()\r\n{\r\n//*********** ANALYTIC SCRIPT STARTS HERE (DO NOT REMOVE THIS LINE) ***********\r\rThread.Sleep(1000);\rreturn OP.ListTagIds(\"*\");\n//*********** ANALYTIC SCRIPT ENDS HERE (DO NOT REMOVE THIS LINE) *************\r\nreturn null;\r\n}\r\n\r\n}\r\n", "Schedule": { "ScheduleEnabled": false, "StartTime": null, "OPScriptId": "7e1da12b-ffa6-46dc-a512-9f07158f34a3", "ServerName": "AZRINLAPTOP2", "StartImmediately": true, "Frequency": 1, "FrequencyUnit": 1, "DaysSelected_ForWeeksFrequencyUnit": [], "MonthsSelected_ForMonthsFrequencyUnit": [], "DaysSelected_ForMonthsFrequencyUnit": [], "SpecialDayOfMonth_ForMonthsFrequencyUnit": [], "ExpiryTime": null, "FirstDayOfWeek": 1 }, "WebAPI": { "Enabled": true, "EnableTriggerURL": true, "TriggerURLRegexMatch": "/test/for/alternative", "TriggerURLMethod": "GET", "MatchWithRegex": true }, "MethodName": "Main" }, { "Id": "801ce86a-9868-49c5-8a04-f2cf24072e81", "Name": "New Analysis 2", "Enabled": true, "ParentId": "", "RunAsAccessLevel": 6, "MinimumEditAccessLevel": 6, "Code": "using OpenPlant;\r\nusing System;\r\nusing System.Linq;\r\nusing System.Diagnostics;\r\nusing System.Data;\r\nusing System.IO;\r\nusing System.Collections.Generic;\r\nusing System.Xml;\r\nusing System.Xml.Serialization;\r\nusing System.Threading;\r\nusing System.ServiceModel;\r\nusing System.Threading.Tasks;\r\nusing System.Collections.Concurrent;\r\nusing System.Globalization;\r\n\r\npublic class OPScript\r\n{\r\n\r\npublic object Main(string P1)\r\n{\r\n//*********** ANALYTIC SCRIPT STARTS HERE (DO NOT REMOVE THIS LINE) ***********\r\nOP.Log(P1);\rThread.Sleep(1000);\rreturn OP.ListTagIds(\"*\");\n//*********** ANALYTIC SCRIPT ENDS HERE (DO NOT REMOVE THIS LINE) *************\r\nreturn null;\r\n}\r\n\r\n}\r\n", "Schedule": { "ScheduleEnabled": false, "StartTime": null, "OPScriptId": "801ce86a-9868-49c5-8a04-f2cf24072e81", "ServerName": "AZRINLAPTOP2", "StartImmediately": true, "Frequency": 1, "FrequencyUnit": 1, "DaysSelected_ForWeeksFrequencyUnit": [], "MonthsSelected_ForMonthsFrequencyUnit": [], "DaysSelected_ForMonthsFrequencyUnit": [], "SpecialDayOfMonth_ForMonthsFrequencyUnit": [], "ExpiryTime": null, "FirstDayOfWeek": 0 }, "WebAPI": { "Enabled": true, "EnableTriggerURL": false, "TriggerURLRegexMatch": "", "TriggerURLMethod": "GET", "MatchWithRegex": false }, "MethodName": "Main" } ] }
https://localhost:33170/api/opscripts/ https://localhost:33170/wa/api/opscripts/
{ "data": { "Name": "My Analysis", "Enabled": false, "ParentId": "", "RunAsAccessLevel": 6, "MinimumEditAccessLevel": 6, "Code": "using OpenPlant;\r\nusing System;\r\nusing System.Linq;\r\nusing System.Diagnostics;\r\nusing System.Data;\r\nusing System.IO;\r\nusing System.Collections.Generic;\r\nusing System.Xml;\r\nusing System.Xml.Serialization;\r\nusing System.Threading;\r\nusing System.ServiceModel;\r\nusing System.Threading.Tasks;\r\nusing System.Collections.Concurrent;\r\nusing System.Globalization;\r\n\r\npublic class OPScript\r\n{\r\n\r\npublic object Main()\r\n{\r\n//*********** ANALYTIC SCRIPT STARTS HERE (DO NOT REMOVE THIS LINE) ***********\r\nOP.Log(\"Hello World!\");\r\n//*********** ANALYTIC SCRIPT ENDS HERE (DO NOT REMOVE THIS LINE) *************\r\nreturn null;\r\n}\r\n\r\n}\r\n", "Schedule": { "ScheduleEnabled": false, "StartTime": null, "OPScriptId": "", "ServerName": "", "StartImmediately": true, "Frequency": 1, "FrequencyUnit": 1, "DaysSelected_ForWeeksFrequencyUnit": [], "MonthsSelected_ForMonthsFrequencyUnit": [], "DaysSelected_ForMonthsFrequencyUnit": [], "SpecialDayOfMonth_ForMonthsFrequencyUnit": [], "ExpiryTime": null, "FirstDayOfWeek": 0 }, "WebAPI": { "Enabled": false, "EnableTriggerURL": false, "TriggerURLRegexMatch": "", "TriggerURLMethod": "", "MatchWithRegex": false }, "MethodName": "Main" } }
{ "data": { "Id": "818dabc5-84b0-46fe-aaf9-35ea86c63b73", "Name": "My Analysis", "Enabled": false, "ParentId": "", "RunAsAccessLevel": 6, "MinimumEditAccessLevel": 6, "Code": "using OpenPlant;\r\nusing System;\r\nusing System.Linq;\r\nusing System.Diagnostics;\r\nusing System.Data;\r\nusing System.IO;\r\nusing System.Collections.Generic;\r\nusing System.Xml;\r\nusing System.Xml.Serialization;\r\nusing System.Threading;\r\nusing System.ServiceModel;\r\nusing System.Threading.Tasks;\r\nusing System.Collections.Concurrent;\r\nusing System.Globalization;\r\n\r\npublic class OPScript\r\n{\r\n\r\npublic object Main()\r\n{\r\n//*********** ANALYTIC SCRIPT STARTS HERE (DO NOT REMOVE THIS LINE) ***********\r\nOP.Log(\"Hello World!\");\r\n//*********** ANALYTIC SCRIPT ENDS HERE (DO NOT REMOVE THIS LINE) *************\r\nreturn null;\r\n}\r\n\r\n}\r\n", "Schedule": { "ScheduleEnabled": false, "StartTime": null, "OPScriptId": "", "ServerName": "", "StartImmediately": true, "Frequency": 1, "FrequencyUnit": 1, "DaysSelected_ForWeeksFrequencyUnit": [], "MonthsSelected_ForMonthsFrequencyUnit": [], "DaysSelected_ForMonthsFrequencyUnit": [], "SpecialDayOfMonth_ForMonthsFrequencyUnit": [], "ExpiryTime": null, "FirstDayOfWeek": 0 }, "WebAPI": { "Enabled": false, "EnableTriggerURL": false, "TriggerURLRegexMatch": "", "TriggerURLMethod": "", "MatchWithRegex": false }, "MethodName": "Main" } }
https://localhost:33170/api/opscripts/?id=818dabc5-84b0-46fe-aaf9-35ea86c63b73 https://localhost:33170/wa/api/opscripts/?id=818dabc5-84b0-46fe-aaf9-35ea86c63b73
{ "data": { "Id": "818dabc5-84b0-46fe-aaf9-35ea86c63b73" "Name": "My Analysis New Name", "Enabled": true, "ParentId": "", "RunAsAccessLevel": 6, "MinimumEditAccessLevel": 6, "Code": "using OpenPlant;\r\nusing System;\r\nusing System.Linq;\r\nusing System.Diagnostics;\r\nusing System.Data;\r\nusing System.IO;\r\nusing System.Collections.Generic;\r\nusing System.Xml;\r\nusing System.Xml.Serialization;\r\nusing System.Threading;\r\nusing System.ServiceModel;\r\nusing System.Threading.Tasks;\r\nusing System.Collections.Concurrent;\r\nusing System.Globalization;\r\n\r\npublic class OPScript\r\n{\r\n\r\npublic object Main()\r\n{\r\n//*********** ANALYTIC SCRIPT STARTS HERE (DO NOT REMOVE THIS LINE) ***********\r\nOP.Log(\"Hello World!\");\r\n//*********** ANALYTIC SCRIPT ENDS HERE (DO NOT REMOVE THIS LINE) *************\r\nreturn null;\r\n}\r\n\r\n}\r\n", "Schedule": { "ScheduleEnabled": false, "StartTime": null, "OPScriptId": "", "ServerName": "", "StartImmediately": true, "Frequency": 1, "FrequencyUnit": 1, "DaysSelected_ForWeeksFrequencyUnit": [], "MonthsSelected_ForMonthsFrequencyUnit": [], "DaysSelected_ForMonthsFrequencyUnit": [], "SpecialDayOfMonth_ForMonthsFrequencyUnit": [], "ExpiryTime": null, "FirstDayOfWeek": 0 }, "WebAPI": { "Enabled": false, "EnableTriggerURL": false, "TriggerURLRegexMatch": "", "TriggerURLMethod": "", "MatchWithRegex": false }, "MethodName": "Main" } }
https://localhost:33170/api/opscripts/?id=7e1da12b-ffa6-46dc-a512-9f07158f34a3 https://localhost:33170/wa/api/opscripts/?id=7e1da12b-ffa6-46dc-a512-9f07158f34a3
{ "data": { "Id": "7e1da12b-ffa6-46dc-a512-9f07158f34a3", "Name": "New Analysis 1", "Enabled": true, "ParentId": "623c2bcc-e589-4695-b04d-ccf84790de60", "RunAsAccessLevel": 6, "MinimumEditAccessLevel": 6, "Code": "using OpenPlant;\r\nusing System;\r\nusing System.Linq;\r\nusing System.Diagnostics;\r\nusing System.Data;\r\nusing System.IO;\r\nusing System.Collections.Generic;\r\nusing System.Xml;\r\nusing System.Xml.Serialization;\r\nusing System.Threading;\r\nusing System.ServiceModel;\r\nusing System.Threading.Tasks;\r\nusing System.Collections.Concurrent;\r\nusing System.Globalization;\r\n\r\npublic class OPScript\r\n{\r\n\r\npublic object Main()\r\n{\r\n//*********** ANALYTIC SCRIPT STARTS HERE (DO NOT REMOVE THIS LINE) ***********\r\rThread.Sleep(1000);\rreturn OP.ListTagIds(\"*\");\n//*********** ANALYTIC SCRIPT ENDS HERE (DO NOT REMOVE THIS LINE) *************\r\nreturn null;\r\n}\r\n\r\n}\r\n", "Schedule": { "ScheduleEnabled": false, "StartTime": null, "OPScriptId": "7e1da12b-ffa6-46dc-a512-9f07158f34a3", "ServerName": "AZRINLAPTOP2", "StartImmediately": true, "Frequency": 1, "FrequencyUnit": 1, "DaysSelected_ForWeeksFrequencyUnit": [], "MonthsSelected_ForMonthsFrequencyUnit": [], "DaysSelected_ForMonthsFrequencyUnit": [], "SpecialDayOfMonth_ForMonthsFrequencyUnit": [], "ExpiryTime": null, "FirstDayOfWeek": 1 }, "WebAPI": { "Enabled": true, "EnableTriggerURL": true, "TriggerURLRegexMatch": "/test/for/alternative", "TriggerURLMethod": "GET", "MatchWithRegex": true }, "MethodName": "Main" } }
http://localhost:33171/api/opscripttree/ http://localhost:33171/api/opscripttree/?Flatlist=true http://localhost:33171/wa/api/opscripttree/
{ "data": [ { "Id": "623c2bcc-e589-4695-b04d-ccf84790de60", "ParentId": "", "Name": "Azrin's Folder", "IsGroup": true, "MinimumEditAccessLevel": 6 }, { "Id": "7c5e88de-8b5c-4062-98d7-366dd5b197f4", "ParentId": "", "Name": "Azrin's Subfolder", "IsGroup": true, "MinimumEditAccessLevel": 6 }, { "Id": "7c5e99de-8b5c-4062-98d7-366dd5b197f4", "ParentId": "623c2bcc-e589-4695-b04d-ccf84790de60", "Name": "New Subfolder", "IsGroup": true, "MinimumEditAccessLevel": 6 }, { "Id": "2180b647-cbe1-49f5-96bf-fbaf32a41588", "ParentId": "7c5e99de-8b5c-4062-98d7-366dd5b197f4", "Name": "New Analysis 132", "IsGroup": false, "MinimumEditAccessLevel": 6 }, { "Id": "0da577c7-616a-4ee2-bc5a-27106c2e430b", "ParentId": "623c2bac-e589-4695-b04d-ccf84790de60", "Name": "test222", "IsGroup": false, "MinimumEditAccessLevel": 6 } ] }
{ "data": [ { "$type": "OpenPlant.ScriptGroupWebAPI, OPCoreLib", "Children": [ { "$type": "OpenPlant.ScriptSubGroupWebAPI, OPCoreLib", "Scripts": [ { "Id": "2180b647-cbe1-49f5-96bf-fbaf32a41588", "ParentId": "7c5e99de-8b5c-4062-98d7-366dd5b197f4", "Name": "New Analysis 132", "IsGroup": false, "MinimumEditAccessLevel": 6 } ], "Id": "7c5e99de-8b5c-4062-98d7-366dd5b197f4", "ParentId": "623c2bcc-e589-4695-b04d-ccf84790de60", "Name": "New Subfolder", "IsGroup": true, "MinimumEditAccessLevel": 6 } ], "Id": "623c2bcc-e589-4695-b04d-ccf84790de60", "ParentId": null, "Name": "Azrin's Folder", "IsGroup": true, "MinimumEditAccessLevel": 6 }, { "$type": "OpenPlant.ScriptGroupWebAPI, OPCoreLib", "Children": [], "Id": "7c5e88de-8b5c-4062-98d7-366dd5b197f4", "ParentId": null, "Name": "Azrin's Subfolder", "IsGroup": true, "MinimumEditAccessLevel": 6 } ] }
http://localhost:33171/api/opscripttree/ http://localhost:33171/wa/api/opscripttree/
{ "data": [ { "ParentId": "", "Name": "Azrin's NEW Folder", "IsGroup": true, "MinimumEditAccessLevel": 6 }, { "Id": "0da577c7-616a-4ee2-bc5a-27106c2e430b", "ParentId": "623c2bac-e589-4695-b04d-ccf84790de60", "Name": "NEW FOLDER NAME", "IsGroup": false, "MinimumEditAccessLevel": 6 } ] }
{ "data": [ { "Id": "1af81898-615b-4b94-a2bb-3b6ba41a7566", "ParentId": "", "Name": "Azrin's NEW Folder", "IsGroup": true, "MinimumEditAccessLevel": 6 }, { "Id": "0da577c7-616a-4ee2-bc5a-27106c2e430b", "ParentId": "623c2bac-e589-4695-b04d-ccf84790de60", "Name": "NEW FOLDER NAME", "IsGroup": false, "MinimumEditAccessLevel": 6 } ] }
http://localhost:33171/api/newfolder http://localhost:33171/api/newfolder?name=MyNewFolder //with Minimum Edit = Querying User access level http://localhost:33171/api/newfolder?name=MyNewFolder&minimumedit=7 //This creates a Folder at the top of the directory http://localhost:33171/api/newfolder?name=MyNewFolder&minimumedit=7&parentid=641f8453-6030-41e3-96c4-8cdbb1e5d876 http://localhost:33171/wa/api/newfolder
{ "data": { "ScriptList": [], "Id": "a0469268-d9b7-43a4-bd5c-6796747b8406", "ParentId": "7e0093b0-52f6-4cdf-89b7-4db99fbca3a7", "Name": "testfolderL2", "IsGroup": true, "MinimumEditAccessLevel": 7 } }
http://localhost:33171/api/deletefolder?id=641f8453-6030-41e3-96c4-8cdbb1e5d876 http://localhost:33171/wa/api/deletefolder?id=641f8453-6030-41e3-96c4-8cdbb1e5d876
{ "data": { "Id": "a0469268-d9b7-43a4-bd5c-6796747b8406", "ParentId": "7e0093b0-52f6-4cdf-89b7-4db99fbca3a7", "Name": "testfolderL2", "IsGroup": true, "MinimumEditAccessLevel": 7 } }
http://localhost:33171/api/runscript //This runs a custom script inserted in the request body http://localhost:33171/api/runscript?id=7e1da12b-ffa6-46dc-a512-9f07158f34a3 //This runs an exsiting script http://localhost:33171/api/runscript?name=Analysis1 //This runs an exsiting script
var xhttp = new XMLHttpRequest(); xhttp.open("POST", "http://localhost:33171/api/runscript", true); xhttp.setRequestHeader('Authorization', 'Basic ' + window.btoa('USERNAME:PASSWORD')); xhttp.send("return OP.ListTagIds("*");"); xhttp.onreadystatechange = function(){ if (xhttp.readyState === XMLHttpRequest.DONE) { if (xhttp.status === 200) document.write(xhttp.responseText); else document.write("FAILED!"); } };
{ "runsuccess": true, "runduration_ms": 243, "error": null }
[ "Sensor008.Value", "Sensor001.Value", "Sensor009.Value", "Sensor006.Value", "Sensor010.Value", "Sensor007.Value", "Sensor002.Value", "Sensor004.Value", "Sensor003.Value", "Sensor005.Value" ]
https://127.0.0.1:33170/api/sample?tagid=fic103.value https://127.0.0.1:33170/api/sample?tagid=fic103.value×tamp=now //Get current data. Same as above. https://127.0.0.1:33170/api/sample?tagid=fic103.value×tamp=now-1d //Get data 1 day ago. https://127.0.0.1:33170/api/sample?tagid=fic103.value×tamp=now-10m //Get data 10 minues ago. https://127.0.0.1:33170/api/sample?tagid=fic103.value×tamp=now-3h //Get data 3 hours ago. https://127.0.0.1:33170/api/sample?tagid=fic103.value×tamp=now-5s //Get data 5 seconds ago. https://127.0.0.1:33170/api/sample?tagid=fic103.value×tamp=2019-08-16 13:43:10 https://127.0.0.1:33170/api/sample?tagid=fic103.value×tamp=2019-08-16 03:43:12.432 https://127.0.0.1:33170/api/sample?tagid=fic103.value×tamp=2019-08-16T03:43:12.432Z https://127.0.0.1:33170/api/lastsample?tagid=fic103.value https://127.0.0.1:33170/wa/api/lastsample?tagid=fic103.value
{ "data": { "TSUTC": "2020-07-29T01:38:28.6285625Z", "Value": -13.977528720618018, "IsError": false } }
{ "data": { "TSUTC": "2020-07-29T01:39:30.8540427Z", "Value": null, "IsError": false } }
https://127.0.0.1:33170/api/samples?tagids=Random.Real4,Random.Int1 https://127.0.0.1:33170/api/samples?tagids=Random.Real4,Random.Int1×tamp=now //Get current. Same as above. https://127.0.0.1:33170/api/samples?tagids=Random.Real4,Random.Int1×tamp=now-1d //Get data 1 day ago. https://127.0.0.1:33170/api/samples?tagids=Random.Real4,Random.Int1×tamp=now-10m //Get data 10 minues ago. https://127.0.0.1:33170/api/samples?tagids=Random.Real4,Random.Int1×tamp=now-3h //Get data 3 hours ago. https://127.0.0.1:33170/api/samples?tagids=Random.Real4,Random.Int1×tamp=now-5s //Get data 5 seconds ago. https://127.0.0.1:33170/api/samples?tagids=Random.Real4,Random.Int1×tamp=2019-08-16 13:43:10 https://127.0.0.1:33170/api/samples?tagids=Random.Real4,Random.Int1×tamp=2019-08-16T03:43:12.432Z https://127.0.0.1:33170/api/lastsamples?tagids=Random.Real4,Random.Int1 https://127.0.0.1:33170/wa/api/lastsamples?tagids=Random.Real4,Random.Int1
{ "data": [ { "TSUTC": "2020-07-29T01:44:20.0968541Z", "Value": -14.222284921082812, "IsError": false }, { "TSUTC": "2020-07-29T01:44:20.0968541Z", "Value": 24.559068368542512, "IsError": false } ] }
{ "data": [ null, //Null is returned when Tag Id Specified does not exist { "TSUTC": "2020-07-29T01:44:20.0968541Z", "Value": 24.559068368542512, "IsError": false } ] }
https://127.0.0.1:33170/api/series?tagid=Random.Real4&from=2019-08-16T03:43:05.432Z&to=2019-08-16T03:43:08.432Z //returns samples every 1 second (default) https://127.0.0.1:33170/api/series?tagid=Random.Real4&from=2019-08-16T03:30:05.432Z&to=2019-08-16T03:43:08.432Z&interval=120000 //returns samples every 120 seconds https://127.0.0.1:33170/api/series?tagid=Random.Real4&from=now-1m&to=now //returns samples every 1 second (default) https://127.0.0.1:33170/api/series?tagid=Random.Real4&from=now-1m&to=now&interval=30000 //returns samples every 30 seconds https://127.0.0.1:33170/wa/api/series?tagid=Random.Real4&from=now-1m&to=now&interval=30000
{ "data": [ { "TSUTC": "2020-07-29T04:46:00.2097341Z", "Value": -9.5293384029201, "IsError": false }, { "TSUTC": "2020-07-29T04:47:00.2097341Z", "Value": -9.5293384029201, "IsError": false }, { "TSUTC": "2020-07-29T04:48:00.2097341Z", "Value": -9.5293384029201, "IsError": false } ] }
https://127.0.0.1:33170/api/rawseries?tagid=Random.Real4&from=2019-08-16T03:43:05.432Z&to=2019-08-16T03:43:08.432Z //All samples are returned https://127.0.0.1:33170/api/rawseries?tagid=Random.Real4&from=2019-08-16T03:30:05.432Z&to=2019-08-16T03:43:08.432Z&interval=120000 //returns samples every 120 seconds https://127.0.0.1:33170/api/rawseries?tagid=Random.Real4&from=now-1m&to=now //All samples are returned https://127.0.0.1:33170/api/rawseries?tagid=Random.Real4&from=now-1m&to=now&interval=30000 //returns samples every 30 seconds https://127.0.0.1:33170/wa/api/rawseries?tagid=Random.Real4&from=now-1m&to=now
{ "data": [ { "TSUTC": "2020-07-29T06:03:07.022Z", "Value": 1.06203595225794, "IsError": false }, { "TSUTC": "2020-07-29T06:03:08.022Z", "Value": 1.68915390255356, "IsError": false }, { "TSUTC": "2020-07-29T06:03:10.022Z", "Value": 1.48192795947284, "IsError": false } ] }
https://127.0.0.1:33170/api/samples/?tagid=Random.Real4&values=0.1,0.2,0.15×tamps=now,now-1s,now-2s https://127.0.0.1:33170/api/samples/?tagid=Random.Real4&values=1.23,1.24,1.30×tamps=2019-08-16 13:03:02,2019-08-16 13:04:02,2019-08-16 13:05:02 https://127.0.0.1:33170/api/samples/?tagid=Random.Real4&values=1,2,3×tamps=2019-08-16T03:43:20.212Z,2019-08-16T03:43:21.212Z,2019-08-16T03:43:22.212Z https://127.0.0.1:33170/api/samples/?tagid=Random.Real4&values=0.1,0.2,0.15×tamps=now,now-1s,now-2s&iserrors=0,1,0 https://127.0.0.1:33170/api/samples/?tagid=Random.Real4&values=0.1,0.2,0.15×tamps=now,now-1s,now-2s&iserrors=0 https://127.0.0.1:33170/api/samples/?tagid=Random.Real4&values=0.1,0.2,0.15×tamps=now,now-1s,now-2s&iserrors=false https://127.0.0.1:33170/wa/api/samples/?tagid=Random.Real4&values=0.1,0.2,0.15×tamps=now,now-1s,now-2s&iserrors=false
{ "data": [ { "IsError": false, "TSLocal_ISO": "2019-08-16T11:43:20.212", "TSUTC": "/Date(1565927000212)/", "TSUTC_ISO": "2019-08-16T03:43:20.212Z", "Value": 1 }, { "IsError": false, "TSLocal_ISO": "2019-08-16T11:43:21.212", "TSUTC": "/Date(1565927001212)/", "TSUTC_ISO": "2019-08-16T03:43:21.212Z", "Value": 2 }, { "IsError": false, "TSLocal_ISO": "2019-08-16T11:43:22.212", "TSUTC": "/Date(1565927002212)/", "TSUTC_ISO": "2019-08-16T03:43:22.212Z", "Value": 3 } ] }
https://127.0.0.1:33170/api/samples/?tagids=random.real4,random.int1,fic1.pv&values=0.1,2,0.15×tamps=2019-08-16T03:43:20.212Z,2019-08-16T03:43:21.212Z,2019-08-16T03:43:22.212Z https://127.0.0.1:33170/api/samples/?tagids=random.real4,random.int1,fic1.pv&values=0.1,2,0.15×tamps=now,now-1s,now-2s https://127.0.0.1:33170/api/samples/?tagids=random.int1,fic1.pv&values=3,2×tamps=now,now&datatypes=int,real https://127.0.0.1:33170/api/samples/?tagids=random.int1,fic1.pv&values=3,2&datatypes=int,real&iserrors=true,false https://127.0.0.1:33170/api/samples/?tagids=random.int1,fic1.pv&values=3,2&datatypes=int,real&iserrors=true //this causes all samples inserted have iserror=true https://127.0.0.1:33170/api/samples/?tagids=random.real4,random.int1,fic1.pv&values=0.1,2,0.15 //this inserts all 3 samples at current time https://127.0.0.1:33170/api/samples/?tagids=fic1.pv&values=0.1,2,0.15×tamps=now,now-1s,now-2s //this inserts all 3 samples into 'fic1.pv' https://127.0.0.1:33170/api/samples/?tagids=random.real4,random.int1,fic1.pv&values=0.1,2,0.15×tamps=2019-08-16T03:43:20.212Z //this inserts all 3 samples at '2019-08-16T03:43:20.212Z' https://127.0.0.1:33170/wa/api/samples/insert?tagids=random.real4,random.int1,fic1.pv&values=0.1,2,0.15×tamps=2019-08-16T03:43:20.212Z
{ "totalsamplesinserted": 3, "totaltagscreated": 0 }