The "listTags" action lists tags that match specified filter criteria. The results are returned as an array of objects. You can identify a tag by its ID or name. The "returnTagsBy" property controls how the response identifies tags.
The purpose of this action is to return a list of matching tags that you can use with other actions, such as "deleteTags" or "describeTags".
Request examples
Minimal
This example returns all tags.
{
"api": "hub",
"action": "listTags",
"params": {
"returnTagsBy": "id"
},
"authToken": "replaceWithAuthTokenFromCreateSession"
}
Maximal
This example returns tags that match the optional filter criteria.
{
"api": "hub",
"action": "listTags",
"params": {
"returnTagsBy": "tagName",
"tagNameFilter": "My Dev",
"tagDataTypeFilter": [ "string" ],
"statusFilter": [ "active", "inactive" ],
"purposeFilter": [ "Stamper temperature" ],
"labelsFilter": [ "temperature", "pressure" ],
"connectorIdFilter": [ 51, 52 ],
"thingIdFilter": [ 1 ],
"integrationTableIdFilter": [ 1 ],
"topicIdFilter": [ 1 ]
},
"responseOptions": {
"numberFormat": "string"
},
"authToken": "replaceWithAuthTokenFromCreateSession",
"requestId": "1",
"debug": "none"
}
Response examples
Minimal
{
"authToken": "replaceWithAuthTokenFromCreateSession",
"result": {
"returnTagsBy": "id",
"ids": [ 1, 2 ]
},
"errorCode": 0,
"errorMessage": ""
}
Maximal
{
"authToken": "replaceWithAuthTokenFromCreateSession",
"result": {
"returnTagsBy": "tagName",
"tagNames": [ "My Device", "Changed Name" ]
},
"errorCode": 0,
"errorMessage": ""
}
Properties
Request properties ("params")
| Property | Description | Default | Type | Limits (inclusive) |
|---|---|---|---|---|
connectorIdFilter |
The "connectorIdFilter" property filters the response by the specified unique integer ID of a connector. The "listTags" action includes the tag associated with the specified connector. |
Optional with default of []
|
array | zero or more connector id integers |
integrationTableIdFilter |
The "integrationTableIdFilter" property specifies the unique integer ID of an integration table. The "listTags" action includes tags associated with the specified integration table. |
Optional with default of []
|
array of integers | zero or more integration table id integers |
labelsFilter |
The
The API allows the same label to be assigned to many tags. |
Optional with default of []
|
array of strings | zero or more label strings |
purposeFilter |
The "purposeFilter" property returns things that match at least one item in the array, provided it also satisfies all other specified filter properties. Each string is a partial or complete purpose, such as, "purposeFilter": [ "myPur", "Manage an Acid Bath" ]. |
Optional with default of []
|
array of strings | zero or more purpose strings |
returnTagsBy |
The "returnTagsBy" property specifies whether to return tags identified by ID or name. |
Optional with default of "id"
|
string enum |
|
statusFilter |
The
When using the tag actions, this property finds tags based on their status. You can include zero or more status values. The
|
Optional with default of []
|
array |
When using tag actions, |
tagDataTypeFilter |
The "tagDataTypeFilter" property specifies one or more tag data types. Each item in the array is the exact name of a tag data type. The "listTags" action returns tags that match one of the specified values. |
Optional with default of []
|
array of strings | 1 to 64 bytes |
tagNameFilter |
The "tagNameFilter" property specifies a partial or full name of a tag to describe. The action returns tags that match the partial or full name of the tag, provided it satisfies all other specified filter properties. |
Optional with default of ""
|
string | 1 to 64 bytes |
thingIdFilter |
The "thingIdFilter" property specifies zero or more unique integers ID of a thing which will be used to filter the results. The "listTags" action includes tags associated with the specified thing, which is a device or software application. |
Optional with default of []
|
array of integers | zero or more thing id integers |
topicIdFilter |
The "topicIdFilter" property specifies the unique integer ID of an MQTT topic. The "listTags" action includes tags associated with the specified topic. |
Optional with default of []
|
array of integers | zero or more topic id integers |
Response properties ("result")
| Property | Description | Type | Limits (inclusive) |
|---|---|---|---|
ids |
The
|
array | 0 or more ids |
returnTagsBy |
The "returnTagsBy" property is an enumerated string with the following values: "tagName" and “id".It is used by the "listTags" action to determine whether tags are returned by ID or by name. |
string enum |
|
tagNames |
The "tagNames" property is an array of strings that specifies one or more tag names. You can use it to describe or delete tags. Each item in the array is the exact name of a tag. |
string | 1 to 256 bytes |