Current Value API

The Current Value API queries the current value data and reads the current values for a list of tags. If the start time is equal to end time, the requiest returns one sample.

METHOD:GET, POST
URI:
GET
https://<historianservername>:8443/historian-rest-api/v1/datapoints/raw/{tagNames}/{start}/{end}/{direction}/{count}
POST
https://<historianservername>:8443/historian-rest-api/v1/datapoints/currentvalue
SAMPLE GET URI:https://<historianservername>:8443/historian-rest-api/v1/datapoints/currentvalue?tagNames=tagName1
SAMPLE POST URI:https://<historianservername>:8443/historian-rest-api/v1/datapoints/currentvalue
SAMPLE cURL COMMAND (GET):curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN> http://<nodename>:8443/ historian-rest-api/v1/ datapoints/currentvalue/<tagName>
SAMPLE cURL COMMAND (POST):curl -i ?X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer <TOKEN> -d ?{\ ?tagNames\ ?:\ ?<tagName>\ ?} http://<nodename>:8443/ historian-rest-api/v1/ datapoints/currentvalue

Query Parameters

ParameterDescriptionRequired?Values
TagNamesQueries the specified tag names.YesString

Response Parameters

ParameterData TypeRequired?Description
ErrorCodeIntegerYesFor example, 0.
ErrorMessageStringYesFor example, NULL.
DataStringYesThe object container for the following parameters:
DataType
DoubleFloat, which stores decimal values up to 15 places.
ErrorCode
Value is 0, which means the operation was successful.
TagName
Example is TagName1.
Samples
Provides TimeStamp, Value and Quality for each sample. For example, TimeStamp = 2014-01-01T12:00:00Z, Value = 34.26155, and Quality = 3.

Sample Response

{
     "ErrorCode" : 0,
     "ErrorMessage": null,
     "Data":[{
      "DataType":"DoubleFloat",
      "ErrorCode":0,
      "TagName":"TagName1",
      "Samples":[ { "TimeStamp":"2014-01-01T12:00:00Z","Value":"34.26155","Quality":3 } ]
      }]
}