Welcome to Kepware Server > Configuration API Service > Configuring Tags > Configuration API Service — Updating a Tag
Configuration API Service — Updating a Tag
Configuration API Service — Updating a Tag
To update a property or collection of properties on a tag, a GET request must first be sent to the endpoint to be updated to get the Project ID.
 
For more information about the Project ID see the Concurrent Clients section.
 
In the example below, the tag being updated is MyTag under Channel1/Device1.
 
Endpoint (GET):
https://<hostname_or_ip>:<port>/config/v1/project/channels/Channel1/devices/Device1/tags/MyTag
 
The GET request will return a JSON blob similar to the following.
 
Body:
{  "PROJECT_ID": <project_ID_from_GET>,  "common.ALLTYPES_NAME": "MyTag",  "common.ALLTYPES_DESCRIPTION": "",  "servermain.TAG_ADDRESS": "R0005",  "servermain.TAG_DATA_TYPE": 5,  "servermain.TAG_READ_WRITE_ACCESS": 1,  "servermain.TAG_SCAN_RATE_MILLISECONDS": 100,…
To update or change a tag property, a PUT request is sent to the tag with the Project ID and the new property value defined.
In the following example, the tag name will change from MyTag (from above) to Tag1.
 
Endpoint (PUT):
https://<hostname_or_ip>:<port>/config/v1/project/channels/Channel1/devices/Device1/tags/MyTag
 
Body:
{  "PROJECT_ID": <project_ID_from_GET>,  "common.ALLTYPES_NAME": "Tag1"}
 
Following the PUT a GET can be sent to the tag’s endpoint to validate that the property changed. In this case, because the name was changed, the endpoint also changed and the GET request would be the following.
 
Endpoint (GET):
https://<hostname_or_ip>:<port>/config/v1/project/channels/Channel1/devices/Device1/tags/Tag1
 
The response from the GET request will show the property value has changed. The response to the GET above should look similar to the following.
 
Body:
{  "PROJECT_ID": <project_ID_from_GET>,  "common.ALLTYPES_NAME": "Tag1",  "common.ALLTYPES_DESCRIPTION": "",  "servermain.TAG_ADDRESS": "R0005",  "servermain.TAG_DATA_TYPE": 5,  "servermain.TAG_READ_WRITE_ACCESS": 1,  "servermain.TAG_SCAN_RATE_MILLISECONDS": 100,…
 
Was this helpful?