Toto je starší verze dokumentu!
API
Mervis SCADA nabízí otevřené REST-like API postavené na JSON a XML formátech dat. Pro kompletní popis API kontaktujte naši technickou podporu.
Přehled základních API metod
Function | Description |
---|
api/checkCredentials | |
---|---|
api/logout | |
api/get/projects | |
api/get/projectData | |
api/get/projectByParts | |
api/get/history | |
api/get/history/specific | |
api/set/history | |
api/get/values | |
api/get/alarms | |
api/get/alarmHistory | |
api/get/eventHistory | |
api/get/changes | |
api/set/executeActions | |
api/set/values | |
api/set/executeAlarmOps | |
api/set/projectPriorityRefresh | |
api/get/schema | |
api/get/schema/datapoints | |
api/get/schema/values | |
api/get/schema/image |
Příklad
api/get/history
Request
- URL: /api/get/history?format=xml
- Method: POST
{ "cred":{ "t":"d1871589-c455-416a-91f3-d9cda3aa5e0f" }, "projId":"2e4deb05-0517-4ef7-ae7a-02e146b23a1d", "dpId":"ffb370fc-eeb8-404f-9088-46577ea64134", "providerId":"689E32FA-24A2-448E-9374-6158E6E6CB15", "from":"/Date(1494280800000)/", "to":"/Date(1494412488822)/", "offset":0, "count":5000, "historyState":"" }
Response
<getHistoryResult xmlns:r="http://dev.rcware.eu/serialization/references" r:type="b133774d-21ce-42b6-add3-57c012079c55" xmlns:n1="http://dev.rcware.eu/scada/basic-props" xmlns="http://dev.rcware.eu/scada/history"> <hist projId="2e4deb05-0517-4ef7-ae7a-02e146b23a1d" dpId="ffb370fc-eeb8-404f-9088-46577ea64134" propName="Output" interval="PT5M" historyState="" nextValOfs="-1"> <errMsg/> <vals> <hv ts="2017-05-08T22:26:53.32684Z" gt="2017-05-08T22:31:53.465467Z"> <n1:v>4.3</n1:v> </hv> <hv ts="2017-05-08T22:36:53.283875Z"> <n1:v>4.2</n1:v> </hv> <hv ts="2017-05-08T22:41:53.435042Z"> <n1:v>4.1</n1:v> </hv> <hv ts="2017-05-08T22:46:53.711496Z" gt="2017-05-08T23:36:53.776657Z"> <n1:v>4</n1:v> </hv> </vals> </hist> </getHistoryResult>
api/v2/get/history
Request
- URL: /api/v2/get/history?format=xml
- Method: POST
{ "data":{ "cred":{ "n":"login", "p":"pass", "pe":0 }, "projId":"5abf8ca0-94ba-48df-8d3c-7ebe87a12fd0", "from":"/Date(1540388023926)/", "to":"/Date(1540389034926)/", "offset":0, "variableOffset":0, "count":5000, "historyState":"", "providersDps":[ { "m_Item1":"689E32FA-24A2-448E-9374-6158E6E6CB15", // DB Provider ID "m_Item2":"29e70213-c1f1-431f-9e1b-a9eeb72e5bfc" // Datapoint ID } ] } }
Response
<?xml version="1.0" encoding="utf-8"?> <globalResponse xmlns:r="http://dev.rcware.eu/serialization/references" xmlns:n1="http://dev.rcware.eu/scada/getHistoryV2/response" xmlns:n2="http://dev.rcware.eu/scada/datapoints" xmlns:n3="http://dev.rcware.eu/scada/history" xmlns:n4="http://dev.rcware.eu/scada/basic-props" xmlns="http://dev.rcware.eu/core/globalRequestResponse"> <result code="0" codeTxt="Ok" desc="" dataType="" /> <data n1:count="3" n1:nextOffset="-1" n1:nextVariableOffset="-1" n1:nextHistoryState="" r:type="d70d8bcb-04a7-4bca-a626-4f6dd466c6e0"> <n1:providerHistories> <n1:providerHistories providerId="689e32fa-24a2-448e-9374-6158e6e6cb15"> <n1:dpHistories> <n2:pl> <n2:p n="Output" u="°C" r:type="b133774d-21ce-42b6-add3-57c012079c55"> <n3:hist projId="5abf8ca0-94ba-48df-8d3c-7ebe87a12fd0" dpId="29e70213-c1f1-431f-9e1b-a9eeb72e5bfc" propName="Output" interval="PT3M" historyState="" nextValOfs="-1"> <n3:errMsg></n3:errMsg> <n3:vals> <n3:hv ts="2018-10-24T13:36:41.5929735Z"> <n4:v>12.1</n4:v> </n3:hv> <n3:hv ts="2018-10-24T13:39:41.8400876Z" gt="2018-10-24T13:45:41.6065127Z"> <n4:v>12</n4:v> </n3:hv> <n3:hv ts="2018-10-24T13:48:41.9350349Z"> <n4:v>12.1</n4:v> </n3:hv> </n3:vals> </n3:hist> </n2:p> </n2:pl> </n1:dpHistories> </n1:providerHistories> </n1:providerHistories> </data> </globalResponse>