08 Feb 2023 01:01 PM - last edited on 08 Feb 2023 02:03 PM by Ana_Kuzmenchuk
I'm trying to use the Python dt module to set custom tags but I keep running into an error saying some problem with the tags parameter like "AttributeError: 'dict' object has no attribute 'to_json'". The custom_tags.post function contains the following value for the parameter: (parameter) tags: List[AddEntityTags]. I'm probably missing something simple but what is the List type that's expected? I can do this with no problem using curl but I can't seem to use the dt module.
Solved! Go to Solution.
01 Mar 2023 11:20 AM
Hi @jstrick ,
try passing the tags as follows:
tag_list = [AddEntityTags("tag-key", "tag-value")]
dt.custom_tags.post("type(custom_device),entityName(TEST)", tag_list)