thing.search

The thing.search command is used to find a list of things matching specific search criteria.

TR50 Request

{
  "cmd": {
    "command": "thing.search",
    "params": {
      "query": "*device_manager**",
      "limit": 1,
      "offset": 0,
      "sort": "+name"
    }
  }
}

Request Parameters

Name

Type

Required

Description

query

String

Yes

The search criteria used to return matching things. The criteria is any value of a field in a thing. The at (@) symbol is considered a word delimiter and creates an OR condition in the search. For example, "attrs.email.value:"john.doe@telit.com". For information about the query syntax, see Searching for Things.

show

Array

 

An array of field names of the data columns to return. Returns a list of valid options in the fields entry in the response structure.

offset

Integer

 

The starting list offset, used for pagination. Defaults to zero if not specified.

limit

Integer

 

Limits the number of results returned. Defaults to the maximum configured size.

sort

String

 

A string indicating the direction (plus (+) for ascending and minus (-) for descending) and column by which to sort the results. To sort by the key descending, use -key. Defaults to +name.

hideFields

Boolean

 

If set to true, the response does not include the fields in the response parameters.

TR50 Response

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

{
    "1": {
        "success": true,
        "params": {
            "count": 7,
            "fields": [
                "id",
                "key",
                "name",
                "ownerOrgId",
                "permission",
                "defKey",
                "defName",
                "gateway",
                "iccid",
                "esn",
                "meid",
                "imei",
                "imsi",
                "connected",
                "lastSeen",
                "lastCommunication",
                "loc",
                "proto",
                "remoteAddr",
                "data",
                "properties",
                "alarms",
                "attrs",
                "createdOn",
                "updatedOn",
                "apiCounts.daily",
                "apiCounts.monthToDate",
                "apiCounts.total",
                "storage",
                "varBillingPlanCode",
                "varVasPackageCode"
            ],
            "result": [
                {
                    "alarms": {},
                    "apiCounts": {
                        "daily": 10,
                        "monthToDate": 10,
                        "total": 10
                    },
                    "attrs": {
                        "architecture": {
                            "ts": "2017-12-13T16:43:29.39Z",
                            "since": "2017-12-13T16:43:29.39Z",
                            "value": "x86_64"
                        },
                        "hdc_version": {
                            "ts": "2017-12-13T16:43:29.39Z",
                            "since": "2017-12-13T16:43:29.39Z",
                            "value": "17.12.6"
                        },
                        "hostname": {
                            "ts": "2017-12-13T16:43:29.39Z",
                            "since": "2017-12-13T16:43:29.39Z",
                            "value": "YOW-JKEFFER-LX2"
                        },
                        "kernel": {
                            "ts": "2017-12-13T16:43:29.39Z",
                            "since": "2017-12-13T16:43:29.39Z",
                            "value": "4.4.0-31-generic"
                        },
                        "mac_address": {
                            "ts": "2017-12-13T16:43:29.409Z",
                            "since": "2017-12-13T16:43:29.409Z",
                            "value": "08:00:27:A2:5A:9B"
                        },
                        "os_name": {
                            "ts": "2017-12-13T16:43:29.39Z",
                            "since": "2017-12-13T16:43:29.39Z",
                            "value": "Ubuntu (GNU\/Linux)"
                        },
                        "os_version": {
                            "ts": "2017-12-13T16:43:29.39Z",
                            "since": "2017-12-13T16:43:29.39Z",
                            "value": "16.04-xenial"
                        }
                    },
                    "connected": false,
                    "createdOn": "2017-12-13T16:43:18.784Z",
                    "defKey": "hdc_device_manager_def",
                    "defName": "hdc_device_manager_def",
                    "id": "5a3158a62cd8695431efdd3b",
                    "key": "007d9d6b-29f0-3456-9fec-8fa9ec448179-device_manager_py",
                    "lastCommunication": "2017-12-14T01:49:16.894Z",
                    "lastSeen": "2017-12-14T01:49:16.894Z",
                    "name": "auto:006d9d6b-29f0-4472-9fec-8fa9ec448179-device_manager_py",
                    "ownerOrgId": "5f1598f3153a552f355208d0",
                    "permission": "rw",
                    "properties": {},
                    "storage": 3884,
                    "updatedOn": "2017-12-13T16:43:18.784Z",
                    "varBillingPlanCode": "",
                    "varVasPackageCode": ""
                }
            ]
        }
    }
}

Response Parameters

Name

Type

Description

count

Integer

The total number of matching things.

fields

Array

An array of field names of data columns that can be 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 definition of the thing.

defName

String

The name of the thing definition of the thing.

tags

Array

The tags assigned to this thing.

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

Whether the thing is currently connected to the platform.

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 the thing was created.

updatedOn

String

The date 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.

storage

Integer

The amount of storage used (in bytes).