Menu
AWS IoT
Developer Guide

ListThingsInThingGroup

Lists the things in the specified group.

Request syntax:

GET /thing-groups/thingGroupName/things?recursive=recursive&maxResults=maxResults&nextToken=nextToken

URI Request Parameters:

Name

Type

Req?

Description

thingGroupName

ThingGroupName

yes

The thing group name.

recursive

Recursive

no

When true, list things in this thing group and in all child groups as well.

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 at one time.

Response syntax:

Content-type: application/json { "things": [ "string" ], "nextToken": "string" }

Response Body Parameters:

Name

Type

Req?

Description

things

ThingNameList

no

The things in the specified thing group.

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

InternalFailureException

An unexpected error has occurred.

HTTP response code: 500

ResourceNotFoundException

The specified resource does not exist.

HTTP response code: 404

CLI

Synopsis:

aws iot list-things-in-thing-group \ --thing-group-name <value> \ [--recursive | --no-recursive] \ [--next-token <value>] \ [--max-results <value>] \ [--cli-input-json <value>] \ [--generate-cli-skeleton]

cli-input-json format:

{ "thingGroupName": "string", "recursive": "boolean", "nextToken": "string", "maxResults": "integer" }

cli-input-json fields:

Name

Type

Description

thingGroupName

string

length max:128 min:1

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

The thing group name.

recursive

boolean

When true, list things in this thing group and in all child groups as well.

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 at one time.

Output:

{ "things": [ "string" ], "nextToken": "string" }

cli output fields:

Name

Type

Description

things

list

member: ThingName

The things in the specified thing group.

ThingName

string

length max:128 min:1

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

nextToken

string

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

On this page: