thing.search

The thing.search command is used to find a list of things matching user-specified search criteria.

This command is executed while performing a search from the things page. For different query syntax options, see Using Search.

TR50 Request
{
  "cmd": {
    "command": "thing.search",
    "params": {
      "query": "auto*",
      "limit": 10,
      "offset": 0,
      "show": [
        "key",
        "name"
      ],
      "sort": "+name"
    }
  }
}

Request Parameters

Name Type Required Description
query String The query is any value of a field within a Thing which is the search criteria used to return matching things. An @ (at) symbol is considered a word delimiter and will create an OR condition in the search. For example, "attrs.email.value:"john.doe@telit.com"". For more information and few sample of the search criteria, see Using Search.
show Array An array of field names of the data columns to return. A list of valid options is returned in the fields entry in the response structure (see below).
offset Integer The starting list offset, used for pagination. Defaults to 0 if not specified.
limit Integer Limits the number of results returned. The maximum limit you can set is 2000. Defaults to 2000.
showCount Boolean   By default, it is set to true. If set to false, the response will not include the count. Setting it to false will improve the response time but you will not know the total size of the result set.
sort String A string indicated the direction (+ for ascending, - for descending) and column to sort the results by. To sort by the key descending, use "-key". Defaults to "+name".
hideFields Boolean If set to true, the response won't include the fields in the response parameters.
useSearch Boolean   When useSearch is set to true, it will improve the performance of the operation
In some cases there is a small delay between making changes and when they will be visible to the search database, this delay is typically less than 5 seconds. As such, if you perform an update call, and subsequently call a list, you may not see the results of your operation.
iterator String   iterator is used in conjunction with the useSearch to iterate through the returned results. Initial request should be given the value new. Further requests should be given the value got in from the response.For more information on iterator and useSearch, see the example in cdp.connection.list.

If the command is sent successfully a success message and the thing is returned. Otherwise, an error and error message will be returned.

TR50 Response
{
  "cmd": {
    "success": true,
    "params": {
      "count": 2,
      "field": [
        "id",
        "key",
        "name",
        "defKey",
        "defName",
        "gateway",
        "icid",
        "esn",
        "meid",
        "imei",
        "imsi",
        "connected",
        "lastSeen",
        "lastCommunication",
        "loc",
        "proto",
        "remoteAddr",
        "data",
        "properties",
        "alarms",
        "attrs",
        "createdOn",
        "updatedOn",
        "apiCounts.daily",
        "apiCounts.monthToDate",
        "apiCounts.total"
      ],
      "result": [
        {
          "id": "531c907b5d80f1330c238757",
          "key": "mything",
          "name": "My Thing",
          "type": "A Thing",
          "connected": true,
          "connectedId": "53404db65d80f12689016ed3",
          "connectedKey": "myconnectedthing",
          "lastSeen": "0001-01-01T00:00:00Z",
          "gateway": {
            "make": "unknown",
            "model": "unknown",
            "dwProduct": "DW-Gateway.Linux",
            "dwPlatform": "Linux-X86-Generic",
            "dwVersion": "14.1.0-014",
            "appVersion": "2.0",
            "remShell": true
          },
          "proto": "mqtt",
          "remoteAddr": "127.0.0.1:60709",
          "locWithin": {
            "": ""
          },
          "locUpdated": "2014-03-27T13:39:26.635-04:00",
          "loc": {
            "lat": 30.455,
            "lng": -84.253333,
            "acc": 0,
            "fixType": "unknown",
            "addr": {
              "streetNumber": "",
              "street": "1113 Buckingham Dr",
              "city": "Tallahassee",
              "state": "FL",
              "zipCode": "32308-5212",
              "country": "US"
            }
          }
        },
        ...
      ]
    }
  }
}

Response Parameters

Name Type Description
count Integer The total number of matching things.
fields Array An array of field names of data columns capable of being returned.
result Array The array of Thing objects.

Result Array Object

Name Type Description
id String The id of the thing.
key String The key of the thing.
name String The name of the thing.
defKey String The key of the thing's definition.
defName String The name of the thing's definition.
tags Array The tags assigned to this thing.
connected Bool Is the thing currently connected.
gateway Object
gateway.make String Brand of the gateway.
gateway.model String Model of the gateway.
gateway.dwProduct String deviceWISE product.
gateway.dwPlatform String deviceWISE platform.
gateway.dwVersion String deviceWISE version.
gateway.appVersion String deviceWISE application version.
gateway.remShell Boolean If the gateway supports remote shell.
iccid String The ICCID of the thing.
esn String The ESN of the thing.
meid String The MEID of the thing.
imei String The IMEI of the thing.
imsi String The IMSI of the thing.
connected Boolean If the thing is currently connected to the platform.
connectedId String If connected through a proxy, this field will contain the thing ID of the proxy.
connectedKey String If connected through a proxy, this field will contain the thing key of the proxy.
lastSeen String The last time the thing published data to the platform.
lastCommunication String The last time the thing indicated that it was still connected (the keep-alive heartbeat).
loc Object The array containing the location information.
loc.lat Float The latitude of the thing.
loc.lng Float The longitude of the thing.
loc.acc Integer The accuracy of the location.
loc.fixType String The method used to determine the location of the thing.
loc.addr Object The array containing the address information.
loc.addr.streetNumber String The street number.
loc.addr.street String The street.
loc.addr.city String The city.
loc.addr.state String The state.
loc.addr.zipCode String The zip code.
loc.addr.country String The country.
proto String Connection protocol.
remoteAddr String The remote address of the thing.
data Object Opaque data store object.
properties Object Current property values.
alarms Object Current alarm values.
attrs Object Current attribute values.
createdOn String The date when the thing was created.
updatedOn String The date when the thing was last updated.
apiCounts Object
apiCounts.daily Integer The number of API calls made since midnight UTC.
apiCounts.monthToDate Integer The number of API calls made since midnight UTC for the current month.
apiCounts.total Integer The number of API calls made for the lifetime of this thing.