Menu
AWS IoT
Developer Guide

ListThings

Lists your things. Use the attributeName and attributeValue parameters to filter your things. For example, calling ListThings with attributeName=Color and attributeValue=Red retrieves all things in the registry that contain an attribute Color with the value Red.

Request syntax:

GET /things?maxResults=maxResults&nextToken=nextToken&attributeName=attributeName&attributeValue=attributeValue&thingTypeName=thingTypeName

URI Request Parameters:

Name

Type

Req?

Description

nextToken

NextToken

no

The token used to get the next set of results, or null if there are no additional results.

maxResults

RegistryMaxResults

no

The maximum number of results to return in this operation.

attributeName

AttributeName

no

The attribute name used to search for things.

attributeValue

AttributeValue

no

The attribute value used to search for things.

thingTypeName

ThingTypeName

no

The name of the thing type used to search for things.

Response syntax:

Content-type: application/json { "things": [ { "thingName": "string", "thingTypeName": "string", "thingArn": "string", "attributes": { "string": "string" }, "version": "long" } ], "nextToken": "string" }

Response Body Parameters:

Name

Type

Req?

Description

things

ThingAttributeList

no

The things.

nextToken

NextToken

no

The token used to get the next set of results, or null if there are no additional results.

Errors:

InvalidRequestException

The contents of the request were invalid. For example, this code is returned when an UpdateJobExecution request contains invalid status details. The message contains details about the error.

HTTP response code: 400

ThrottlingException

The rate exceeds the limit.

HTTP response code: 429

UnauthorizedException

You are not authorized to perform this operation.

HTTP response code: 401

ServiceUnavailableException

The service is temporarily unavailable.

HTTP response code: 503

InternalFailureException

An unexpected error has occurred.

HTTP response code: 500

CLI

Synopsis:

aws iot list-things \ [--next-token <value>] \ [--max-results <value>] \ [--attribute-name <value>] \ [--attribute-value <value>] \ [--thing-type-name <value>] \ [--cli-input-json <value>] \ [--generate-cli-skeleton]

cli-input-json format:

{ "nextToken": "string", "maxResults": "integer", "attributeName": "string", "attributeValue": "string", "thingTypeName": "string" }

cli-input-json fields:

Name

Type

Description

nextToken

string

The token used to get the next set of results, or null if there are no additional results.

maxResults

integer

java class: java.lang.Integer

range- max:250 min:1

The maximum number of results to return in this operation.

attributeName

string

length max:128

pattern: [a-zA-Z0-9_.,@/:#-]+

The attribute name used to search for things.

attributeValue

string

length max:800

pattern: [a-zA-Z0-9_.,@/:#-]*

The attribute value used to search for things.

thingTypeName

string

length max:128 min:1

pattern: [a-zA-Z0-9:_-]+

The name of the thing type used to search for things.

Output:

{ "things": [ { "thingName": "string", "thingTypeName": "string", "thingArn": "string", "attributes": { "string": "string" }, "version": "long" } ], "nextToken": "string" }

cli output fields:

Name

Type

Description

things

list

member: ThingAttribute

java class: java.util.List

The things.

ThingAttribute

ThingAttribute

thingName

string

length max:128 min:1

pattern: [a-zA-Z0-9:_-]+

The name of the thing.

thingTypeName

string

length max:128 min:1

pattern: [a-zA-Z0-9:_-]+

The name of the thing type, if the thing has been associated with a type.

thingArn

string

The thing ARN.

attributes

map

key: AttributeName

value: AttributeValue

A list of thing attributes which are name-value pairs.

AttributeName

string

length max:128

pattern: [a-zA-Z0-9_.,@/:#-]+

AttributeValue

string

length max:800

pattern: [a-zA-Z0-9_.,@/:#-]*

version

long

The version of the thing record in the registry.

nextToken

string

The token used to get the next set of results, or null if there are no additional results.

On this page: