AWS IoT Things Graph
Welcome (API Version 2018-09-06)

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.

AssociateEntityToThing

Associates a device with a concrete thing that is in the user's registry.

A thing can be associated with only one device at a time. If you associate a thing with a new device id, its previous association will be removed.

Request Syntax

{ "entityId": "string", "namespaceVersion": number, "thingName": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

entityId

The ID of the device to be associated with the thing.

The ID should be in the following format.

urn:tdm:REGION/ACCOUNT ID/default:device:DEVICENAME

Type: String

Length Constraints: Maximum length of 160.

Pattern: ^urn:tdm:(([a-z]{2}-(gov-)?[a-z]{4,9}-[0-9]{1,3}/[0-9]+/)*[\p{Alnum}_]+(/[\p{Alnum}_]+)*):([\p{Alpha}]*):([\p{Alnum}_]+(/[\p{Alnum}_]+)*)$

Required: Yes

namespaceVersion

The version of the user's namespace. Defaults to the latest version of the user's namespace.

Type: Long

Required: No

thingName

The name of the thing to which the entity is to be associated.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 128.

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

Required: Yes

Response Elements

If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.

Errors

For information about the errors that are common to all actions, see Common Errors.

InternalFailureException

HTTP Status Code: 500

InvalidRequestException

HTTP Status Code: 400

ResourceNotFoundException

HTTP Status Code: 400

ThrottlingException

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: