Raw Data API
The Raw Data API queries raw data, such as a number of samples or the time range for a list of tags. If the count is not zero, then the API service returns the number of raw samples taken beginning from the start time. If the count is zero, then the service returns the raw samples taken between the start time and the end time.
METHOD: | GET, POST |
URI: |
|
SAMPLE GET URI: | Raw By Number Count value is a non-zero positive number, and end time is greater than start time. https://<historianservername>:8443/historian-rest-api/datapoints/raw/tagName1/2013-10-02T11:30:00.111Z/2013-10-02T11:31:11.111Z/0/100 https://<historianservername>:8443/historian-rest-api/datapoints/raw?tagNames=tagName1&start=2013-10-02T11:30:00.111Z&end=2013-10-02T11:31:11.111Z&count=100&direction=0 Raw By Time The count value equals 0. https://<historianservername>:8443/historian-rest-api/datapoints/raw/tagName1/2013-10-02T11:30:00.111Z/2013-10-02T11:31:11.111Z/0/0 https://<historianservername>:8443/historian-rest-api/datapoints/raw?tagNames=tagName1&start=2013-10-02T11:30:00.111Z&end=2013-10-02T11:31:11.111Z&count=0&direction=0 |
SAMPLE POST URI: | Raw By Number Count value is a non-zero positive number, and end time is greater than start time. https://<historianservername>:8443/historian-rest-api/datapoints/raw/2013-10-02T11:30:00.111Z/2013-10-02T11:31:11.111Z/0/100 https://<historianservername>:8443/historian-rest-api/datapoints/raw?start=2013-10-02T11:30:00.111Z&end=2013-10-02T11:31:11.111Z&count=100&direction=0 Raw By Time The count value equals 0. https://<historianservername>:8443/historian-rest-api/datapoints/raw/2013-10-02T11:30:00.111Z/2013-10-02T11:31:11.111Z/0/0 https://<historianservername>:8443/historian-rest-api/datapoints/raw?start=2013-10-02T11:30:00.111Z&end=2013-10-02T11:31:11.111Z&count=0&direction=0 |
SAMPLE cURL COMMAND (GET): [Raw By Number] | curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN> http://<nodename>:8443/ historian-rest-api/v1/ datapoints/raw/<tagName>/<start time>/<end time>/<direction>/<count> |
SAMPLE cURL COMMAND (GET): [Raw By Time] | curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN> http://<nodename>:8443/ historian-rest-api/v1/ datapoints/raw/<tagName>/<start time>/<end time>/<direction>/0 |
SAMPLE cURL COMMAND (POST): [Raw By Number] | curl ?X POST -i -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer <TOKEN> -d ?{\ ?tagNames\ ?:\ ?<tagName>;<tagName>\ ?} http:// <nodename>/ historian-rest-api/v1/ datapoints/raw/ <start time>/<end time>/<direction>/<count> |
SAMPLE cURL COMMAND (POST): [Raw By Time] | curl ?X POST -i -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer <TOKEN> -d ?{\ ?tagNames\ ?:\ ?<tagName>;<tagName>\ ?} http:// <nodename>/ historian-rest-api/v1/ datapoints/raw? start=<start time>&end=<end time>&direction=<direction>&count=<count> |
Query Parameters
Parameter | Description | Required? | Values |
---|---|---|---|
TagNames | Queries the specified tag names. | Yes | String |
Start | Start time of the query, in ISO data format (such as YYYY-MM-DDTHH:mm:ss.SSSZ). | Yes | DateTime |
End | End time of the query, in ISO data format (such as YYYY-MM-DDTHH:mm:ss.SSSZ). | Yes | DateTime |
Direction | Specifies the direction (Forward or Backward from the starting time) of data sampling from the archive. The default value is Forward (0). | Yes | Integer, with a value such as 0. |
Count | Count of archive values within each calculation interval. | Yes | Integer, with a value such as 100. |
Response Parameters
Parameter | Data Type | Required? | Description |
---|---|---|---|
ErrorCode | Integer | Yes | For example, 0. |
ErrorMessage | String | Yes | For example, NULL. |
Data | String | Yes | The object container for the following parameters:
|
Sample Response
{
"ErrorCode" : 0,
"ErrorMessage": null,
"Data":[{
"DataType":"DoubleFloat",
"ErrorCode":0,
"TagName":"TagName1",
"Samples":[ { "TimeStamp":"2013-10-02T11:30:00.111Z","Value":"34.26155","Quality":3 },
{ "TimeStamp":"2013-10-02T11:30:10.111Z", "Value":"37.26155", "Quality":3 },
{ "TimeStamp":"2013-10-02T11:31:00.111Z", "Value":"33.26155", "Quality":3 }
]
}]
}