Add Bulk Tags API

The Add Bulk Tags API provides the ability to add new tags to Historian using an array.

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

Query Parameters

ParameterDescriptionRequired?Values
PayloadJSON 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.

Response Parameters

ParameterData TypeExists?Description
TagNameStringYesTag name.
ErrorCodeIntegerYesFor example, 0.
ErrorMessageStringYesFor example, NULL.

Sample Payload

[
  {
    "Name": "tag1",
    "Description": 1
  },
  {
    "Name": "tag2",
    "DataType": 3,
    "Description": 3
  }
]

Sample Response

[
  {
    "TagName": "Tag1",
    "ErrorCode": 10,
    "ErrorMessage": "Fail to validate the tag Tag1 error is 'Invalid data type'"
  },
  {
    "TagName": "Tag2",
    "ErrorCode": 0,
    "ErrorMessage": ""
  }
]