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

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.