Add Single Tag API

The Add Single Tag API provides the ability to add a new tag to Historian.

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

Query Parameters

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

Response Parameters

ParameterData TypeRequired?Description
ErrorCodeIntegerYesFor example, 0.
ErrorMessageStringYesFor example, NULL.

Sample Payload

{
"Name" : "tag1",
"DataType" : 3 ,
"Id": "F34CFE80-7428-41A1-AC67-DB0F3D2E1146"
}

Sample Response

{
"ErrorCode": 0,
"ErrorMessage": null
}