Managing Tags

The Tags API
The Tags API retrieves the qualified tag name list by a given nameMask.
Note: URI format supports asterisks (*) and question marks (?).
METHOD GET
URI https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/tags/{nameMask}/{maxNumber}
SAMPLE URI https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/tags?nameMask=*&maxNumber=100
SAMPLE cURL COMMAND curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN>” https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/ historian-rest-api/v1/tags?nameMask=*&maxNumber=<Number_Of_Tags>
Table 1. Query Parameters
Parameter Description Required? Values
nameMask Tagmask that searches for all tags that match the mask and applies the remaining criteria to retrieve data. The mask can include wildcards, such as asterisks (*). Optional String
maxNumber Maximum tag number provides the limit while returning the results (0 by default). This means that for a query, if using 0, all tags are returned.

If a negative number is used, then 0 is used for the maxNumber.

If a positive number is used, then that number of tags is returned. In addition, an error number of +14 notifies the user that there are more than the requested number of tags in the system.

Optional Integer

0 by default

Table 2. Response Parameters
Parameter Data Type Required? Description
ErrorCode Number Yes For example, ErrorCode = 0, which means the operation was successful.
ErrorMessage String Yes For example, NULL.
tags String Yes Includes the following:
  • ALT_SENSOR
  • tagName1
  • tagName2
The 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:
GET
https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/datapoints/raw/{tagNames}/{start}/{end}/{direction}/{count}
POST
https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/datapoints/raw/{start}/{end}/{direction}/{count}
SAMPLE GET URI:

Raw By Number

Count value is a non-zero positive number, and end time is greater than start time.

https://<Azure-Load-Balancer-IP-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/100https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/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://<Azure-Load-Balancer-IP-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/0https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/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://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/datapoints/raw/2013-10-02T11:30:00.111Z/2013-10-02T11:31:11.111Z/0/100https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/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://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/datapoints/raw/2013-10-02T11:30:00.111Z/2013-10-02T11:31:11.111Z/0/0https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/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://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/ 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://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/ 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:// <Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>/ 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:// <Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>/ historian-rest-api/v1/ datapoints/raw? start=<start time>&end=<end time>&direction=<direction>&count=<count>
Table 3. 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.
Table 4. 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:
DataType
DoubleFloat, which stores decimal values up to 15 places.
ErrorCode
Value is 0, which means the operation was successful.
TagName
Example: TagName1.
Samples
Provides TimeStamp, Value and Quality for each sample. For example, TimeStamp = 2013-10-02T11:30:00.111Z, Value = 34.26155, and Quality = 3.
The Interpolated Data API

The Interpolated Data API queries interpolated values for a list of tags. If the start time equals the end time, the request returns one sample.

METHOD: GET, POST
URI:
GET
https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/datapoints/interpolated/{tagNames}/{start}/{end}/{count}/{intervalMs}
POST
https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/datapoints/interpolated/{start}/{end}/{count}/{intervalMs}
SAMPLE GET URI: https://<Azure-Load-Balancer-IP-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 POST URI: https://<Azure-Load-Balancer-IP-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 COMMAND (GET): curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN>” http://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/ historian-rest-api/v1/ datapoints/interpolated/<tagName>/<start time>/<end time>/<count>/<intervalMS>
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://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/ historian-rest-api/v1/ datapoints/interpolated/<start time>/<end time>/<count>/<intervalMS>
Table 5. Query Parameters
Parameter Description Required? Values
TagName Queries the tag names specified. 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
Count Count of archive values within each calculation interval. Yes Integer, with a value such as 100.
intervalMS Interval in milliseconds. Yes 64-bit signed integer, with a value such as 10000.
Table 6. 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:
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 = 2013-10-02T11:30:00.111Z, Value = 34.26155, and Quality = 3.
The 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 request returns one sample.

METHOD: GET, POST
URI:
GET
https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/datapoints/raw/{tagNames}/{start}/{end}/{direction}/{count}
POST
https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/datapoints/currentvalue
SAMPLE GET URI: https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/datapoints/currentvalue?tagNames=tagName1
SAMPLE POST URI: https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/datapoints/currentvalue
SAMPLE cURL COMMAND (GET): curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN>” http://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/ 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://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/ historian-rest-api/v1/ datapoints/currentvalue
Table 7. Query Parameters
Parameter Description Required? Values
TagNames Queries the specified tag names. Yes String
Table 8. 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:
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.
The Calculated Data API

The Calculated Data API queries the calculated data for a list of tags. Data can be requested using a number of samples or a time range for a list of tags. If the count is not zero, the service returns the number of raw samples beginning from the start time. If the count is zero, the services uses the interval, start time, and end time to calculate the required sample number.

METHOD: GET, POST
URI:
GET
https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/datapoints/calculated/{tagNames}/{start}/{end}/{calculationMode}/{count}/{intervalMs}
POST
https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/datapoints/calculated/{start}/{end}/{calculationMode}/{count}/{intervalMs}
SAMPLE GET URI:
Number of Samples
https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/datapoints/calculated/tagName1/2013-10-02T11:30:00.111Z/2013-10-02T11:31:11.111Z/1/100/1000
Time Range for List of Tags
https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/datapoints/calculated?tagNames=tagName1&start=2013-10-02T11:30:00.111Z&end=2013-10-02T11:31:11.111Z&count=100&calculationMode=1&intervalMs=1000
SAMPLE POST URI:
Number of Samples
https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/datapoints/calculated/2013-10-02T11:30:00.111Z/2013-10-02T11:31:11.111Z/1/100/1000
Time Range for List of Tags
https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/datapoints/calculated?start=2013-10-02T11:30:00.111Z&end=2013-10-02T11:31:11.111Z&count=100&calculationMode=1&intervalMs=1000
SAMPLE cURL COMMAND (GET): curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN>” http://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:8843/ historian-rest-api/v1/ datapoints/calculated/<tagName>/<start time>/<end time>/<count>/<calculation mode>/<intervalMS>
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://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:8843/ historian-rest-api/v1/ datapoints/calculated/<start time>/<end time>/<count>/<calculationmode>/<intervalMS>
Table 9. Query Parameters
Parameter Description Required? Values
TagNames GE identifier for a location. Yes 1000000106
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
Count Count of archive values within each calculation interval. Yes Integer, with a value such as 100.
Calculation Mode End time in milliseconds. Yes Integer, with a value such as 1.
IntervalMS Interval in milliseconds. 64-bit signed integer, with a value such as 1000.
Table 10. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, 0.
ErrorCode String Yes For example, NULL.
Data String Yes The 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 = 2013-10-02T11:30:00.111Z, Value = 34.26155, and Quality = 3.
The Sampled Data API
The Sampled Data API queries the sampled data for a list of tags. Data can be requested using a number of samples or a time range for a list of tags. If the count is not zero, the service returns the number of raw samples beginning from the start time. If the count is zero, the services uses the interval, start time, and end time to calculate the required sample number.
Note: For the query, you can also use optional parameters such as FilterMode and ReturnDataFields. Unused parameters can be omitted.
METHOD: GET, POST
URI:
GET
https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/datapoints/sampled
POST
https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/datapoints/sampled
SAMPLE GET URI: https://<Azure-Load-Balancer-IP-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 POST URI: https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/datapoints/sampled
SAMPLE cURL COMMAND (GET): curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN>” http://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/ historian-rest-api/v1/ datapoints/sampled/<tagName>/<start time>/<end time>/<direction>/<count>/<intervalMS>
SAMPLE cURL COMMAND (POST): curl -i –X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer <TOKEN>” -d “{ \”tagNames\”:\”<tagName>\”, \”start\”: \”<start>\”, \”end\”: \”<end>\”, \”samplingMode\”: <samplingMode>, \”calculationMode\”: <calculationMode>, \”direction\”: <direction>, \”count\”: <count>, \”returnDataFields\”: <returnDataFields>, \”intervalMs\”: <intervalMs>, \”queryModifier\”: <queryModifier>, \”filterMode\”: <filterMode>, \”filterExpression\”: \”<filterExpression>\”}” http://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/datapoints/sampled
Table 11. Query Parameters
Parameter Description Required? Values
TagNames Queries the tag names specified. 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
SamplingMode Also known as SamplingModeType. Optional Integer, with a value such as 1.
CalculationMode Also known as CalculationModeType. Optional Integer, with a value such as 1.
Direction Specifies the direction (Forward or Backward from the starting time) of data sampling from the archive. The default value is Forward (0). Optional Integer, with a value such as 0.
Count The count of archive values within each calculation interval. Optional Integer, with a value such as 0.
IntervalMS Interval in milliseconds. Optional 64-bit signed integer, with a value such as 1000.
Table 12. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, 0.
ErrorCode String Yes For example, NULL.
Data String Yes The 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 = 2013-10-02T11:30:00.111Z, Value = 34.26155, and Quality = 3.
The Trend Data API
The Trend Data API queries the trend data for a list of tags.
Note: For the query, you can also use optional parameters such as FilterMode and StatisticsItemFilter. Unused parameters can be omitted.
METHOD: GET, POST
URI:
GET
https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/datapoints/trend
POST
https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/datapoints/trend
SAMPLE GET URI:
https://<Azure-Load-Balancer-IP-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 POST URI: https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/datapoints/trend
SAMPLE cURL COMMAND (GET): curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN>” http://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/ historian-rest-api/v1/ datapoints/trend/<tagName>/<start time>/<end time>/<samplingMode>/<calculationMode>/<direction>/<count>/<intervalMS>
SAMPLE cURL COMMAND (POST): curl -i –X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer <TOKEN>” -d “{ \”tagNames\”:\”<tagName>\”, \”start\”: \”<start>\”, \”end\”: \”<end>\”, \”samplingMode\”: <samplingMode>, \”calculationMode\”: <calculationMode>, \”direction\”: <direction>, \”count\”: <count>, \”returnDataFields\”: <returnDataFields>, \”intervalMs\”: <intervalMs>, \”queryModifier\”: <queryModifier>, \”filterMode\”: <filterMode>, \”filterExpression\”: \”<filterExpression>\”}” http://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/datapoints/trend
Table 13. Query Parameters
Parameter Description Required? Values
TagNames Queries the tag names specified. 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
SamplingMode Also known as SamplingModeType. Optional Integer, with a value such as 1.
CalculationMode Also known as CalculationModeType. Optional Integer, with a value such as 1.
Direction Specifies the direction (Forward or Backward from the starting time) of data sampling from the archive. The default value is Forward (0). Optional Integer, with a value such as 0.
Count The count of archive values within each calculation interval. Optional Integer, with a value such as 0.
IntervalMS Interval in milliseconds. Optional 64-bit signed integer, with a value such as 1000.
Table 14. 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:
TagName
Name of the tag, such as ahistfile.Simulation00001.
TagSource
Location where tags are being searched for.
DataType
Float, which stores decimal values up to 6 places.
Trend
Provides TimeStamp, Value and Quality for each sample. For example, TimeStamp = 2016-03-15T04:53:17.000Z, Value = 170903.6563, and Quality = True.
The Add Single Tag API

For the Add Single Tag API, you can add a new tag to Historian, and the tag name and data type must be provided in the payload (parameter) of the method. All other tags are optional. If a property is provided, the respective validation is performed at the server end. If the tag exists, then any new properties provided in the payload are applied to the existing tag.

METHOD: POST
URI: https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/tags/addtag
SAMPLE DELETE URI:
https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/tags/addtag

Payload:

{
    "Name" : "SampleTag",
    "DataType" : 3
}
SAMPLE cURL COMMAND: curl -i -H "Accept: application/json" -i -H "Content-Type: application/json" -H "Authorization: Bearer <TOKEN>” -d “{ \”Name\”:\”Sampletag\”,\"DataType\":3}” -X POST https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/tags/addtag
Table 15. Query Parameters
Parameter Description Required? Values
Payload JSON array of PropertyName and PropertyValue. Yes. "Name" and "DataType" properties are required. All other properties are optional. Multidata types. See Payload Parameter for a list of tag properties used to update a tag configuration.
Sample Response
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, 0.
ErrorMessage String Yes For example, NULL.
The Add Bulk Tags API

For the Add Bulk Tags API, you can add new tags to Historian using an array, and the tag names and data types must be provided in the payload (parameter) of the method. All other tags are optional. If a property is provided, the respective validation is performed at the server end. If the tags exist, then any new properties provided in the payload are applied to the existing tags. The payload is be an array of tags defined.

METHOD: POST
URI: https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/tags/addtags
SAMPLE DELETE URI:
https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/tags/addtags

Payload:

[
{
    "Name" : "SampleTag1",
    "DataType" : 3
},
{
    "Name" : "SampleTag2",
    "DataType" : 3
}
]
SAMPLE cURL COMMAND: curl -i -H "Accept: application/json" -i -H "Content-Type: application/json" -H "Authorization: Bearer <TOKEN>” -d “[{ \”Name\”:\”Sampletag1\”}, { \”Name\”:\”Sampletag2\”}]” -X POST https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/tags/addtags
Table 16. Query Parameters
Parameter Description Required? Values
Payload JSON array tags with individual tags of PropertyName and PropertyValue. Yes. "Name" and "DataType" properties are required. All other properties are optional. Multidata types. See Payload Parameter for a list of tag properties used to update a tag configuration.
Table 17. Response Parameters
Parameter Data Type Exists? Description
TagName String Yes Tag name.
ErrorCode Integer Yes For example, 0.
ErrorMessage String Yes For example, NULL.
The Update Tag Configuration API

The Update Tag Configuration API allows you to set or modify any tag property values. You cannot, however, rename a tag using this API.

METHOD: PUT
URI: https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/tags/properties/tagName
SAMPLE DELETE URI:
https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/tags/properties/tagName

Payload:
{
    "PropertyName" : "PropertyValue"
}
SAMPLE cURL COMMAND: curl -i -H "Accept: application/json" -i -H "Content-Type: application/json" -H "Authorization: Bearer <TOKEN>” -d “{ \”Description\”:\”SampleDesc\”}” -X PUT https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/tags/properties/tagName
Table 18. Query Parameters
Parameter Description Required? Values
tagName Tag name for which properties need to be set or modified. Yes String
Payload JSON array of PropertyName and PropertyValue. At least one property must be provided. Multidata types. See Payload Parameter for a list of tag properties used to update a tag configuration.
Table 19. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, 0.
ErrorMessage String Yes For example, NULL.
The Get Tag Properties API

You can use this API to specify which properties are required for retrieval. If no property names are provided, then all properties are retrieved. When using the Get Tag Properties method, requesting a non-existent tag name returns an error.

METHOD: GET / POST
URI: (GET) https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/tags/properties/tagName

This URI returns all tag properties.

URI: (POST) https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/tags/properties/tagName
Payload

{
"PropertyName1" : 1,
"PropertyName2" : 1
}
SAMPLE GET URI: https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/tags/properties/tagName
SAMPLE POST URI:
https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/tags/properties/tagName

Payload:
{
    "Description" : 1
}
SAMPLE cURL GET COMMAND: curl -i -H "Accept: application/json" -i -H "Content-Type: application/json" -H "Authorization: Bearer <TOKEN>” -X GET https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/tags/properties/tagName
SAMPLE cURL POST COMMAND: curl -i -H "Accept: application/json" -i -H "Content-Type: application/json" -H "Authorization: Bearer <TOKEN>” -d “{ \”Description\”: 1}” -X POST https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/tags/properties/tagName
Table 20. Query Parameters
Parameter Description Required? Values
tagName Tag name for which properties need to be retrieved. Yes String
Payload JSON array of PropertyName and boolean (true/false). At least one property must be provided. Multi data types. See Payload Parameter for a list of tag properties used to update a tag configuration.
Note: The query payload contains all the tag properties you want returned from the server. In the Update Tag Config method, you need to provide the actual tag property value. However, in the Get Tag Properties method, you need to provide the property and a value of 1 (true), to allow it to be read from the server and returned.
Table 21. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, 0.
ErrorMessage String Yes For example, NULL.
Name String Optional If no error, then the tag name of query is returned and all requested parameters.
The Delete Tag API

The Delete Tag API provides the ability to delete an existing tag from the Historian server.

Its URI format supports question marks (?).

METHOD: DELETE
URI: https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/tags/tagName?{permanentDelete}
SAMPLE DELETE URI: https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/tags/tagName?permanentDelete=true
SAMPLE CURL COMMAND: curl -i -H "Authorization: Bearer <TOKEN>” -X DELETE https:// <Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/tags/tagName?permanentDelete=<true|false>
Table 22. Query Parameters
Parameter Description Required? Values
tagName Name of the tag to be deleted. Yes String
permanentDelete Deletes the tag permanently from the Historian server if the value passed in is true. If the parameter is not provided, then permanentDelete is assumed to be false. Optional (false is default) Boolean, true or false
Table 23. Response Parameters
Parameter Data Type Required? Description
ErrorCode Number Yes For example, ErrorCode=0, which means the operation was successful.
ErrorMessage String Yes For example, NULL.
The Query Results API

The Query Results API enables you to include the number of samples required, by providing an end point to configure query results.

The minimum number of samples should be 1000.
METHOD: PUT
URI: https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/datapoints/ configuration/{maxDataQueryResultSize}
SAMPLE URI: https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/datapoints/ configuration?maxDataQueryResultSize=6000
SAMPLE CURL COMMAND: curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN>” https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/ historian-rest-api/v1/datapoints/configuration? maxDataQueryResultSize=<Number_Of_Query_Results>
Table 24. Query Parameters
Parameter Description Required? Values
maxDataQueryResultSize Maximum samples that should be configured as part of Query Results Yes Integer

Maximum DataQueryResultSize set to 6000

The Tag Rename API
This API allows the administrator to rename tags.
METHOD: PUT
URI https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/tags/tagrename/oldtagname/newtagname?{truerename}
SAMPLE URI https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/tags/tagrename/GDW14NV2E.Simulation0000101/GDW14NV2E.Simulation0000101newname?truerename= <true | false>
SAMPLE CURL COMMAND curl -i -H "Accept: application/json" -i -H "Content-Type: application/json"-H "Authorization: Bearer <TOKEN> -X PUT https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/tags/tagrename/<oldtagname>/<newtagname>?truerename=<true | false>
Table 25. Query Parameters
Parameter Description Required? Values
oldtagname Tag which is to be renamed. Yes String
newtagname New name for the selected tag. Yes String
truerename Renames the tag permanently if the value entered is true.

Creates an alias if the value entered is false.

Optional (false is default) Boolean (true or false)
Table 26. Response Parameters
Parameter Data Type Required? Description
Error Code Integer Yes For example, 0.
Error Message String Yes For example, NULL.
Data List Yes Returns all the properties of the tag.
The Write Tag API
Write Tag Data API enables you to create data for tags. You can write data to a tag for different data types such as integer, float, array, multifield and so on. Once created, you can view the data using other end points. Only REST API Administrator and users with write permission can perform this operation.
Method POST
URI
https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api
                /v1/datapoints/create
SAMPLE URI
https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api   /v1/datapoints/create

   Payload

   {
   "TagName": "GDW14NV2E.Simulation00015",
   "samples": [
                {
                   
                "TimeStamp": "2019-09-17T15:58:00.000Z",
                   
                "Value":   "1",
                   
                "Quality": 3
                }
           ]  
   }
SAMPLE RESPONSE

{

"ErrorCode": 0,

"ErrorMessage": ""

}

SAMPLE CURL COMMAND

curl -i -H "Accept: application/json" -i -H "Content-Type: application/json" -H "Authorization: Bearer <TOKEN>” -d “{ \”TagName\”:\”GDW14NV2E.Simulation00015\”,\"samples\":[{\"TimeStamp\":\ "2019-09-17T15:58:00.000Z\",\"Value\": \"1\",\"Quality\": 3}]}” -X POST https://<Azure-Load-Balancer-IP-of-Proficy-Historian-for-Cloud>:9090/historian-rest-api/v1/datapoints/create

Table 27. Query Parameters
Parameter Description Required? Values
Payload JSON format of Property Name and Property Value. Yes Multi-data types. It can have integer, float, array, multifield data types.
Table 28. Response Parameters
Parameter Data Type Required? Description
Error Code Integer Yes For example, ErrorCode = 0, which means the operation was successful.
Error Message String Yes For example, NULL.