REST APIs for Managing Tag Data

This topic provides REST APIs that you can use to manage tags. You can add, access, modify, rename, and delete tags.

Before You Begin: Get an authorization token.
Table 1. Access Raw Data Using the GET Method
Parameter Value
Method GET
URI https://<NLB DNS of Proficy Historian for Cloud>:9090/historian-rest-api/v1/datapoints/raw/<tag names>/<start>/<end>/<direction>/<count>
Tip: To find the NLB DNS:
  1. Access the EKS cluster on which you have deployed Proficy Historian for AWS.
  2. Access the EC2 instance.
  3. In the navigation pane, under Load Balancing, select Load Balancers.
  4. Select the load balancer for which you want to find the DNS.
  5. In the Description section, copy the DNS name.
Authorization Bearer <token>
Content type application/json
Sample URI
  • Raw By Number: Retrieves data samples up to a specified number.

    https://<NLB DNS of Proficy Historian for Cloud>:9090/historian-rest-api/datapoints/raw/tagName1/2013-10-02T11:30:00.111Z/2013-10-02T11:31:11.111Z/0/100

  • Raw By Time: Retrieves data samples up to a specified time.

    https://<NLB DNS of Proficy Historian for Cloud>:9090/historian-rest-api/datapoints/raw/tagName1/2013-10-02T11:30:00.111Z/2013-10-02T11:31:11.111Z/0/0

Sample cURL commands
  • Raw By Number:

    curl -i -H "Accept: application/json" -H "Authorization: Bearer <token>http://<NLB DNS of Proficy Historian for Cloud>:9090/historian-rest-api/v1/datapoints/raw/<tag name>/<start time>/<end time>/<direction>/<count>

  • Raw By Time:

    curl -i -H "Accept: application/json" -H "Authorization: Bearer <token>http://<NLB DNS of Proficy Historian for Cloud>:9090/historian-rest-api/v1/datapoints/raw/<tag name>/<start time>/<end time>/<direction>/0

Query parameters
  • Tag names: The names of tags whose data you want to retrieve.
  • Start time: The time from which you want to retrieve data. Enter a value in the ISO date format (YYYY-MM-DDTHH:mm:ss.SSSZ).
  • End time: The time up to which you want to retrieve data. Enter a value in the ISO date format (YYYY-MM-DDTHH:mm:ss.SSSZ).
  • Direction: The direction (forward or backward) from the start time for which you want to retrieve data.
  • Count: The count of the data samples within each calculation interval.
Table 2. Access Raw Data Using the POST Method
Parameter Value
Method POST
URI https://<NLB DNS of Proficy Historian for Cloud>:9090/historian-rest-api/v1/datapoints/raw/<start>/<end>/<direction>/<count>
Authorization Bearer <token>
Content type application/json
Sample URI
  • Raw By Number: Retrieves data samples up to a specified number.

    https://<NLB DNS of Proficy Historian for Cloud>:9090/historian-rest-api/datapoints/raw/2013-10-02T11:30:00.111Z/2013-10-02T11:31:11.111Z/0/100

  • Raw By Time: Retrieves data samples up to a specified time.

    https://<NLB DNS of Proficy Historian for Cloud>:9090/historian-rest-api/datapoints/raw/2013-10-02T11:30:00.111Z/2013-10-02T11:31:11.111Z/0/0

Sample cURL commands
  • Raw By Number:

    curl X POST -i -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer <token>-d {\tagNames\:\<tag name>;<tag name>\}http://<NLB DNS of Proficy Historian for Cloud>/historian-rest-api/v1/datapoints/raw/<tag name><start time>/<end time>/<direction>/<count>

  • Raw By Time:

    curl X POST -i -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer <token>-d {\tagNames\:\<tag name>;<tag name>\}http://<NLB DNS of Proficy Historian for Cloud>/historian-rest-api/v1/ datapoints/raw?start=<start time>&end=<end time>&direction=<direction>&count=<count>

Query parameters
  • Tag names: The names of tags whose data you want to retrieve.
  • Start time: The time from which you want to retrieve data. Enter a value in the ISO date format (YYYY-MM-DDTHH:mm:ss.SSSZ).
  • End time: The time up to which you want to retrieve data. Enter a value in the ISO date format (YYYY-MM-DDTHH:mm:ss.SSSZ).
  • Direction: The direction (forward or backward) from the start time for which you want to retrieve data.
  • Count: The count of the data samples within each calculation interval.
Body
{
     "ErrorCode" : 0,
     "ErrorMessage": null,
     "Data":[{
      "DataType":"<value>",
      "ErrorCode":0,
      "TagName":"<value>",
      "Samples":
        [ 
          { "TimeStamp":"<value>","Value":"<value>","Quality":<value> },
          { "TimeStamp":"<value>","Value":"<value>","Quality":<value> }, 
          { "TimeStamp":"<value>","Value":"<value>","Quality":<value> }
        ]
     }]
}
Example
{
     "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 }
        ]
     }]
}
Table 3. Access Interpolated Data
Parameter Value
Method GET
URI https://<NLB DNS of Proficy Historian for Cloud>:9090/historian-rest-api/v1/datapoints/interpolated/<start>/<end>/<count>/<interval in milliseonds>
Authorization Bearer <token>
Content type application/json
Sample URI https://<NLB DNS of Proficy Historian for Cloud>:9090/historian-rest-api/v1/datapoints/interpolated/tagName1/2013-10-02T11:30:00.111111Z/2013-10-02T11:31:11.111Z/100/10000
Sample cURL commands curl -i -H "Accept: application/json" -H "Authorization: Bearer <token>http://<NLB DNS of Proficy Historian for Cloud>:9090/ historian-rest-api/v1/datapoints/interpolated/<tag name>/<start time>/<end time>/<count>/<interval in milliseconds>
Query parameters
  • Tag names: The names of tags whose data you want to retrieve.
  • Start time: The time from which you want to retrieve data. Enter a value in the ISO date format (YYYY-MM-DDTHH:mm:ss.SSSZ).
  • End time: The time up to which you want to retrieve data. Enter a value in the ISO date format (YYYY-MM-DDTHH:mm:ss.SSSZ).
  • Interval: The interval in milliseconds.
  • Count: The count of the data samples within each calculation interval.
Body
{
     "ErrorCode" : 0,
     "ErrorMessage": null,
     "Data":[{
      "DataType":"<value>",
      "ErrorCode":0,
      "TagName":"<value>",
      "Samples":
        [ 
          { "TimeStamp":"<value>","Value":"<value>","Quality":<value> },
          { "TimeStamp":"<value>","Value":"<value>","Quality":<value> }, 
          { "TimeStamp":"<value>","Value":"<value>","Quality":<value> }
        ]
     }]
}
Example
{
     "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 }
        ]
     }]
}
Table 4. Update Interpolated Data
Parameter Value
Method POST
URI https://<NLB DNS of Proficy Historian for Cloud>:9090/historian-rest-api/v1/datapoints/interpolated/<start>/<end>/<count>/<interval in milliseonds>
Authorization Bearer <token>
Content type application/json
Sample URI https://<NLB DNS of Proficy Historian for Cloud>:9090/historian-rest-api/v1/datapoints/interpolated/2013-10-02T11:30:00.111111Z/2013-10-02T11:31:11.111Z/100/10000
Sample cURL commands curl -i -H "Accept: application/json" -H "Authorization: Bearer <token>http://<NLB DNS of Proficy Historian for Cloud>:9090/ historian-rest-api/v1/datapoints/interpolated/<start time>/<end time>/<count>/<interval in milliseconds>
Query parameters
  • Tag names: The names of tags whose data you want to retrieve.
  • Start time: The time from which you want to retrieve data. Enter a value in the ISO date format (YYYY-MM-DDTHH:mm:ss.SSSZ).
  • End time: The time up to which you want to retrieve data. Enter a value in the ISO date format (YYYY-MM-DDTHH:mm:ss.SSSZ).
  • Interval: The interval in milliseconds.
  • Count: The count of the data samples within each calculation interval.
Body
{
     "ErrorCode" : 0,
     "ErrorMessage": null,
     "Data":[{
      "DataType":"<value>",
      "ErrorCode":0,
      "TagName":"<value>",
      "Samples":
        [ 
          { "TimeStamp":"<value>","Value":"<value>","Quality":<value> },
          { "TimeStamp":"<value>","Value":"<value>","Quality":<value> }, 
          { "TimeStamp":"<value>","Value":"<value>","Quality":<value> }
        ]
     }]
}
Example
{
     "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 }
        ]
     }]
}
Table 5. Access Current Data
Parameter Value
Method GET
URI https://<NLB DNS of Proficy Historian for Cloud>:9090/historian-rest-api/v1/datapoints/currentvalue
Authorization Bearer <token>
Content type application/json
Sample URI https://<NLB DNS of Proficy Historian for Cloud>:9090/historian-rest-api/v1/datapoints/currentvalue?tagNames=tagName1
Sample cURL commands curl -i -H "Accept: application/json" -H "Authorization: Bearer <token>http://<NLB DNS of Proficy Historian for Cloud>:9090/ historian-rest-api/v1/datapoints/currentvalue/<tag name>
Query parameters Tag names: The names of tags whose data you want to retrieve.
Body
{
     "ErrorCode" : 0,
     "ErrorMessage": null,
     "Data":[{
      "DataType":"DoubleFloat",
      "ErrorCode":0,
      "TagName":"TagName1",
      "Samples":[ { "TimeStamp":"<value>","Value":"<value>","Quality":<value> } ]
      }]
}
Example
{
     "ErrorCode" : 0,
     "ErrorMessage": null,
     "Data":[{
      "DataType":"DoubleFloat",
      "ErrorCode":0,
      "TagName":"TagName1",
      "Samples":[ { "TimeStamp":"2014-01-01T12:00:00Z","Value":"34.26155","Quality":3 } ]
      }]
}
Table 6. Update Current Data
Parameter Value
Method POST
URI https://<NLB DNS of Proficy Historian for Cloud>:9090/historian-rest-api/v1/datapoints/currentvalue
Authorization Bearer <token>
Content type application/json
Sample URI https://<NLB DNS of Proficy Historian for Cloud>:9090/historian-rest-api/v1/datapoints/currentvalue
Sample cURL command curl -i X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer <token>-d {\tagNames\:\<tag name>\}http://<NLB DNS of Proficy Historian for Cloud>:9090/historian-rest-api/v1/datapoints/currentvalue
Query parameters Tag names: The names of tags whose data you want to retrieve.
Body
{
     "ErrorCode" : 0,
     "ErrorMessage": null,
     "Data":[{
      "DataType":"<value>",
      "ErrorCode":0,
      "TagName":"<value>",
      "Samples":
        [ 
          { "TimeStamp":"<value>","Value":"<value>","Quality":<value> },
          { "TimeStamp":"<value>","Value":"<value>","Quality":<value> }, 
          { "TimeStamp":"<value>","Value":"<value>","Quality":<value> }
        ]
     }]
}
Example
{
     "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 }
        ]
     }]
}
Table 7. Access Sampled Data
Parameter Value
Method GET
URI https://<NLB DNS of Proficy Historian for Cloud>:9090/historian-rest-api/v1/datapoints/sampled/<tag names>/<start time>/<end time>/<direction>/<count>/<interval>
Authorization Bearer <token>
Content type application/json
Sample URI https://<NLB DNS of Proficy Historian for Cloud>:9090/historian-rest-api/v1/datapoints/sampled?tagNames=tagName1&start=2013-10-02T11:30:00.111Z&end=2013-10-02T11:31:11.111Z&samplingMode=1&calculationMode=1&direction=0&count=0&intervalMs=1000
Sample cURL commands curl -i -H "Accept: application/json" -H "Authorization: Bearer <token>http://<NLB DNS of Proficy Historian for Cloud>:8843/historian-rest-api/v1/datapoints/sampled/<tag name>/<start time>/<end time>/<direction>/<count>/<interval>
Query parameters
  • Tag names: The names of tags whose data you want to retrieve.
  • Start time: The time from which you want to retrieve data. Enter a value in the ISO date format (YYYY-MM-DDTHH:mm:ss.SSSZ).
  • End time: The time up to which you want to retrieve data. Enter a value in the ISO date format (YYYY-MM-DDTHH:mm:ss.SSSZ).
  • Interval: The interval in milliseconds.
  • Direction: The direction (forward or backward) from the start time for which you want to retrieve data.
  • Count: The count of the data samples within each calculation interval.
Body
{
     "ErrorCode" : 0,
     "ErrorMessage": null,
     "Data":[{
      "DataType":"DoubleFloat",
      "ErrorCode":0,
      "TagName":"TagName1",
      "Samples":[ { "TimeStamp":"<value>","Value":"<value>","Quality":<value> } ]
      }]
}
Example
{
     "ErrorCode" : 0,
     "ErrorMessage": null,
     "Data":[{
      "DataType":"DoubleFloat",
      "ErrorCode":0,
      "TagName":"TagName1",
      "Samples":[ { "TimeStamp":"2014-01-01T12:00:00Z","Value":"34.26155","Quality":3 } ]
      }]
}
Table 8. Update Sampled Data
Parameter Value
Method POST
URI https://<NLB DNS of Proficy Historian for Cloud>:9090/historian-rest-api/v1/datapoints/sampled/<tag names>/<start time>/<end time>/<direction>/<count>/<interval>
Authorization Bearer <token>
Content type application/json
Sample URI https://<NLB DNS of Proficy Historian for Cloud>:9090/historian-rest-api/v1/datapoints/sampled?tagNames=tagName1&start=2013-10-02T11:30:00.111Z&end=2013-10-02T11:31:11.111Z&samplingMode=1&calculationMode=1&direction=0&count=0&intervalMs=1000
Sample cURL command curl -i X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer <token>-d { \tagNames\:\<value>\, \start\: \<value>\, \end\: \<value>\, \samplingMode\: <value>, \calculationMode\: <value>, \direction\: <value>, \count\: <value>, \returnDataFields\: <value>, \intervalMs\: <value>, \queryModifier\: <value>, \filterMode\: <value>, \filterExpression\: \<value>\}http://<NLB DNS of Proficy Historian for Cloud>:9090/historian-rest-api/v1/datapoints/sampled
Query parameters
  • Tag names: The names of tags whose data you want to retrieve.
  • Start time: The time from which you want to retrieve data. Enter a value in the ISO date format (YYYY-MM-DDTHH:mm:ss.SSSZ).
  • End time: The time up to which you want to retrieve data. Enter a value in the ISO date format (YYYY-MM-DDTHH:mm:ss.SSSZ).
  • Interval: The interval in milliseconds.
  • Sampling mode: The sampling mode using which you want to retrieve data.
  • Direction: The direction (forward or backward) from the start time for which you want to retrieve data.
  • Count: The count of the data samples within each calculation interval.
Body
{
     "ErrorCode" : 0,
     "ErrorMessage": null,
     "Data":[{
      "DataType":"<value>",
      "ErrorCode":0,
      "TagName":"<value>",
      "Samples":
        [ 
          { "TimeStamp":"<value>","Value":"<value>","Quality":<value> },
          { "TimeStamp":"<value>","Value":"<value>","Quality":<value> }, 
          { "TimeStamp":"<value>","Value":"<value>","Quality":<value> }
        ]
     }]
}
Example
{
     "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 }
        ]
     }]
}
Table 9. Access Trend Data
Parameter Value
Method GET
URI https://<NLB DNS of Proficy Historian for Cloud>:9090/historian-rest-api/v1/datapoints/trend/<tag names>/<start time>/<end time>/<direction>/<count>/<interval>
Authorization Bearer <token>
Content type application/json
Sample URI https://<NLB DNS of Proficy Historian for Cloud>:9090/historian-rest-api/v1/datapoints/trend?tagNames=tagName1&start=2013-10-02T11:30:00.111Z&end=2013-10-02T11:31:11.111Z&samplingMode=1&calculationMode=1&direction=0&count=0&intervalMs=1000
Sample cURL commands curl -i -H "Accept: application/json" -H "Authorization: Bearer <token>http://<NLB DNS of Proficy Historian for Cloud>:8843/historian-rest-api/v1/datapoints/trend/<tag name>/<start time>/<end time>/<direction>/<count>/<interval>
Query parameters
  • Tag names: The names of tags whose data you want to retrieve.
  • Start time: The time from which you want to retrieve data. Enter a value in the ISO date format (YYYY-MM-DDTHH:mm:ss.SSSZ).
  • End time: The time up to which you want to retrieve data. Enter a value in the ISO date format (YYYY-MM-DDTHH:mm:ss.SSSZ).
  • Sampling mode: The sampling mode that you want to use to retrieve data.
  • Calculation mode: The calculation mode that you want to use to retrieve data.
  • Interval: The interval in milliseconds.
  • Direction: The direction (forward or backward) from the start time for which you want to retrieve data.
  • Count: The count of the data samples within each calculation interval.
Body
{
     "ErrorCode" : 0,
     "ErrorMessage": null,
     "Data":[{
      "DataType":"DoubleFloat",
      "ErrorCode":0,
      "TagName":"TagName1",
      "Trend":[ { "TimeStamp":"<value>","Value":"<value>","Quality":<value> } ]
      }]
}
Example
{
     "ErrorCode" : 0,
     "ErrorMessage": null,
     "Data":[{
      "DataType":"DoubleFloat",
      "ErrorCode":0,
      "TagName":"TagName1",
      "Trend":[ { "TimeStamp":"2014-01-01T12:00:00Z","Value":"34.26155","Quality":3 } ]
      }]
}
Table 10. Update Sampled Data
Parameter Value
Method POST
URI https://<NLB DNS of Proficy Historian for Cloud>:9090/historian-rest-api/v1/datapoints/trend/<tag names>/<start time>/<end time>/<direction>/<count>/<interval>
Authorization Bearer <token>
Content type application/json
Sample URI https://<NLB DNS of Proficy Historian for Cloud>:9090/historian-rest-api/v1/datapoints/trend?tagNames=tagName1&start=2013-10-02T11:30:00.111Z&end=2013-10-02T11:31:11.111Z&samplingMode=1&calculationMode=1&direction=0&count=0&intervalMs=1000
Sample cURL command curl -i X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer <token>-d { \tagNames\:\<value>\, \start\: \<value>\, \end\: \<value>\, \trend\: <value>, \calculationMode\: <value>, \direction\: <value>, \count\: <value>, \returnDataFields\: <value>, \intervalMs\: <value>, \queryModifier\: <value>, \filterMode\: <value>, \filterExpression\: \<value>\}http://<NLB DNS of Proficy Historian for Cloud>:9090/historian-rest-api/v1/datapoints/sampled
Query parameters
  • Tag names: The names of tags whose data you want to retrieve.
  • Start time: The time from which you want to retrieve data. Enter a value in the ISO date format (YYYY-MM-DDTHH:mm:ss.SSSZ).
  • End time: The time up to which you want to retrieve data. Enter a value in the ISO date format (YYYY-MM-DDTHH:mm:ss.SSSZ).
  • Interval: The interval in milliseconds.
  • Sampling mode: The sampling mode using which you want to retrieve data.
  • Calculation mode: The calculation mode using which you want to retrieve data.
  • Direction: The direction (forward or backward) from the start time for which you want to retrieve data.
  • Count: The count of the data samples within each calculation interval.
Body
{
     "ErrorCode" : 0,
     "ErrorMessage": null,
     "Data":[{
      "DataType":"<value>",
      "ErrorCode":0,
      "TagName":"<value>",
      "Samples":
        [ 
          { "TimeStamp":"<value>","Value":"<value>","Quality":<value> },
          { "TimeStamp":"<value>","Value":"<value>","Quality":<value> }, 
          { "TimeStamp":"<value>","Value":"<value>","Quality":<value> }
        ]
     }]
}
Example
{
     "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 }
        ]
     }]
}
Table 11. Limit Query Results
Parameter Value
Method GET
URI https://<NLB DNS of Proficy Historian for Cloud>:9090/historian-rest-api/v1/datapoints/configuration/maxDataQueryResultSize=<value>

The minimum number of query result size to enter is 1000.

Authorization Bearer <token>
Content type application/json
Sample URI https://<NLB DNS of Proficy Historian for Cloud>:9090/historian-rest-api/v1/datapoints/configuration/maxDataQueryResultSize=6000
Sample cURL commands curl -i -H "Accept: application/json" -H "Authorization: Bearer <token>https://<NLB DNS of Proficy Historian for Cloud>:9090/ historian-rest-api/v1/datapoints/configuration?maxDataQueryResultSize=<value>
Query parameters maxDataQueryResultSize: The maximum number of query results that you want to retrieve.