Tags
- Last UpdatedMar 19, 2025
- 3 minute read
|
Description |
Using the GET verb, retrieves tag metadata. For version 2, this also includes tag extended properties. Using the POSTverb, manages multiple tags at once. Using the DELETE verb, deletes a specified tag. |
|
URL |
/Tags |
|
Methods |
GET POST DELETE |
|
Required Parameters |
|
|
Optional Parameters |
|
|
Optional Parameters |
|
Get tags
|
Sample Query |
Scenario 1 This query lists tag metadata for all tags in all data sources for your Insight solution.
https://online.wonderware.[DOMAINSUFFIX]/s/ik97r5/apis/historian/v2/Tags Scenario 2 This query lists metadata for tags in a particular data source. The data source in this example is named Baytown.
https://online.wonderware.[DOMAINSUFFIX]/s/ik97r5/apis/historian/v2/Tags?$filter=Source+eq+'Baytown' |
|
Sample Output |
{ @odata.context: "https://online.wonderware.[DOMAINSUFFIX]/s/ik97r5/apis/Historian/v2/$metadata#Tags", value: [ { FQN: "14th aug app.Auto", Source: "14th aug app", Description: "Automatic mode", EngUnit: "", EngUnitMax: 0, EngUnitMin: 0, InterpolationType: "None", MessageOff: "Manu", MessageOn: "Auto", TagName: "Auto", TagType: "Discrete", Alias: "nareshtag-discrete", Location: "/Application Tag 2", Raw@odata.navigationLink: Minutely@odata.navigationLink: Hourly@odata.navigationLink: "https://online.wonderware.[DOMAINSUFFIX]/s/ik97r5/apis/Historian/v2 Daily@odata.navigationLink: } ], @odata.nextLink: "https://online.wonderware.[DOMAINSUFFIX]/s/ik97r5/apis/Historian/v2/Tags } |
Delete a tag
|
Sample Query |
This query deletes a tag named Weather.Brisbane.Cloudiness.
DELETE /Historian/v2/Tags('Weather.Brisbane.Cloudiness') HTTP/1.1 Host: nchdevruntime.cloudapp.net:8080 Content-Type: application/json { "delete": { "FQN":["datasourcename.tagname"] } } |
Manage multiple tags
|
Sample Query |
Scenario 1: Bulk query This query retrieves multiple tags.
POST /Historian/v2/Tags HTTP/1.1 Host: nchqaruntime.cloudapp.net:8080 Authorization: Basic ……. Content-Type: application/json Cache-Control: no-cache { "query": { "FQN":['Weather.Brisbane.Cloudiness','Weather.Auckland.Cloudiness'], "select":"FQN,TagName" } } Scenario 2: Bulk edit This makes updates to multiple tags. You can edit up to 100 tags at a time, with maximum of 50 properties per tag. Note: Historian Data REST API extended properties map to the AVEVA Historian SDK tag extended properties API. This makes updates to a tag's standard and extended properties.
POST /Historian/v2/Tags HTTP/1.1 Host: nchdevruntime.cloudapp.net:8080 Authorization: Basic … Content-Type: application/json Cache-Control: no-cache { "properties": [ { "FQN": "18Jul_kc.test1", "PropertyName": "Alias", "Text": "SysTimeSec", "Type": "String", "Searchable":false } } |
|
Sample Query |
Scenario 3: Bulk delete This deletes multiple tags.
POST /Historian/v2/Tags HTTP/1.1 Host: nchdevruntime.cloudapp.net:8080 Content-Type: application/json Cache-Control: no-cache { "delete": { "FQN":["datasourcename.tagname1", "datasourcename.tagname2"] } } |
|
Sample Output |
The output from a bulk edit includes results per tag. If any of a tag's properties is invalid, the tag fails and results in an error message. { "value": [ { "FQN": "System.Tag1", "$StatusCode": 200 }, { "FQN": "System.Tag2", "$StatusCode":500, "$ErrorMessage":"Alias property contains illegal characters" } ] } |