Menu
AWS IoT
Developer Guide

ListThingGroupsForThing

ListThingGroupsForThing

List the thing groups to which the specified thing belongs.

https

Request syntax:

GET /things/thingName/thing-groups?maxResults=maxResults&nextToken=nextToken

URI Request Parameters:

Name

Type

Req?

Description

thingName

ThingName

yes

The thing name.

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 { "thingGroups": [ { "groupName": "string", "groupArn": "string" } ], "nextToken": "string" }

Response Body Parameters:

Name

Type

Req?

Description

thingGroups

ThingGroupNameAndArnList

no

The thing groups.

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-thing-groups-for-thing \ --thing-name <value> \ [--next-token <value>] \ [--max-results <value>] \ [--cli-input-json <value>] \ [--generate-cli-skeleton]

cli-input-json format:

{ "thingName": "string", "nextToken": "string", "maxResults": "integer" }

cli-input-json fields:

Name

Type

Description

thingName

string

length- max:128 min:1

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

The thing name.

nextToken

string

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

maxResults

integer

range- max:250 min:1

The maximum number of results to return at one time.

Output:

{ "thingGroups": [ { "groupName": "string", "groupArn": "string" } ], "nextToken": "string" }

cli output fields:

Name

Type

Description

thingGroups

list

member: GroupNameAndArn

java class: java.util.List

The thing groups.

groupName

string

length- max:128 min:1

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

The group name.

groupArn

string

The group ARN.

nextToken

string

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.

InternalFailureException

An unexpected error has occurred.

ResourceNotFoundException

The specified resource does not exist.