Historian REST APIs

Overview of the Historian REST APIs

Historian provides REST APIs to manage Historian systems, collectors, data stores, and tags. In addition, it provides APIs to install and manage collector instances.
Important: Port 8443 is used in examples and sample code. If you copy and paste the sample code from Help, you must change this port to your installed port.

Managing Systems

The Get DHS Machines API
Using the Get DHS Machines API, you can view the list of DHS machines in a location.
METHOD GET
URI
https://<historianservername>/historian-rest-api/v1/dhsmachines?storageName=
SAMPLE QUERY PARAM GET URL
https://<historianservername>/historian-rest-api/v1/dhsmachines?storageName=xx
SAMPLE RESPONSE
{

    "ErrorCode": 0,

    "ErrorMessage": null,

    "Data": [

        {

            "NodeName": "xyz",

            "IsAlreadyAdded": true

        }

    ]

}

 }
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN> 
https://<historianservername>/historian-rest-api/v1/dhsmachines?storageName=xxx
Table 1. Query Parameters
Parameter Description Required? Values
storageName The value of the location whose DHS machines you want to view. Yes String
Table 2. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
The Get DHS Services API
Using the Get DHS Services API, you can view the list of DHS services in a data store.
METHOD GET
URI
https://<historianservername>/historian-rest-api/v1/dhsservices?dHSServiceMask=&withReason=false
SAMPLE QUERY PARAM GET URL
https://<historianservername>/historian-rest-api/v1/dhsservices?dHSServiceMask =*&withReason=false
SAMPLE RESPONSE
{

    "ErrorCode": 0,

    "ErrorMessage": null,

    "Data": [

        {

            "LogicalName": "ConfigManager_NPI212611749M1",

            "NodeName": "NPI212611749M1",

            "ServiceType": 4,

            "Status": 1,

            "TCPPort": 14002

        },

        {

            "LogicalName": "DataArchiver_NPI212611749M1",

            "NodeName": "NPI212611749M1",

            "ServiceType": 2,

            "Status": 1,

            "TCPPort": 14001

        },

        {

            "LogicalName": "ClientManager_NPI212611749M1",

            "NodeName": "NPI212611749M1",

            "ServiceType": 3,

            "Status": 1,

            "TCPPort": 14000

        },

        {

            "LogicalName": "DiagnosticsManager_NPI212611749M1",

            "NodeName": "NPI212611749M1",

            "ServiceType": 5,

            "Status": 1,

            "TCPPort": 14003

        },

        {

            "LogicalName": "DataArchiver_distmachine2",

            "NodeName": "distmachine2",

            "ServiceType": 2,

            "Status": 0,

            "TCPPort": 14001

        },

        {

            "LogicalName": "DataArchiver_distmachine1",

            "NodeName": "distmachine1",

            "ServiceType": 2,

            "Status": 1,

            "TCPPort": 14001

        },

        {

            "LogicalName": "ClientManager_distmachine1",

            "NodeName": "distmachine1",

            "ServiceType": 3,

            "Status": 1,

            "TCPPort": 14000

        },

        {

            "LogicalName": "DiagnosticsManager_distmachine1",

            "NodeName": "distmachine1",

            "ServiceType": 5,

            "Status": 0,

            "TCPPort": 14003

        }

    ]

}

 }
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN> 
https://<historianservername>/historian-rest-api/v1/dhsservices?dHSServiceMask=*&withReason=false
Table 3. Query Parameters
Parameter Description Required? Values
withReason Indicates whether the reason must be retrieved in the API response. Yes Boolean
dHSServiceMask The value of the DHS service mask. Yes String
Table 4. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
The Get Server Properties API
Using the Get Server Properties API, you can view the list of properties of a server.
METHOD GET
URI
https://<historianservername>/historian-rest-api/v1/serverproperties
SAMPLE QUERY PARAM GET URL
https://<historianservername>/historian-rest-api/v1/serverproperties
SAMPLE RESPONSE
{

    "ErrorCode": 0,

    "ErrorMessage": null,

    "Data": {

        "Storages": [

            {

                "StorageName": "System Storage",

                "StorageType": 2,

                "NumberOfDataStores": 1,

                "NumberOfArchivers": 0,

                "DataStores": [

                    "System"

                ],

                "Id": "861C2743-72E0-46FC-9B31-90E28CC39B8D",

                "IsDefault": false,

                "LastModifiedUser": null,

                "LastModifiedTime": "1970-01-01T00:00:00.000Z",

                "ArchiverServices": []

            },

            {

                "StorageName": "xyz",

                "StorageType": 0,

                "NumberOfDataStores": 3,

                "NumberOfArchivers": 1,

                "DataStores": [

                    "ScadaBuffer",

                    "DHSSystem",

                    "User"

                ],

                "Id": "5F267DF3-879A-4222-8A0E-D31EDEA83C14",

                "IsDefault": true,

                "LastModifiedUser": null,

                "LastModifiedTime": "1970-01-01T00:00:00.000Z",

                "ArchiverServices": [

                    {

                        "LogicalName": "DataArchiver_xyz",

                        "NodeName": "xyz",

                        "ServiceType": 2,

                        "IsAlreadyAdded": true,

                        "TCPPort": 14001

                    }

                ]

            }

        ],

        "Servers": [

            {

                "LogicalName": "DataArchiver_xyz0",

                "NodeName": "xyz",

                "ServiceType": 2,

                "Status": 1,

                "TCPPort": 14001,

                "MemoryVMSize": "4778",

                "TotalFailedWrites": "0",

                "WriteCacheHitRatio": "0.748",

                "TotalOutOfOrder": "3",

                "CompressionRatio": "0.321",

                "ReadQueueSize": "0",

                "WriteQueueSize": "0",

                "MsgQueueSize": "0",

                "ReadQueueProcessingRate": "1",

                "WriteQueueProcessingRate": "31",

                "MsgQueueProcessingRate": "0"

            }

        ]

    }

}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN> 
https://<historianservername>/historian-rest-api/v1/serverproperties
Table 5. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
The Get System Statistics API
Using the Get System Statistics API, you can view the statistics of a system.
METHOD GET
URI
https://<historianservername>/historian-rest-api/v1/systemstats
SAMPLE QUERY PARAM GET URL
https://<historianservername>/historian-rest-api/v1/systemstats
SAMPLE RESPONSE
{

    "ErrorCode": 0,

    "ErrorMessage": null,

    "Data": {

        "Utilization": {

            "WriteCacheHitRatio": "0.499",

            "SpaceConsumptionRate": "",

            "CompressionRatio": "0.199",

            "ReadQueueSize": "0",

            "WriteQueueSize": "0",

            "MsgQueueSize": "0",

            "ReadQueueProcessRate": "3",

            "WriteQueueProcessRate": "0",

            "MsgQueueProcessRate": "0",

            "MemoryVMUsage": "62",

            "OutOfOrderRate": "0",

            "ReadThreadUsage": "0",

            "WriteThreadUsage": "0",

            "FailedWriteRate": "0",

            "DiskFreeSpace": "59828"

        },

        "AlarmEvents": {

            "AverageAlarmRate": ""

        },

        "TotalCollectors": {

            "TotalCollectors": 1,

            "RunningCollectors": 1,

            "StoppedCollectors": 0,

            "UnknownCollectors": 0

        },

        "Licence": {

            "ActualDataStores": 3,

            "MaxDataStores": 200,

            "ActualTags": 0,

            "MaxTags": 2147483647,

            "ActualUsers": 0,

            "MaxUsers": 1000

        }

    }

}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN> 
https://<historianservername>/historian-rest-api/systemstats
Table 6. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
The Get Read Sample and Receive Rate API
Using the Get Read Sample and Receive Rate API, you can view the read rate and receive rate of a system.
METHOD GET
URI
Read Sample Rate
https://<historianservername>/historian-rest-api/v1/performancecounter/perftagdata/
PerfTag_AverageEventRate/-/-/starttime/endtime/interval
Receive Rate
https://<historianservername>/historian-rest-api/v1/performancecounter/perftagdata/
PerfTag_AverageReadRawRate/-/-/starttime/endtime/interval
SAMPLE GET URI
https://<historianservername>/historian-rest-api/v1/performancecounter/
perftagdata/PerfTag_AverageEventRate/-/-/2020-12-15T11:19:01.719Z/2020-12-15T12:19:01.719Z/360000
SAMPLE RESPONSE
{

    "ErrorCode": 0,

    "ErrorMessage": null,

    "Data": [

        {

            "TagName": "PerfTag_AverageEventRate",

            "ErrorCode": 0,

            "DataType": "DoubleFloat",

            "Samples": [

                {

                    "TimeStamp": "2020-11-18T05:35:22.612Z",

                    "Value": "0",

                    "Quality": 0

                },

                {

                    "TimeStamp": "2020-11-18T05:47:22.612Z",

                    "Value": "0",

                    "Quality": 0

                },

                {

                    "TimeStamp": "2020-11-18T05:53:22.612Z",

                    "Value": "0",

                    "Quality": 0

                },             

                {

                    "TimeStamp": "2020-11-18T06:11:22.612Z",

                    "Value": "0",

                    "Quality": 0

                },

                {

                    "TimeStamp": "2020-11-18T06:29:22.612Z",

                    "Value": "0",

                    "Quality": 0

                }

            ]

        }

    ]

}

SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN> https://<historianservername>/historian-rest-api/v1/performancecounter/perftagdata/
PerfTag_AverageEventRate/-/-/2020-12-15T11:19:01.719Z/2020-12-15T12:19:01.719Z/360000
Table 7. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
The Get Storages API
Using the Get Storages API, you can view the list of locations in a system.
METHOD GET
URI
https://<historianservername>/historian-rest-api/v1/storages?storageMask=
SAMPLE QUERY PARAM GET URL
https://<historianservername>/historian-rest-api/v1/storages?storageMask=*
SAMPLE RESPONSE
{

    "ErrorCode": 0,

    "ErrorMessage": null,

    "Data": [

        {

            "StorageName": "System Storage",

            "StorageType": 2,

            "NumberOfDataStores": 1,

            "NumberOfArchivers": 0,

            "DataStores": [

                "System"

            ],

            "Id": "861C2743-72E0-46FC-9B31-90E28CC39B8D",

            "IsDefault": false,

            "LastModifiedUser": null,

            "LastModifiedTime": "1970-01-01T00:00:00.000Z",

            "ArchiverServices": []

        },

        {

            "StorageName": "srinivaswin10",

            "StorageType": 0,

            "NumberOfDataStores": 3,

            "NumberOfArchivers": 1,

            "DataStores": [

                "ScadaBuffer",

                "DHSSystem",

                "User"

            ],

            "Id": "5F267DF3-879A-4222-8A0E-D31EDEA83C14",

            "IsDefault": true,

            "LastModifiedUser": null,

            "LastModifiedTime": "1970-01-01T00:00:00.000Z",

            "ArchiverServices": [

                {

                    "LogicalName": "DataArchiver_xyz",

                    "NodeName": "xyz",

                    "ServiceType": 2,

                    "TCPPort": 14001

                }

            ]

        }

    ]

}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN> 
https://<historianservername>/historian-rest-api/v1/storages?storageMask=*
Table 8. Query Parameters
Parameter Description Required? Values
storageMask The value of the location mask. No String
Table 9. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
The Add Machine API
Using the Add Machine API, you can add a server in a Historian system.
METHOD POST
URI
https://<historianservername>/historian-rest-api/v1/machine
SAMPLE URI
https://<historianservername>/historian-rest-api/v1/machine

Payload

{
"nodeName": "node1"
}
SAMPLE RESPONSE
{

    "ErrorCode": 0,

    "ErrorMessage": null

}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -i -H "Content-Type: application/json" -H "Authorization: Bearer <TOKEN> 
-d ???{ \???nodeName \???:\???name\???} -X POST https://<historianservername>/historian-rest-api/v1/machine
Table 10. Query Parameters
Parameter Description Required? Values
Payload Contains the machine name of the server that you want to add. Yes Multiple
Table 11. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
The Delete Machine API
Using the Delete Machine API, you can remove a server from a Historian system.
METHOD DELETE
URI
https://<historianservername>/historian-rest-api/v1/machine
SAMPLE URI
https://<historianservername>/historian-rest-api/v1/machine

Payload

{
"nodeName": "",

}
SAMPLE RESPONSE
{

    "ErrorCode": 0,

    "ErrorMessage": null

}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -i -H "Content-Type: application/json"
-H "Authorization: Bearer <TOKEN> -d ???{ \???nodeName \???:\???name\???} -X DELETE https://<historianservername>/historian-rest-api/v1/machine
Table 12. Query Parameters
Parameter Description Required? Values
Payload Contains the name of the machine that you want to remove. Yes Multiple
Table 13. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
The Create Mirror Group API
Using the Create Mirror Group API, you can create a mirror group.
METHOD POST
URI
https://<historianservername>/historian-rest-api/v1/mirrorgroup
SAMPLE URI
https://<historianservername>/historian-rest-api/v1/mirrorgroup

Payload

{
"mirrorStorageName": "storagename",

"nodes": "node1;node2"

}
SAMPLE RESPONSE
{

    "ErrorCode": 0,

    "ErrorMessage": null

}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -i -H "Content-Type: application/json" -H "Authorization: Bearer <TOKEN> 
-d ???{ \ mirrorStorageName \???:\???name\???,\" nodes \": \"xx;yy\"} -X POST https://<historianservername>/historian-rest-api/v1/mirrorgroup
Table 14. Query Parameters
Parameter Description Required? Values
Payload Contains the mirror group name and the servers you want to add to the group. Yes Multiple
Table 15. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
The Add Mirror Machine API
Using the Add Mirror Machine API, you can add a server to a mirror group.
METHOD POST
URI
https://<historianservername>/historian-rest-api/v1/mirrormachine
SAMPLE URI
https://<historianservername>/historian-rest-api/v1/mirrormachine

Payload

{
"mirrorStorageName": "Mirror2",

"mirrorMachineName": "distmachine1"

}
SAMPLE RESPONSE
{

    "ErrorCode": 0,

    "ErrorMessage": null

}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -i -H "Content-Type: application/json" -H "Authorization: Bearer <TOKEN> 
-d ???{ \ mirrorStorageName \???:\???name\???,\" nodes \": \"xx;yy\"} -X POST https://<historianservername>/historian-rest-api/v1/mirrormachine
Table 16. Query Parameters
Parameter Description Required? Values
Payload Contains the machine name of the server that you want to add. Yes Multiple
Table 17. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
The Mirror Group Update API
Using the Mirror Group Update API, you can update the name of a mirror group.
METHOD PUT
URI
https://<historianservername>/historian-rest-api/v1/mirrorgroup
SAMPLE URI
https://<historianservername>/historian-rest-api/v1/mirrorgroup

Payload

{
"mirrorStorageName": "Mirror2",

"mirrorStorageNewName": "Mirror3"

}
SAMPLE RESPONSE
{

    "ErrorCode": 0,

    "ErrorMessage": null

}
SAMPLE cURL COMMAND
	
curl -i -H "Accept: application/json" -i -H "Content-Type: application/json" -H "Authorization: Bearer <TOKEN> 
-d ???{ \???mirrorStorageName \???:\???name\???,\" mirrorStorageNewName \": \"sname\"} -X PUT https://<historianservername>/historian-rest-api/v1/mirrorgroup
Table 18. Query Parameters
Parameter Description Required? Values
Payload Contains the existing and new names of the mirror group that you want to rename. Yes Multiple
Table 19. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
The Delete Mirror Machine API
Using the Delete Mirror Machine API, you can remove a server from a mirror group.
METHOD DELETE
URI
https://<historianservername>/historian-rest-api/v1/mirrormachine
SAMPLE URI
https://<historianservername>/historian-rest-api/v1/mirrormachine

Payload

{

"mirrorStorageName": "Mirror 2",

"mirrorMachineName": "distmachine1"
}
SAMPLE RESPONSE
{

    "ErrorCode": 0,

    "ErrorMessage": null

}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -i -H "Content-Type: application/json"
-H "Authorization: Bearer <TOKEN> -d ???{ \???mirrorStorageName \???:\???name\???,
\ mirrorMachineName\???:\???name\???} -X DELETE https://<historianservername>/historian-rest-api/v1/mirrormachine
Table 20. Query Parameters
Parameter Description Required? Values
Payload Contains the name of the machine that you want to remove and the name of the mirror group. Yes Multiple
Table 21. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
The Delete Mirror Group API
Using the Delete Mirror Group API, you can delete a mirror group.
METHOD DELETE
URI
https://<historianservername>/historian-rest-api/v1/mirrorgroup
SAMPLE URI
https://<historianservername>/historian-rest-api/v1/mirrorgroup

Payload

{
"mirrorStorageName": "Mirror3",
}
SAMPLE RESPONSE
{

    "ErrorCode": 0,

    "ErrorMessage": null

}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -i -H "Content-Type: application/json"
-H "Authorization: Bearer <TOKEN> -d ???{ \???mirrorStorageName \???:\???name\???} -X DELETE 
https://<historianservername>/historian-rest-api/v1/mirrorgroup
Table 22. Query Parameters
Parameter Description Required? Values
Payload Contains the name of the machine that you want to remove. Yes Multiple
Table 23. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
The Local OPC Servers API
Using the Local OPC Servers API, you can view the list of OPC servers installed on a specified machine.
METHOD GET
URI
http://<historianservername>/v1/localopcservers/<machine name>
SAMPLE QUERY PARAM GET URL
http://<historianservername>/v1/localopcservers/<machine name>
SAMPLE RESPONSE
{
    "ErrorCode": 0,
    "ErrorMessage": null,
    "ServerIDs": [
        "ID1",
        "ID2     "
    ]
}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN> 
https://<historianservername>/historian-rest-api/v1/localopcservers/xyz
Table 24. Query Parameters
Parameter Description Required? Values
machine name The machine name of the OPC server. Yes String
Table 25. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
The Local OPC AE Servers API
Using the Local OPC AE Servers API, you can view the list of OPC Alarms and Events servers installed on a specified machine.
METHOD GET
URI
http://<historianservername>/v1/localopcaeservers/<machine name>
SAMPLE QUERY PARAM GET URL
http://<historianservername>/v1/localopcaeservers/<machine name>
SAMPLE RESPONSE
{
    "ErrorCode": 0,
    "ErrorMessage": null,
    "ServerIDs": [
        "ID1",
        "ID2     "
    ]
}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN> 
https://<historianservername>/historian-rest-api/v1/localopcaeservers/abc
Table 26. Query Parameters
Parameter Description Required? Values
machine name The machine name of the OPC Alarms and Events server. Yes String
Table 27. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
The Local OPC HDA Servers API
Using the Local OPC HDA Servers API, you can view the list of OPC HDA servers installed on a specified machine.
METHOD GET
URI
http://<historianservername>/v1/localopchdaservers/<machine name>
SAMPLE QUERY PARAM GET URL
http://<historianservername>/v1/localopchdaservers/<machine name>
SAMPLE RESPONSE
{
    "ErrorCode": 0,
    "ErrorMessage": null,
    "ServerIDs": [
        "ID1",
        "ID2     "
    ]
}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN> 
https://<historianservername>/historian-rest-api/v1/localopchdaservers/xyz
Table 28. Query Parameters
Parameter Description Required? Values
machine name The machine name of the OPC HDA server. Yes String
Table 29. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
The DHS Service Port Update API
Using the DHS Service Port Update API, you can change the port and other details of a DHS service.
METHOD PUT
URI
	
https://<historianservername>/historian-rest-api/v1/dhsservice/<DHS service name>
SAMPLE URI
https://<historianservername>/historian-rest-api/v1/dhsservice/ DataArchiver_xxx

{

   "LogicalName": "DataArchiver_xxx",

   "NodeName": "xxx",

   "ServiceType": 2,

   "Status": 1,

   "TCPPort": 14005

}
SAMPLE RESPONSE
{

    "ErrorCode": 0,

    "ErrorMessage": null,

    "Data": {

        "LogicalName": "DataArchiver_xxx",

        "NodeName": "xxx",

        "ServiceType": 2,

        "Status": 1,

        "TCPPort": 14005

    }

}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -i -H "Content-Type: application/json"
-H "Authorization: Bearer <TOKEN> -d ???{ \ LogicalName \???:\ DataArchiver_xxx \???,
\" NodeName \": \"xxx\"\???,\" ServiceType \": 2,\" Status\": 1, \" TCPPort \": 14005} -X PUT 
https://<historianservername>/historian-rest-api/v1/dhsservice/DataArchiver_xxx
Table 30. Query Parameters
Parameter Description Required? Values
Payload Contains the values of the attributes of the data store that you want to change. Yes Multiple
Table 31. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.

Managing Collector Instances

The Create Collector Instance API
Using the Create Collector Instance API, you can create a collector instance.
METHOD POST
URI
https://<historianservername>/historian-rest-api/v1/collector/createnewinstance
SAMPLE URI
https://<historianservername>/historian-rest-api/v1/collector/createnewinstance
Payload
{
"mode":1,
"CollectorSystemName":"xyz",
"InterfaceDescription":"xyz_Simulation_<IP address>_2",
"DataPathDirectory":"C:\\Proficy Historian Data",
"CollectorDestination":"Historian",
"winUserName":"","winPassword":"",
"InterfaceSubType":"",
"DestinationHistorianUserName":"abc",
"DestinationHistorianPassword":"password",
"DestinationHistorian":"<IP address>",
"General1":"",
"General2":"",
"General3":"123",
"General4":"",
"General5":"",
"Type":2,
"InterfaceName":"<source server>_<type of the collector>_<destination server>"
}
Note:
  • The DestinationHistorian parameter will not have a value for offline collector configuration.
  • To connect to MQTT destinations such as AWS IoT and Google Cloud Platform (GCP), you must provide an encrypted password.
SAMPLE RESPONSE
{

    "ErrorCode": 0,

    "ErrorMessage": null

}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -i -H "Content-Type: application/json" 
-H "Authorization: Bearer <TOKEN> -d ???{ \"mode\":1,\"CollectorSystemName\":\"xyz\",
\"InterfaceDescription\":\"xyz_Simulation_<IP address>_2\",\"DataPathDirectory\":\"C:\\Proficy Historian Data\",
\"CollectorDestination\":\"Historian\",\"winUserName\":\"\",\"winPassword\":\"\",
\"InterfaceSubType\":\"\",\"DestinationHistorianUserName\":\"abc\",
\"DestinationHistorianPassword\":\"password\",
\"DestinationHistorian\":\"<IP address>\",\"General1\":\"\",
\"General2\":\"\",\"General3\":\"xyz\",\"General4\":\"\",\"General5\":\"\",
\"Type\":2,\"InterfaceName\":\"<source server>_<type of the collector>_<destination server>\"} -X POST 
https://<historianservername>/historian-rest-api/v1/collector/createnewinstance
Table 32. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
The Get Collector Instance Details API
Using the Get Collector Instance Details API, you can view the details of a collector instance.
METHOD GET
URI
https://<historianservername>/historian-rest-api/v1/collector/instancedetails/<interface name>
SAMPLE QUERY PARAM GET URL
https://<historianservername>/historian-rest-api/v1/collector/instancedetails/<interface name>
SAMPLE RESPONSE
{
"ErrorCode":0,
"ErrorMessage":null,
"Data":
{
"CloudDestination":"",
"InterfaceSubType":"",
"CollectorSystemName":"xyz",
"Type":2,
"DefaultCompression":false,
"CloudInformationLogLevel":0,
"InterfaceDataDir":"C:\\Proficy Historian Data",
"SourceServer":"",
"Username":"",
"Password":"",
"DestinationType":"Historian",
"DestinationServer":"abc",
"DebugLogLevel":0,
"InterfaceInstallDrive":"C",
"ConnnectionString":"xyz"
}
}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN> 
https://<historianservername>/historian-rest-api/v1/collector/instancedetails/xyz_Simulation_<IP address>_2
Table 33. Query Parameters
Parameter Description Required? Values
interface name The interface name of the collector whose details you want to view. Yes String
Table 34. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
The Edit Collector Instance API
Using the Edit Collector Instance API, you can modify the cloud parameters of a collector instance. The collector instance will be restarted after you make changes.
METHOD PUT
URI
https://<historianservername>/historian-rest-api/v1/collector/editinstance
SAMPLE URI
https://<historianservername>/historian-rest-api/v1/collector/editinstance
Payload
{"interfaceName":"<source server>_<type of the collector>_<destination server>",
"messageCompression":0,
"azureLogLevel":1,
"debugMode":0,
"CollectorDestination":"Predix",
"DestinationHistorian":"abc",
"mode":1,
"CloudDestinationAddress":"wss://def.run.abc.ice.predix.io/v1/stream/messages",
"IdentityIssuer":"https://1234.predix-uaa.run.abc.ice.predix.io/oauth/token",
"ClientID":"xyz",
"ClientSecret":"123",
"ZoneID":"1234",
"Proxy":"http://1.2.3.4:80",
"ProxyUserName":"",
"ProxyPassword":"",
"DatapointAttribute1":"",
"DatapointAttribute2":"",
"DatapointAttribute3":"",
"DatapointAttribute4":""}
Note:
  • The DestinationHistorian parameter will not have a value for offline collector configuration.
  • To connect to MQTT destinations such as AWS IoT and Google Cloud Platform (GCP), you must provide an encrypted password.
SAMPLE RESPONSE
{

    "ErrorCode": 0,

    "ErrorMessage": null

}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -i -H "Content-Type: application/json" 
-H "Authorization: Bearer <TOKEN> -d ???{\"interfaceName\":\"<source server>_<type of the collector>_<destination server>\",
\"InterfaceName\":\"<source server>_<type of the collector>_<destination server>\",\"messageCompression\":0,\"azureLogLevel\":1,
\"debugMode\":0,\"CollectorDestination\":\"Predix\",\"DestinationHistorian\":\"abc\",\"mode\":1,
\"CloudDestinationAddress\":\"wss://wss://def.run.abc.ice.predix.io/v1/stream/messages\",
\"IdentityIssuer\":\"https://1234.predix-uaa.run.abc.ice.predix.io/oauth/token/",
\"ClientID\":\"HistQA\",\"ClientSecret\":\"Gei321itc\",\"ZoneID\":\"1234\",
\"Proxy\":\"http://1.2.3.4:80\",\"ProxyUserName\":\"\",\"ProxyPassword\":\"\",
\"DatapointAttribute1\":\"\",\"DatapointAttribute2\":\"\",\"DatapointAttribute3\":\"\",
\"DatapointAttribute4\":\"\"} -X PUT 
https://<historianservername>/historian-rest-api/v1/collector/editinstance
Table 35. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
The Azure Log Level API
Using the Azure Log Level API, you can set the debug information log level for destination - Azure IoT Hub. You can set a value ranging from 0 to 4.
METHOD PUT
URI
https://<historianservername>/historian-rest-api/v1/collector/azureloglevel
SAMPLE URI
https://<historianservername>/historian-rest-api/v1/collector/azureloglevel
Payload
{"interfaceName":""InterfaceName":"<source server>_<type of the collector>_<destination server>"", 
"azureLogLevel":1,}
SAMPLE RESPONSE
{

    "ErrorCode": 0,

    "ErrorMessage": null

}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -i -H 
"Content-Type: application/json" -H "Authorization: Bearer <TOKEN> -d 
???{\"interfaceName\":\"<source server>_<type of the collector>_<destination server>\",\"azureLogLevel\":1} -X PUT 
https://<historianservername>/historian-rest-api/v1/collector/azureloglevel
Table 36. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
The Install Component Details API
Using the Install Component Details API, you can view the install component details from the collector machine.
METHOD GET
URI
https://<historianservername>/historian-rest-api/v1/
installcomponentdetails/collectorType/collectorSubType/machine
SAMPLE URI
https://<historianservername>/historian-rest-api/v1/installcomponentdetails/2/-/abc
SAMPLE RESPONSE
{
"ErrorCode":0,
"ErrorMessage":null,
"Data":
{
"InterfaceInstallDrive":"C",
"InterfaceDataDir":"C:\\Proficy Historian Data",
"CertPathDir":"NONE"
}
}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN> 
https://<historianservername>/historian-rest-api/v1/installcomponentdetails/2/-/abc
Table 37. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
The Message Compression API
Using the Message Compression API, you can enable or disable message compression.
METHOD PUT
URI
https://<historianservername>/historian-rest-api/v1/collector/messagecompression
SAMPLE REQUEST
{
"interfaceName":"<source server>_<type of the collector>_<destination server>",
"messageCompression":1
}
SAMPLE RESPONSE
{
"ErrorCode":0,
"ErrorMessage":null,
}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -i -H "Content-Type: application/json" 
-H "Authorization: Bearer <TOKEN> -d 
???{\"interfaceName\":\"<source server>_<type of the collector>_<destination server>\",
\"messageCompression\":1} -X PUT 
https://<historianservername>/historian-rest-api/v1/collector/messagecompression
Table 38. Query Parameters
Parameter Description Required? Values
interface name The interface name of the collector whose message compression you want to enable or disable. Yes String
messagecompression
Identifies whether you want to enable or disable message compression. The valid values are 0 and 1. Yes
Table 39. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
The Delete Instance API
Using the Delete Instance API, you can delete a collector instance.
METHOD PUT
URI
https://<historianservername>/historian-rest-api/v1/collector/deleteinstance
SAMPLE REQUEST
https://<historianservername>/historian-rest-api/v1/collector/deleteinstance
Payload
{
"interfaceName":"<source server>_<type of the collector>_<destination server>",
"deleteTags":true
}
SAMPLE RESPONSE
{
"ErrorCode":0,
"ErrorMessage":null,
}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -i -H "Content-Type: application/json" 
-H "Authorization: Bearer <TOKEN> -d ???{\"interfaceName\":\"<source server>_<type of the collector>_<destination server>\",\"deleteTags\":true} -X PUT 
https://<historianservername>/historian-rest-api/v1/collector/deleteinstance
Table 40. Query Parameters
Parameter Description Required? Values
interface name The interface name of the collector whose details you want to delete. Yes String
deleteTags Identifies whether you want to delete the tags. The valid values are true and false. Yes Boolean
Table 41. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.

Collector Type and Subtype

The following table provides a list of collector type and subtype for each collector, which you will provide in APIs.
Collector Collector Type Collector Subtype
The Calculation collector 8
The Cygnet collector 16 Cygnet
The File collector 4
The iFIX Alarms and Events collector 11 iFixAE
The iFIX collector 1
The MQTT collector 16 MQTT
The ODBC collector 16 ODBC
The OPC Classic Alarms and Events collector 11
The OPC Classic DA collector 3
The OPC Classic HDA collector 16 OPCHDA
The OPC UA DA collector 16 OPCUA
The OSI PI collector 10
The OSI PI distributor 13
The Server-to-Server collector 9
The Server-to-Server distributor 17
The Simulation collector 2
The Windows Performance collector 18
The Wonderware collector 16 Wonderware

Managing Collectors ApIs

The Start Collector API
Using the Start Collector API, you can start a collector.
METHOD PUT
URI
https://<historianservername>/historian-rest-api/v1/collector/start
SAMPLE URI Sample URI for the service mode:
https://<historianservername>/historian-rest-api/v1/collector/start

Payload

{
  "interfaceName":"<source server>_<type of the collector>_<destination server>",
  "mode":1                            
}
Sample URI for the command line mode:
https://<historianservername>/historian-rest-api/v1/collector/start

Payload

{
  "interfaceName":"<source server>_<type of the collector>_<destination server>",
  "mode":2,
  ???winUserName???:??????,
  ???winPassword???:?                             
}
SAMPLE RESPONSE
{
    "ErrorCode": 0,
    "ErrorMessage": ""
    "Data": "Collector Start Initiated"
}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -i -H "Content-Type: application/json" 
-H "Authorization: Bearer <TOKEN> -d 
???{ \???interfaceName\???:\???<source server>_<type of the collector>_<destination server>\???,
\"mode\": 1} -X PUT https://<historianservername>/historian-rest-api/v1/collector/start

Query parameters include the Payload parameter, which is a JSON file, which contains the following properties.

Table 42. Query Parameters
Parameter Description Required? Values
interfaceName The interface name of the collector. Yes String
mode The mode to use to manage the collector. Yes
  • 1: service mode
  • 2: command-line mode
winUserName The Windows username. Yes (only if you want to use the command-line mode) String
winPassword The Windows password Yes (only if you want to use the command-line mode) String
Table 43. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
Data String No Indicates if the task has been initiated.
The Stop Collector API
Using the Stop Collector API, you can stop a collector.
METHOD PUT
URI
https://<historianservername>/historian-rest-api/v1/collector/stop
SAMPLE URI
https://<historianservername>/historian-rest-api/v1/collector/stop

Payload

{
???interfaceName":"<source server>_<type of the collector>_<destination server>"
???winUserName???:???TestAdmin???,
???winPassword???:???TestAdminPassword                    
}
SAMPLE RESPONSE
{
    "ErrorCode": 0,
    "ErrorMessage": null,
    "Data": "Collector Stop Initiated"
}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -i -H "Content-Type: application/json" 
-H "Authorization: Bearer <TOKEN> -d 
???{ \???interfaceName\???:\???<source server>_<type of the collector>_<destination server>\???} 
-X PUT https://<historianservername>/historian-rest-api/v1/collector/stop

Query parameters include the Payload parameter, which is a JSON file, which contains the following properties.

Table 44. Query Parameters
Parameter Description Required? Values
interfaceName The interface name of the collector. Yes String
winUserName The Windows username. Yes (only if you want to use the command-line mode) String
winPassword The Windows password Yes (only if you want to use the command-line mode) String
Table 45. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
Data String No Indicates if the task has been initiated.
The Restart Collector API
Using the Restart Collector API, you can restart a collector.
METHOD PUT
URI
https://<historianservername>/historian-rest-api/v1/collector/restart
SAMPLE URI
https://<historianservername>/historian-rest-api/v1/collector/restart

Payload
{
  ???interfaceName":"<source server>_<type of the collector>_<destination server>" 
   "winUserName":"",
   "winPassword":""                   
}
SAMPLE RESPONSE
{
    "ErrorCode": 0,
    "ErrorMessage": null,
    "Data": "Collector Restart Initiated"
}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -i -H "Content-Type: application/json" 
-H "Authorization: Bearer <TOKEN> -d 
???{ \???interfaceName\???:\???<source server>_<type of the collector>_<destination server>\???} 
-X PUT https://<historianservername>/historian-rest-api/v1/collector/restart

Query parameters include the Payload parameter, which is a JSON file, which contains the following properties.

Table 46. Query Parameters
Parameter Description Required? Values
interfaceName The interface name of the collector. Yes String
winUserName The Windows username. Yes String
winPassword The Windows password Yes String
Table 47. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
Data String No Indicates if the task has been initiated.
The Pause Data Collection API
Using the Pause Data Collection API, you can pause the data collection of a collector.
METHOD PUT
URI
https://<historianservername>/historian-rest-api/v1/collector/pausecollection/{interfaceName}
SAMPLE URI
https://<historianservername>/historian-rest-api/v1/collector/pausecollection/RSSERVER2012-02_Simulation
SAMPLE RESPONSE
{
    "ErrorCode": 0,
    "ErrorMessage": ""
}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -i -H "Content-Type: application/json" 
-H "Authorization: Bearer <TOKEN> -X PUT https://<historianservername>/historian-rest-api/v1/collector/pausecollection/RSSERVER2012-02_Simulation
Table 48. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
Data String No Indicates if the task has been initiated.
The Resume Data Collection API
Using the Resume Data Collection API, you can resume the data collection of a collector.
METHOD PUT
URI
https://<historianservername>/historian-rest-api/v1/collector/resumecollection/{interfaceName}
SAMPLE URI
https://<historianservername>/historian-rest-api/v1/collector/resumecollection/RSSERVER2012-02_Simulation
SAMPLE RESPONSE
{
    "ErrorCode": 0,
    "ErrorMessage": ""
}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -i -H "Content-Type: application/json" 
-H "Authorization: Bearer <TOKEN> -X PUT https://<historianservername>/historian-rest-api/v1/collector/resumecollection/RSSERVER2012-02_Simulation
Table 49. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
Data String No Indicates if the task has been initiated.
The Add Tag Comment API
Using the Add Tag Comment API, you can add a comment to a tag.
METHOD POST
URI
https://<historianservername>/historian-rest-api/v1/tags/addcomment
SAMPLE URI
https://<historianservername>/historian-rest-api/v1/tags/addcomment

Payload
{
  "tagName":"rsserver2012-02.Simulation00003",
  "comment":"Retest",
  "timeStamp":"2020-04-22T00:00:00.000Z"
}
SAMPLE RESPONSE
{
               "ErrorCode": 0,
               "ErrorMessage": null,
               "Data": ""
              }
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -i -H "Content-Type: application/json" -H "Authorization: Bearer <TOKEN> -d ???{ \???tagName\???:\ rsserver2012-02.Simulation00003\???,\"comment\":\"Test10\",\"timeStamp\": \???2020-04-22T00:00:00.000Z \???} -X POST https://<historianservername>:8443/historian-rest-api/v1/tags/addcomment

Query parameters include the Payload parameter, which is a JSON file, which contains the following properties.

Table 50. Query Parameters
Parameter Description Required? Values
tagName The name of the tag. Yes String
timestamp The timestamp of the comment. Yes String
comment The comment. Yes String
Table 51. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
The Get Tag Comment API
Using the Get Tag Comment API, you can view the comments added to a tag.
METHOD GET
URI
https://<historianservername>/historian-rest-api/v1/tags/
comments/{tagNames}/{start}/{end}
SAMPLE QUERY PARAM GET URI
https://<historianservername>/historian-rest-api/
v1/tags/comments/?tagNames=rsserver2012-02.Simulation00003; 
rsserver2012-02.Simulation00004&start=2020-04-19T00:
00:00.000Z&end=2020-04-24T00:00:00.000Z
Note: The query parameter supports multiple tags.
SAMPLE RESPONSE
{
    "ErrorCode": 0,
    "ErrorMessage": null,
    "Data": [
        {
            "TagName": "Motor Temperature",
            "ErrorCode": 0,
            "Comments": [
                {
                    "TimeStamp": "2020-04-22T00:00:00.000Z",
                    "Comment": "Heat run test: Starting temperature"
                },
                {
                    "TimeStamp": "2020-04-22T00:00:00.000Z",
                    "Comment": "Heat run test: Temperature of the stator"
                },
                {
                    "TimeStamp": "2020-04-22T00:00:00.000Z",
                    "Comment": "Heat run test: Temperature of the rotor"
                },
                {
                    "TimeStamp": "2020-04-22T00:00:00.000Z",
                    "Comment": "Heat run test: Temperature of the shaft"
                },
                {
                    "TimeStamp": "2020-04-22T00:00:00.000Z",
                    "Comment": "Heat run test: Temperature of the endshield"
                }
            ]
        }
    ]
}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -H 
"Authorization: Bearer <TOKEN> http://<historianservername>
/historian-rest-api/v1/tags/comments/<tagNames>/<start>/<end>

Query parameters include the Payload parameter, which is a JSON file, which contains the following properties.

Table 52. Query Parameters
Parameter Description Required? Values
tagNames

The names of the tag as a semicolon-separated list. For example: HISTWIN20161.ctag1; HISTWIN20161.ctag2

Yes String
start The start time of the query, in ISO data format (YYYY-MM-DDTHH:mm:ss.SSSZ). Yes DateTime
end The end time of the query, in ISO format (YYYY-MM-DDTHH:mm:ss.SSSZ). Yes DateTime
Table 53. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
The Set Debug Mode API
Using the Set Debug Mode API, you can set the debug mode of a collector.
METHOD PUT
URI
https://<historianservername>/historian-rest-api/v1/collector/setdebugmode
SAMPLE URI
https://<historianservername>/historian-rest-api/v1/collector/setdebugmode

Payload
{
  ???interfaceName":"<source server>_<type of the collector>_<destination server>",
  ???debugMode???:255                      
}
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 
???{ \???interfaceName\???:\???<source server>_<type of the collector>_<destination server>\???,
\???debugMode\???} -X PUT https://<historianservername>/historian-rest-api/v1/collector/setdebugmode

Query parameters include the Payload parameter, which is a JSON file, which contains the following properties.

Table 54. Query Parameters
Parameter Description Required? Values
interfaceName The interface name of the collector. Yes String
debugMode The debug log level for the collector. Yes
  • 0: Normal log level
  • 255: Debug log level
Table 55. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
The Buffer File Control API
Using the Buffer File Control API, you can delete or move the buffer files. It is recommended to move the buffer files to a new folder within the same drive.
Note: Moving files to a network shared drive is not supported.
METHOD PUT
URI
https://<historianservername>/historian-rest-api/v1/collector/buffercontrol
SAMPLE URI Sample URI for moving buffer files:
https://<historianservername>/historian-rest-api/v1/collector/buffercontrol

Payload
{
  ???interfaceName":"<source server>_<type of the collector>_<destination server>",
  ???bufferMode???:2,
     "winUserName":"Administrator",
        "winPassword":"xxxxxxx",
  "bufferPath": "C:\\Users\\bufffiles"                      
}
Sample URI for deleting buffer files:

https://<historianservername>/historian-rest-api/v1/collector/buffercontrol

Payload
{
  ???interfaceName":"<source server>_<type of the collector>_<destination server>",
  ???bufferMode???:1   
 "winUserName":"Administrator",
        "winPassword":"xxxxxxx",                   
}
SAMPLE RESPONSE Sample response for moving buffer files:
{
    "ErrorCode": 0,
    "ErrorMessage": null,
    "Data": "BufferFiles Move Initiated. Collector is in the Stopped state."
}
Sample response for deleting buffer files:
{
    "ErrorCode": 0,
    "ErrorMessage": null,
    "Data": "BufferFiles Delete Initiated. Collector is in the Stopped state."
}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -i -H "Content-Type: application/json" 
-H "Authorization: Bearer <TOKEN> -d 
???{ \???interfaceName\???:\???<source server>_<type of the collector>_<destination server>\???,
\???bufferMode \???:1,\???bufferPath \???:\ C:\\Users\\bufffiles\???} -X PUT https://<historianservername>/historian-rest-api/v1/collector/buffercontrol

Query parameters include the Payload parameter, which is a JSON file, which contains the following properties.

Table 56. Query Parameters
Parameter Description Required? Values
interfaceName The interface name of the collector. Yes String
bufferMode Indicates whether you want to move or delete the files. Yes
  • 1: Indicates that the buffer files will be deleted.
  • 2: Indicates that the buffer files will be moved to the location specified in the bufferPath parameter.
bufferPath The directory to which you want to move the buffer files. For example: C:\\Data\\NewBufferFilesLocation or C:/Data/NewBufferPathLocation
Note: The double slash (\\) is required in the JSON format.
Yes (only if you want to move the buffer files) String
winUserName The Windows username. Yes (only if you want to use the command-line mode) String
winPassword The Windows password Yes (only if you want to use the command-line mode) String
Table 57. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
Data String No Indicates if the task has been initiated (and if the collector is in the stopped state).
The Server Node Change API
Using the Server Node Change API, you can change the server node of a collector to a machine that has Historian 8.1 installed on it.
METHOD PUT
URI
https://<historianservername>/historian-rest-api/v1/collector/historiannodechange
SAMPLE URI
https://<historianservername>/historian-rest-api/v1/collector/historiannodechange

Payload
{
  ???interfaceName":"<source server>_<type of the collector>_<destination server>",
  ???mode???:2,
  "winUserName":"TestAdministrator",
  "winPassword":"TestPassword",
  "historianNode":"VMHISTWEBAUTO",
  "historianUserName":" TestAdministrator2 ",
  "historianpassword":" TestPassword2"                  
                 
}
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 
???{ \???interfaceName\???:\???<source server>_<type of the collector>_<destination server>\???,
\???userName  winUserName\???:\???tesrt\???,\???winpPassword \???:\???password\???,
\???historianNode \???:\???nodename\???,\ historianUserName \???:\???husername\???,
\ historianpassword \???:\???hpassword\???} -X PUT 
https://<historianservername>/historian-rest-api/v1/collector/ historiannodechange

Query parameters include the Payload parameter, which is a JSON file, which contains the following properties.

Table 58. Query Parameters
Parameter Description Required? Values
interfaceName The interface name of the collector. Yes String
mode The mode to use to manage the collector. Yes
  • 1: service mode
  • 2: command-line mode
winUserName The Windows username. Yes (only if you want to use the command-line mode) String
winPassword The Windows password. Yes (only if you want to use the command-line mode) String
historianNode The host name of the new Historian destination machine. The destination machine must have Historian 8.1. Yes String
historianUserName The Windows username of the new Historian destination machine. Yes (only if you want to use the command-line mode) String
historianPassword The Windows password of the new Historian destination machine. Yes (only if you want to use the command-line mode) String
Table 59. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
The Get Collector Version API
Using the Get Collector Version API, you can view the version number of a collector.
METHOD GET
URI
https://<historianservername>/historian-rest-api/v1/collector/version/{interfaceName}
SAMPLE QUERY PARAM GET URL
https://<historianservername>/historian-rest-api/v1/collector/version/?interfaceName=<source server>_<type of the collector>_<destination server>
SAMPLE RESPONSE
{
    "ErrorCode": 0,
    "ErrorMessage": null,
    "Data": {
        "Version": "8.1.2068.0"
    }
}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN> http://<historianservername>/historian-rest-api/v1/collector/version/RSSERVER2012-02_Simulation
Table 60. Query Parameters
Parameter Description Required? Values
interfaceName The interface name of the collector. Yes String
Table 61. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
Data String Yes Returns the version of the collector.
The Get Collector Status API
Using the Get Collector Status API, you can view the status of a collector.
METHOD GET
URI
https://<historianservername>/historian-rest-api/v1/collector/status/{interfaceName}
SAMPLE GET URI
https://<historianservername>/historian-rest-api/v1/collector/status/RSSERVER2012-02_Simulation
SAMPLE RESPONSE
{
    "ErrorCode": 0,
    "ErrorMessage": "null"
    "Data":{
        "Status":"Running"
    }
}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN> 
https://<historianservername>/historian-rest-api/v1/collector/status/RSSERVER2012-02_Simulation
Table 62. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
Data String Yes Returns the status of the collector.
The Collector Manager List API
Using the Collector Manager List API, you can view the list of collector agents machines associated with the Historian server.
METHOD GET
URI
https://<historianservername>/historian-rest-api/v1/collectormanagerlist
SAMPLE QUERY PARAM GET URL
https://<historianservername>/historian-rest-api/v1/collectormanagerlist
SAMPLE RESPONSE
{
    "ErrorCode": 0,
    "ErrorMessage": null,
    "Data": [
        {
            "Name": "CollectorManager::abc",
            "IPAddress": "[::ffff :<IP address>]",
            "Status": 1,
            "ComputerName": "abc "
        },
        {
            "Name": "CollectorManager::xyz",
            "IPAddress": "[::ffff:<IP address>]",
            "Status": 1,
            "ComputerName": "xyz"
        },
        {
            "Name": "CollectorManager::abc",
            "IPAddress": "[::ffff:<IP address>]",
            "Status": 1,
            "ComputerName": "abc"
        },
        {
            "Name": "CollectorManager::123",
            "IPAddress": "[::ffff:<IP address>]",
            "Status": 1,
            "ComputerName": "123"
        }
    ]
}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN> 
https://<historianservername>/historian-rest-api/v1/collectormanagerlist
Table 63. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
The Collector Mode API
Using the Collector Mode API, you can view the running mode of a collector.
METHOD GET
URI
https://<historianservername>/historian-rest-api/v1/collector/mode/<collector interface name>
SAMPLE QUERY PARAM GET URL
https://<historianservername>/historian-rest-api/v1/collector/mode/<collector interface name>
SAMPLE RESPONSE
{
    "ErrorCode": 0,
    "ErrorMessage": null,
    "Data": {
        "RunningMode": "Service Mode"
    }
}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN> 
https://<historianservername>/historian-rest-api/v1/collector/mode/<host name>_Simulation_<IP address>_2
Table 64. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
The Collector Details API
Using the Collector Details API, you can view the details of a collector.
METHOD GET
URI
https://<historianservername>/historian-rest-api/v1/collector/details
SAMPLE QUERY PARAM GET URL
https://<historianservername>/historian-rest-api/v1/collector/details
SAMPLE RESPONSE
{
"ErrorCode":0,
"ErrorMessage":null,
"Data":
[
{
"Name":"<value>",
"ComputerName":"<value>",
"Status":"Running",
"ReportRate":0,
"MaximumEventRate":0,
"MinimumEventRate":0,
"OutOfOrderEvents":0,
"Overruns":0,
"OverrunsPercent":0,
"TotalEventsCollected":0,
"TotalEventsReported":0,
"LastDataValue":"\\\"1970-01-01T00:00:00.000Z\\\"",
"Redundency":"",
"Comments":"<username>--test2--\\\"2020-12-15T07:19:42.000Z\\\";",
"Version":"9.0.4326.0",
"CollectorCompression":0,
"TagsCount":0
}
]
}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN> 
https://<historianservername>/historian-rest-api/v1/collector/details
Table 65. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
The Offline Collectors API
Using the Offline Collectors API, you can view a list of offline collectors.
METHOD GET
URI
https://<historianservername>/historian-rest-api/v1/offlinecollectors
SAMPLE QUERY PARAM GET URL
https://<historianservername>/historian-rest-api/v1/offlinecollectors
SAMPLE RESPONSE
{
"ErrorCode": 0,
"ErrorMessage": null,
"Data": [
{
"Name": "DISTMACHINE1_Cygnet",
"ComputerName": "DISTMACHINE1",
"Status": "Stopped"
},
{
"Name": "NPI212611749M1_Cygnet",
"ComputerName": "NPI212611749M1",
"Status": "Stopped"
},
{
"Name": "NPI212611749M1_Mqtt",
"ComputerName": "NPI212611749M1",
"Status": "Stopped"
}
]
}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN> 
https://<historianservername>/historian-rest-api/v1/offlinecollectors
Table 66. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.

Managing Data Stores

The Get Data Stores API
Using the Get Data Stores API, you can view the list of data stores in a system.
METHOD GET
URI
https://<historianservername>/historian-rest-api/v1/datastores?dataStoreMask=
SAMPLE QUERY PARAM GET URL
https://<historianservername>/historian-rest-api/v1/datastores?dataStoreMask=*
SAMPLE RESPONSE
{

    "ErrorCode": 0,

    "ErrorMessage": null,

    "Data": [

        {

            "Description": "The System Data Store.",

            "Id": "D3C23639-81CD-40F7-9CB0-37484FC5190D",

            "IsDefault": false,

            "IsSystem": true,

            "Name": "System",

            "NumberOfTags": 0,

            "State": 2,

            "DHSStorageName": "System Storage",

            "StorageType": 0,

            "Links": [

                {

                    "Rel": "self",

                    "Href": "/datastore/System"

                }

            ]

        },

        {

            "Description": "The Scada Buffer Data Store.",

            "Id": "39B39D42-DC7A-4048-9BA8-E4BAB4644B0C",

            "IsDefault": false,

            "IsSystem": false,

            "Name": "ScadaBuffer",

            "NumberOfTags": 0,

            "State": 2,

            "DHSStorageName": "xyz",

            "StorageType": 1,

            "Links": [

                {

                    "Rel": "self",

                    "Href": "/datastore/ScadaBuffer"

                }

            ]

        },

        {

            "Description": "The DHS System Data Store.",

            "Id": "56C1DFE9-D0BF-427F-B5D8-B127E38B5C11",

            "IsDefault": false,

            "IsSystem": false,

            "Name": "DHSSystem",

            "NumberOfTags": 0,

            "State": 2,

            "DHSStorageName": "xyz",

            "StorageType": 0,

            "Links": [

                {

                    "Rel": "self",

                    "Href": "/datastore/DHSSystem"

                }

            ]

        },

        {

            "Description": "The User Data Store.",

            "Id": "33BA016D-B005-4702-96DB-42CF7238C8FF",

            "IsDefault": true,

            "IsSystem": false,

            "Name": "User",

            "NumberOfTags": 5,

            "State": 2,

            "DHSStorageName": "xyz",

            "StorageType": 0,

            "Links": [

                {

                    "Rel": "self",

                    "Href": "/datastore/User"

                }

            ]

        }

    ]

}

   }

}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN> 
https://<historianservername>/historian-rest-api/v1/datastores?dataStoreMask=*
Table 67. Query Parameters
Parameter Description Required? Values
dataStoreMask The value of the data store mask. No String
Table 68. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
The Get Data Stores of Storage API
Using the Get Data Stores of Storage API, you can view the list of data stores in a location.
METHOD GET
URI
https://<historianservername>/historian-rest-api/v1/storage/datastores?storageName=
SAMPLE QUERY PARAM GET URL
https://<historianservername>/historian-resr-api/v1/storage/datastores?storageName=xx
SAMPLE RESPONSE
{

    "ErrorCode": 0,

    "ErrorMessage": null,

    "Data": [

        {

            "Description": "The Scada Buffer Data Store.",

            "Id": "39B39D42-DC7A-4048-9BA8-E4BAB4644B0C",

            "IsDefault": false,

            "IsSystem": false,

            "Name": "ScadaBuffer",

            "NumberOfTags": 0,

            "State": 2,

            "DHSStorageName": "xyz",

            "StorageType": 1,

            "Links": [

                {

                    "Rel": "self",

                    "Href": "/datastore/ScadaBuffer"

                }

            ]

        },

        {

            "Description": "The DHS System Data Store.",

            "Id": "56C1DFE9-D0BF-427F-B5D8-B127E38B5C11",

            "IsDefault": false,

            "IsSystem": false,

            "Name": "DHSSystem",

            "NumberOfTags": 0,

            "State": 2,

            "DHSStorageName": "xyz",

            "StorageType": 0,

            "Links": [

                {

                    "Rel": "self",

                    "Href": "/datastore/DHSSystem"

                }

            ]

        },

        {

            "Description": "The User Data Store.",

            "Id": "33BA016D-B005-4702-96DB-42CF7238C8FF",

            "IsDefault": true,

            "IsSystem": false,

            "Name": "User",

            "NumberOfTags": 5,

            "State": 2,

            "DHSStorageName": "xyz",

            "StorageType": 0,

            "Links": [

                {

                    "Rel": "self",

                    "Href": "/datastore/User"

                }

            ]

        }

    ]

}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN> 
https://<historianservername>/historian-rest-api/v1/storage/datastores?storageName=xx
Table 69. Query Parameters
Parameter Description Required? Values
storageName The name of the location whose data stores you want to view. Yes String
Table 70. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
The Add Datastore API
Using the Add Datastore API, you can create a data store in a Historian server.
METHOD POST
URI
https://<historianservername>/historian-rest-api/v1/datastoretostorage
SAMPLE PATH PARAM GET URI
https://<historianservername>/historian-rest-api/v1/datastoretostorage

Payload

{

"dataStoreName": "abc",

"storageName": "storage1",

"description": "test",

"isDefault": true

}
SAMPLE RESPONSE
{

    "ErrorCode": 0,

    "ErrorMessage": null

}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -i -H "Content-Type: application/json"
-H "Authorization: Bearer <TOKEN> -d ???{ \???dataStoreName \???:\???name\???,\" storageName \": \"sname\",\"description 
\":\" des\",\" isDefault \":false} 
-X POST https://<historianservername>/historian-rest-api/v1/datastoretostorage
Table 71. Query Parameters
Parameter Description Required? Values
Payload Contains the details of the data store in the JSON format. Yes Multiple
Table 72. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
The Delete Data Store API
Using the Delete Data Store API, you can delete a data store.
METHOD DELETE
URI
https://<historianservername>/historian-rest-api/v1/datastore
SAMPLE URI
https://<historianservername>/historian-rest-api/v1/datastore

Payload

{

"dataStoreName": ""

}
SAMPLE RESPONSE
{

    "ErrorCode": 0,

    "ErrorMessage": null

}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -i -H "Content-Type: application/json"
-H "Authorization: Bearer <TOKEN> -d ???{ \???dataStoreName \???:\???name\???} -X DELETE
https://<historianservername>/historian-rest-api/v1/datastore
Table 73. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
The Data Store Update API
Using the Data Store Update API, you can modify a data store.
METHOD PUT
URI
https://<historianservername>/historian-rest-api/v1/dataStore/<data store name>
SAMPLE URI
https://<historianservername>/historian-rest-api/v1/dataStore/mirror1DS1
Payload

{

            "Description": "testing",

            "Id": "5761BCBF-A04D-494F-AE6E-30F8652F4B96",

            "IsDefault": true,

            "IsSystem": false,

            "Name": "mirror1DS1",

            "NumberOfTags": 0,

            "State": 2,

            "DHSStorageName": "mirror1",

            "StorageType": 0,

            "Links": [

                {

                    "Rel": "self",

                    "Href": "/datastore/mirror1DS1"

                }

            ]

        }
SAMPLE RESPONSE
{

    "ErrorCode": 0,

    "ErrorMessage": null

}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -i -H "Content-Type: application/json"
-H "Authorization: Bearer <TOKEN> -d ???{ \ Description\???:\???des\???,\"IsDefault \": true,
\ IsSystem \???:false, \ Name\???:\ mirror1DS1\???,\???NumberOfTags \???:0,\???State\???:2,
\???DHSStorageName\???:\???mirror1\???,\???StorageType \???:0,\???Links\???: [{\"Rel\":\"self\",
\"Href\": \"/datastore/mirror1DS1\" }]} -X PUT https://<historianservername>/historian-rest-api/v1/dataStore/mirror1DS1
Table 74. Query Parameters
Parameter Description Required? Values
Payload Contains the values of the attributes of the data store that you want to change. Yes Multiple
Table 75. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
The Default Data Store Update API
Using the Default Data Store Update API, you can change the default data store.
METHOD PUT
URI
https://<historianservername>/historian-rest-api/v1/storage/<location name>
SAMPLE URI
https://<historianservername>/historian-rest-api/v1/storage/NPI212611749M1

Payload

{

            "StorageName": "NPI212611749M1",

            "StorageType": 0,

            "NumberOfDataStores": 5,

            "NumberOfArchivers": 1,

            "DataStores": [

                "User",

                "testDS1",

                "ScadaBuffer",

                "testDS2",

                "DHSSystem"

            ],

            "Id": "9CD06AFB-1566-4CE6-99D4-B2F65857F33A",

            "IsDefault": true,

            "LastModifiedUser": null,

            "LastModifiedTime": "1970-01-01T00:00:00.000Z",

            "ArchiverServices": [                

             "DataArchiver_NPI212611749M1", "DataArchiver_distamchine1"

            ]

        }

}
SAMPLE RESPONSE
{

    "ErrorCode": 0,

    "ErrorMessage": null,

   }
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -i -H "Content-Type: application/json"
-H "Authorization: Bearer <TOKEN> -d ???{ \???StorageName\???:\???name\???,\"StorageType\": 0,
\???NumberOfDataStores\???:5,\ NumberOfArchivers\???:1,

\???IsDefault\???:true,\???ArchiverServices\???: [\"DataArchiver_NPI212611749M1\", 
\"DataArchiver_distamchine1"\"]} -X PUT 
https://<historianservername>/historian-rest-api/v1/storage/NPI212611749M1
Table 76. Query Parameters
Parameter Description Required? Values
Payload Contains the values of the attributes of the default data store that you want to change. Yes Multiple
Table 77. Response Parameters
Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.

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://<historianservername>:8443/historian-rest-api/v1/tags/{nameMask}/{maxNumber}
SAMPLE URI https://<historianservername>:8443/historian-rest-api/v1/tags?nameMask=*&maxNumber=100
SAMPLE cURL COMMAND curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN>??? https://<nodename>:8443/ historian-rest-api/v1/tags?nameMask=*&maxNumber=<Number_Of_Tags>
Table 78. 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 79. 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 Tagslist API

The Tags List API GET method retrieves the list of tags.

When retrieving large tag lists from Historian, you can paginate the response, allowing you to get the next page, go the end, go back one page, and go to the beginning.

Request Parameters

You can use wildcards (*, &,?) with string parameters for pattern matching. Results are sorted in ascending tag names. All parameters use the AND operator. The OR operator is not supported.

All request parameters are optional.

When there are NO wildcard characters (*, &,?) with string parameters for pattern matching, then search would be a contains search

Example: ???dog??? pattern will match ???dog1???, ???dog2???,???dogs???, ???dogx???, ???dog12???, ???dogs are faithful???, ???1dog1 and so on. When wildcards (*,&, ?) are used in the search string parameters for pattern matching, then they work as per the wildcard character definition.

? - Single character matching

* - Multi character matching

Eg1: ???dog???? pattern will match: ???dog1???, ???dog2???,???dogs???, ???dogx and so on but not ???dog12 or ???dogs are faithful

Eg2: ???dog* pattern will match ???dog1???, ???dog2???,???dogs???, ???dogx???, ???dog12???, ???dogs are faithful and so on but not ???1dog1

Parameter Name Data Type Default Description
calctype Integer -1 Returns exact match of calc type (0,1,2).
collectiondisabled Boolean If ignored, all types considered. Must be only true / false, else error out.
collectioninterval Integer 0 means all intervals If collectorinterval = 0 consider all intervals, else exact match.
collectorcompression Boolean * Returns exact match of collector compression (true/false).
collectorname String * Default * means consider all.
collectortype Integer 0 means consider all collector types Returns exact match of collector type.
comment String * Default * means consider all.
data storename String * Default * means consider all.
datatype Integer 0 means consider all data types Returns exact match of data type.
description String * Default * means consider all.
egudescription String * Default * means consider all.
enumeratedset String * Default * means consider all.
hasalias Boolean If ignored, all types considered. Must be only true / false, else error out.
isstale Boolean If ignored, all types considered. Must be only true / false, else error out.
lastmodified String 1970-01-01T00:00:00.000Z >= is applied so that last modified tag is returned in the result set.
lastmodifieduser String * Default * means consider all.
numberofelements Integer 0 If 0, ignore this parameter else returns exact match of number of elements.
pageno Integer 1

Must be > 1

If invalid, no data is returned.
pagesize Integer 128

Max 512

Min 2

If out of range, returns error.
sourceaddress String * Default * means consider all.
tagname String * Default * means consider all.
userdefinedtypename String * Default * means consider all.

The Tags List Pagination Parameters

When retrieving large tag lists from Historian, you can paginate the response, allowing you to get the next page, go the end, and go back on page and to the beginning. Results with no errors return these pagination parameters:
Parameter Value
pagesize Current page size.
pageno Current page number
totalcount Total result other than current page.
Links to URLs All URLs are part of the HTTP response headers.
  • first First page tags list URL (can be null if count is 0).
  • last - Last page tags list URL (can be null if count is 0).
  • prev Previous page tags list URL (can be null if current page is 1).
  • Next - Next page tags list URL (can be null if current page is last page).
Table 80. Sample cURL commands
METHOD GET
SAMPLE cURL COMMAND: [lastmodified] curl -i -H "Accept: application/json" -H "Authorization:Bearer <TOKEN>??? http://<nodename>:8443/historian-rest-api/v1/tagslist?lastmodified=2017-05-01T00:00:00.00Z
SAMPLE cURL COMMAND: [pageno=0] curl -i -H "Accept: application/json" -H "Authorization:Bearer <TOKEN>??? http://<nodename>:8443/historian-rest-api/v1/tagslist?pageno=0
SAMPLE cURL COMMAND: [pageno=1] curl -i -H "Accept: application/json" -H "Authorization:Bearer <TOKEN>??? http://<nodename>:8443/historian-rest-api/v1/tagslist?pageno=1
SAMPLE cURL COMMAND: [complete tagslist] curl -i -H "Accept: application/json" -H "Authorization:Bearer <TOKEN>??? http://<nodename>:8443/historian-rest-api/v1/tagslist

Example Queries

The following request returns first page as pageno is ignored and pagesize is defaulted to 128, all tags are considered:
<baseurl>/v1/tagslist
The following request returns first page as pageno is ignored and pagesize is defaulted to 128, all tags are considered that are modified after 2017-05-01T00:00:00.00Z.
<baseurl>/v1/tagslist?lastmodified=2017-05-01T00:00:00.00Z

Example Results

The following info is returned for each tag from the criteria provided in the request as an array of tag info.
  • tagid - String
  • tagname - String
  • description - String
  • datatype - Integer
  • collectorname - String
  • collectortype - Integer
  • data storename - String
  • egudescription - String
  • comment - String
  • sourceaddress - String
  • sourceaddress - String
  • collectioninterval - Integer
  • collectorcompression - Boolean
  • lastmodifieduser - String
  • enumeratedset - String
  • userdefinedtypename - String
  • calctype - Integer
  • isstale - Boolean
  • lastmodified - Long
  • lastmodified - Long
  • lastmodifiedString String In readable format
  • has alias - Boolean
  • numberofelements - Integer
  • collectiondisabled - Boolean
Example:
{
	"TotalCount": 1031,
	"Page": 1,
	"PageSize": 4,
	"Tags": [
		{
			"Tagid": "adb70ebf-978f-46dd-ac6f-5e863cdb0739",
			"Tagname": "-anilgwxb.Constant",
			"Description": "anilgwxb.Constant",
			"DataType": 3,
			"CollectorName": "ANILGWXB_Simulation",			
			"CollectorType": 2,
			"DataStoreName": "User",
			"EngineeringUnits": "",
			"Comment": "",
			"SourceAddress": "$Constant",
			"CollectionInterval": 1000,
			"CollectorCompression": false,
			"LastModifiedUser": null,
			"EnumeratedSetName": "",
			"UserDefinedTypeName": "",
			"CalcType": 0,
			"IsStale": false,
			"HasAlias": false,
			"NumberOfElements": 0,
			"CollectionDisabled": false,
			"LastModified": 1496992712,
			"LastModifiedString": "2017-06-09T07:18:32Z"
		},
		{
			"Tagid": "88e1f448-643f-465a-95c2-d2bd08870547",
			"Tagname": "anilgwxb.Constant_1%Noise",
			"Description": "anilgwxb.Constant_1%Noise",
			"DataType": 3,
			"CollectorName": "ANILGWXB_Simulation",
			"CollectorType": 2,
			"DataStoreName": "User",
			"EngineeringUnits": "",
			"Comment": "",
			"SourceAddress": "$Constant_1%Noise",
			"CollectionInterval": 1000,
			"CollectorCompression": false,
			"LastModifiedUser": null,
			"EnumeratedSetName": "",
			"UserDefinedTypeName": "",
			"CalcType": 0,
			"IsStale": false,
			"HasAlias": false,
			"NumberOfElements": 0,
			"CollectionDisabled": false,
			"LastModified": 1496992712,
			"LastModifiedString": "2017-06-09T07:18:32Z"
			},
<SNIP>
	],
	"Links": {
		"first": "https://anilgwxb:8443/historian-rest-api/v1/tagslist?pageno=1&pagesize=4",
		"last": "https://anilgwxb:8443/historian-rest-api/v1/tagslist?pageno=258&pagesize=4",
		"prev": null,
		"next": "https://anilgwxb:8443/historian-rest-api/v1/tagslist?pageno=2&pagesize=4"
	}
}
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://<historianservername>:8443/historian-rest-api/v1/datapoints/raw/{tagNames}/{start}/{end}/{direction}/{count}
POST
https://<historianservername>:8443/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://<historianservername>:8443/historian-rest-api/datapoints/raw/tagName1/2013-10-02T11:30:00.111Z/2013-10-02T11:31:11.111Z/0/100https://<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/0https://<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/100https://<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/0https://<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>
Table 81. 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 82. 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://<historianservername>:8443/historian-rest-api/v1/datapoints/interpolated/{tagNames}/{start}/{end}/{count}/{intervalMs}
POST
https://<historianservername>:8443/historian-rest-api/v1/datapoints/interpolated/{start}/{end}/{count}/{intervalMs}
SAMPLE GET URI: https://<historianservername>:8443/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://<historianservername>:8443/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://<nodename>:8443/ 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://<nodename>:8443/ historian-rest-api/v1/ datapoints/interpolated/<start time>/<end time>/<count>/<intervalMS>
Table 83. 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 84. 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://<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
Table 85. Query Parameters
Parameter Description Required? Values
TagNames Queries the specified tag names. Yes String
Table 86. 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://<historianservername>:8443/historian-rest-api/v1/datapoints/calculated/{tagNames}/{start}/{end}/{calculationMode}/{count}/{intervalMs}
POST
https://<historianservername>:8443/historian-rest-api/v1/datapoints/calculated/{start}/{end}/{calculationMode}/{count}/{intervalMs}
SAMPLE GET URI:
Number of Samples
https://<historianservername>:8443/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://<historianservername>:8443/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://<historianservername>:8443/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://<historianservername>:8443/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://<nodename>: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://<nodename>:8843/ historian-rest-api/v1/ datapoints/calculated/<start time>/<end time>/<count>/<calculationmode>/<intervalMS>
Table 87. 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 88. 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://<historianservername>:8443/historian-rest-api/v1/datapoints/sampled
POST
https://<historianservername>:8443/historian-rest-api/v1/datapoints/sampled
SAMPLE GET URI: https://<historianservername>:8443/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://<historianservername>:8443/historian-rest-api/v1/datapoints/sampled
SAMPLE cURL COMMAND (GET): curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN>??? http://<nodename>:8443/ 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://<nodename>:8443/historian-rest-api/v1/datapoints/sampled
Table 89. 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 90. 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://<historianservername>:8443/historian-rest-api/v1/datapoints/trend
POST
https://<historianservername>:8443/historian-rest-api/v1/datapoints/trend
SAMPLE GET URI:
https://<historianservername>:8443/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://<historianservername>:8443/historian-rest-api/v1/datapoints/trend
SAMPLE cURL COMMAND (GET): curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN>??? http://<nodename>:8443/ 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://<nodename>:8443/historian-rest-api/v1/datapoints/trend
Table 91. 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 92. 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://<historianservername>:8443/historian-rest-api/v1/tags/addtag
SAMPLE DELETE URI:
https://<historianservername>:8443/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://<historianservername>:8443/historian-rest-api/v1/tags/addtag
Table 93. 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://<historianservername>:8443/historian-rest-api/v1/tags/addtags
SAMPLE DELETE URI:
https://<historianservername>:8443/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://<historianservername>:8443/historian-rest-api/v1/tags/addtags
Table 94. 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 95. 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://<historianservername>:8443/historian-rest-api/v1/tags/properties/tagName
SAMPLE DELETE URI:
https://<historianservername>:8443/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://<historianservername>:8443/historian-rest-api/v1/tags/properties/tagName
Table 96. 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 97. 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://<historianservername>:8443/historian-rest-api/v1/tags/properties/tagName

This URI returns all tag properties.

URI: (POST) https://<historianservername>:8443/historian-rest-api/v1/tags/properties/tagName
Payload

{
"PropertyName1" : 1,
"PropertyName2" : 1
}
SAMPLE GET URI: https://<historianservername>:8443/historian-rest-api/v1/tags/properties/tagName
SAMPLE POST URI:
https://<historianservername>:8443/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://<historianservername>:8443/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://<historianservername>:8443/historian-rest-api/v1/tags/properties/tagName
Table 98. 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 99. 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://<historianservername>:8443/historian-rest-api/v1/tags/tagName?{permanentDelete}
SAMPLE DELETE URI: https://<historianservername>:8443/historian-rest-api/v1/tags/tagName?permanentDelete=true
SAMPLE CURL COMMAND: curl -i -H "Authorization: Bearer <TOKEN>??? -X DELETE https:// <historianservername>:8443/historian-rest-api/v1/tags/tagName?permanentDelete=<true|false>
Table 100. 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 101. 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://<historianservername>:8443/historian-rest-api/v1/datapoints/ configuration/{maxDataQueryResultSize}
SAMPLE URI: https://<historianservername>:8443/historian-rest-api/v1/datapoints/ configuration?maxDataQueryResultSize=6000
SAMPLE CURL COMMAND: curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN>??? https://<nodename>:8443/ historian-rest-api/v1/datapoints/configuration? maxDataQueryResultSize=<Number_Of_Query_Results>
Table 102. 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://<historianservername>:8443/historian-rest-api/v1/tags/tagrename/oldtagname/newtagname?{truerename}
SAMPLE URI https://<historianservername>:8443/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://<historianservername>:8443/historian-rest-api/v1/tags/tagrename/<oldtagname>/<newtagname>?truerename=<true | false>
Table 103. 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 104. 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://<historianservername>:8443/historian-rest-api
                /v1/datapoints/create
SAMPLE URI
https://<historianservername>:8443/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://<historianservername>:8443/historian-rest-api/v1/datapoints/create

Table 105. 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 106. 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.