The "listThings" action lists things that match specified filter criteria. The results are returned as an array of objects. You can identify a thing by its ID or "thingName". The "returnThingsBy" property controls how the response identifies things.
Request examples
Minimal
{
"action": "listThings",
"params": {
"returnThingsBy": "id"
},
"authToken": "replaceWithAuthTokenFromCreateSession"
}Maximal
{
"api": "hub",
"action": "listThings",
"params": {
"returnThingsBy": "name",
"thingNameFilter": "My Dev",
"manufacturerFilter": [ "Siemens", "Rockwell" ],
"modelFilter": [ "ACME-123", "model2" ],
"serialNumberFilter": "AB678",
"thingTypeFilter": [ "ACME Temperature Sensor" ],
"purposeFilter": [ "Stamper temperature" ],
"locationFilter": [ "factory1/line1/station1" ],
"lifecycleLabelsFilter": ["out-of-warranty", "deprecated"],
"hostnamesFilter": [ "127.0.0.1" ],
"statusFilter": ["active", "inactive"],
"connectionStatusFilter": ["connected", "disconnected"]
},
"responseOptions": {
"binaryFormat": "hex",
"numberFormat": "string",
"variantFormat": "variantObject"
},
"authToken": "replaceWithAuthTokenFromCreateSession",
"requestId": "1",
"debug": "none"
}
Response examples
Minimal
{
"authToken": "replaceWithAuthTokenFromCreateSession",
"result": {
"returnThingsBy": "id",
"ids": [ 1, 2 ]
},
"errorCode": 0,
"errorMessage": ""
}Maximal
{
"authToken": "replaceWithAuthTokenFromCreateSession",
"result": {
"returnThingsBy": "name",
"thingNames": [ "My Device", "Changed Name" ]
},
"errorCode": 0,
"errorMessage": ""
}
Properties
Request properties ("params")
| Property | Description | Default | Type | Limits (inclusive) |
|---|---|---|---|---|
connectionStatusFilter |
The |
Optional with default of []
|
array |
|
hostnamesFilter |
The
Because the API does not prevent the same hostname from being assigned to many things, it may return multiple things assigned to the same hostname. |
Optional with default of []
|
array of strings | Array containing zero or more hostnames. |
lifecycleLabelsFilter |
The "lifecycleLabelsFilter" property filters the results by the specified lifecycleLabels. An empty array matches all things. |
Optional with default of [] | array of strings |
Array containing zero or more lifecycleLabel strings.
|
locationFilter |
The "locationFilter" property filters results by the value of the "location" property. Each string is a partial or complete location name, such as, "locationFilter": [ "myLoca", "factory2-line6-station1" ]. The action returns things that match at least one item in the array, provided it also satisfies all other specified filter properties. |
Optional with default of []
|
array | zero or more location strings. |
manufacturerFilter |
The "manufacturerFilter" property filters results by the value of the "manufacturer" property. Each string is a partial or complete manufacturer name, such as, "manufacturerFilter": [ "Siem", "Rockwell" ]. The action returns things that match at least one item in the array, provided it also satisfies all other specified filter properties. |
Optional with default of []
|
array | zero or more manufacturer strings |
modelFilter |
The "modelFilter" property filters results by the value of the "model" property. Each string is a partial or complete model name, such as "modelFilter": [ "ACME-123", "mod_" ]. The action returns things that match at least one item in the array, provided it also satisfies all other specified filter properties. |
Optional with default of []
|
array | zero or more model 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 |
returnThingsBy |
The "returnThingsBy" property specifies whether to returns things identified by ID or "name". |
Optional with default of null
|
string enum |
|
serialNumberFilter |
The "serialNumberFilter" property specifies a complete or partial serial number, such as, "serialNumberFilter": "AB678". The action returns things that match the serial number, provided it also satisfies all other specified filter properties. |
Optional with default of ""
|
string | 1 to 64 bytes |
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, |
thingNameFilter |
The "thingNameFilter" property specifies a partial or full name of a thing to describe. The action returns things that match the specified partial or full name of the thing, provided it satisfies all other specified filter properties. |
Optional with default of ""
|
string | 1 to 64 bytes |
thingTypeFilter |
The "thingTypeFilter" property filters the results by the value of the "thingType" property. Each string is a partial or complete type, such as, "thingTypeFilter": [ "myTy", "PLC" ]. The action returns things that match at least one item in the array, provided it also satisfies all other specified filter properties. |
Optional with default of []
|
array of strings | zero or more type strings |
Response properties ("result")
| Property | Description | Type | Limits (inclusive) |
|---|---|---|---|
ids |
The
|
array | 0 or more ids |
returnThingsBy |
The "returnThingsBy" property is an enumerated string with the following values: "name" and "id". It is used by the "listThings" action to specify whether it returns things identified by ID or "name". |
string enum |
|
thingNames |
The "thingNames" property is an array of strings that specifies one or more thing names. Each item in the array is the exact name of a thing. You can use it to describe or delete things. |
array of strings | 1 or more thingName strings |