Web API

Estimated reading: 4 minutes 929 views

SCADACore Live provides IoT / SCADA API for Data Analytics Platforms to retrieve collected data through a secure connection.

For admin setup see https://support.scadacore.com/docs/admin-live/web-api-setup/

Web HTTPS get functions

The GetLocationAPIs provides the users with the IDs needed to access the data APIs

https://scdataapi.scadacore.com/api/data/GetLocationAPIs?apiKey=<API Key Here>

Output will provide the user with Location Names and Cooresponding Details Page IDs. The Details Page IDs will be used to retrieve realtime and historical data.

{“Success”:true,”StatusMessage”:null,”Locations”:[
{“LocationName”:”Building 4″,”APIDetails”:[{“APIDetailName”:”Daily”,”APIDetailID”:”8f575eaa-bb12-4289-91a8-f40b93ff811c”},{“APIDetailName”:”SensorData”,”APIDetailID”:”36a29280-66bf-45e2-9e2c-82c42a05faea”},{“APIDetailName”:”Instant”,”APIDetailID”:”0b527b3e-4f42-4e37-9c76-c6a2db284c33″}]},
{“LocationName”:”Building 3″,”APIDetails”:[{“APIDetailName”:”Instant”,”APIDetailID”:”600abefa-ea5d-4f3f-8fc4-aa6d70db64d2″},{“APIDetailName”:”Daily”,”APIDetailID”:”5be5e419-e45d-4925-ab68-9af939909291″}]},
{“LocationName”:”Building 1″,”APIDetails”:[{“APIDetailName”:”Daily”,”APIDetailID”:”0a6fe1a5-d398-47cf-a99a-cdaad38452c8″},{“APIDetailName”:”Instant”,”APIDetailID”:”f646ec72-ef28-49d3-9d4c-e983de8f0208″}]},
{“LocationName”:”Building 2″,”APIDetails”:[{“APIDetailName”:”Instant”,”APIDetailID”:”ef91e615-640e-4534-9340-be7acfdb40b0″},{“APIDetailName”:”Daily”,”APIDetailID”:”ef91e615-640e-4534-9340-be7acfdb40b0″}]}]}

Latest Data

For example if you wanted the Instant data for  102/12-04-046-17W4/00 you would look up the APIDetailID: 9cbba9b5-90a1-4c8a-b4f9-fa9c91babc29

Then get latest record below will allow you to grab all the latest records using the API key:

https://scdataapi.scadacore.com/api/data/GetLatestRecordByAPIDetailsID?APIDetailID=8f575eaa-bb12-4289-91a8-f40b93ff811c&apiKey=<Your API Key Here>

Resulting data will provide timestamp, sensor, and units:

{"Success":true,"StatusMessage":null,"APIDetailReportModels":[{"APIDetailName":"Instant","LocationName":"Building 1","APIDetailReportRecords":[{"UTCTimeStamp":1657031044,"LocalTimeStamp":1657013044,"LocalDateTime":"2022-07-05T09:24:04CDT","APIDetailSensorRecords":[{"SensorID":"01012286-90d4-4024-bc96-ba8db86dcabc","SensorName":"Temperature","SensorValue":"93.21","UnitOfMeasure":"F"},{"SensorID":"c274778d-8bae-4dee-aeb6-55b753c98917","SensorName":"TDay Flow","SensorValue":"312.41","UnitOfMeasure":"mcf"},{"SensorID":"fe75e08d-1c28-4c72-843f-f27187b069d5","SensorName":"Static Pressure","SensorValue":"75.67","UnitOfMeasure":"psi"},{"SensorID":"d781c2be-f549-4b62-8a65-069f9c1fe8e4","SensorName":"Orifice Plate","SensorValue":"1.12","UnitOfMeasure":"in"},{"SensorID":"3124ebf7-a5f8-4db9-8ff4-74f793f10885","SensorName":"Flow Rate","SensorValue":"686.75","UnitOfMeasure":"mcf/day"},{"SensorID":"3b7b6f9a-f254-47aa-bd00-75dfce46d64a","SensorName":"Differential Pressure","SensorValue":"122.61","UnitOfMeasure":"InH2O"},{"SensorID":"fcfe08cf-1b14-4d0b-8ca8-6ae7b4ca4335","SensorName":"Battery","SensorValue":"12.65","UnitOfMeasure":"V"}]}]}]}

Historical Data Poll

For historical records you can use this call:

https://scdataapi.scadacore.com/api/data/GetLatestRecordByAPIDetailsID?APIDetailID=36a29280-66bf-45e2-9e2c-82c42a05faea&StartDate=1644269618&EndDate=1644356018&apiKey=<Your API Key Here>

The start Date and End Date are EPOCH time (in seconds)

https://www.epochconverter.com/

The result would be similar to this:

{"Success":true,"StatusMessage":null,"APIDetailReportModels":[{"APIDetailName":"Instant","LocationName":"Building 1","APIDetailReportRecords":[{"UTCTimeStamp":1657031044,"LocalTimeStamp":1657013044,"LocalDateTime":"2022-07-05T09:24:04CDT","APIDetailSensorRecords":[{"SensorID":"01012286-90d4-4024-bc96-ba8db86dcabc","SensorName":"Temperature","SensorValue":"93.21","UnitOfMeasure":"F"},{"SensorID":"c274778d-8bae-4dee-aeb6-55b753c98917","SensorName":"TDay Flow","SensorValue":"312.41","UnitOfMeasure":"mcf"},{"SensorID":"fe75e08d-1c28-4c72-843f-f27187b069d5","SensorName":"Static Pressure","SensorValue":"75.67","UnitOfMeasure":"psi"},{"SensorID":"d781c2be-f549-4b62-8a65-069f9c1fe8e4","SensorName":"Orifice Plate","SensorValue":"1.12","UnitOfMeasure":"in"},{"SensorID":"3124ebf7-a5f8-4db9-8ff4-74f793f10885","SensorName":"Flow Rate","SensorValue":"686.75","UnitOfMeasure":"mcf/day"},{"SensorID":"3b7b6f9a-f254-47aa-bd00-75dfce46d64a","SensorName":"Differential Pressure","SensorValue":"122.61","UnitOfMeasure":"InH2O"},{"SensorID":"fcfe08cf-1b14-4d0b-8ca8-6ae7b4ca4335","SensorName":"Battery","SensorValue":"12.65","UnitOfMeasure":"V"}]}]}]}

Leave a Comment

Share this Doc

Web API

Or copy link

CONTENTS