

# AWS IoT data
<a name="API_Operations_AWS_IoT_Data_Plane"></a>

The following actions are supported by AWS IoT data:
+  [DeleteConnection](API_iotdata_DeleteConnection.md) 
+  [DeleteThingShadow](API_iotdata_DeleteThingShadow.md) 
+  [GetRetainedMessage](API_iotdata_GetRetainedMessage.md) 
+  [GetThingShadow](API_iotdata_GetThingShadow.md) 
+  [ListNamedShadowsForThing](API_iotdata_ListNamedShadowsForThing.md) 
+  [ListRetainedMessages](API_iotdata_ListRetainedMessages.md) 
+  [Publish](API_iotdata_Publish.md) 
+  [UpdateThingShadow](API_iotdata_UpdateThingShadow.md) 

# DeleteConnection
<a name="API_iotdata_DeleteConnection"></a>

Disconnects a connected MQTT client from AWS IoT Core. When you disconnect a client, AWS IoT Core closes the client's network connection and optionally cleans the session state.

Requires permission to access the [DeleteConnection](https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions) action.

## Request Syntax
<a name="API_iotdata_DeleteConnection_RequestSyntax"></a>

```
DELETE /connections/clientId?cleanSession=cleanSession&preventWillMessage=preventWillMessage HTTP/1.1
```

## URI Request Parameters
<a name="API_iotdata_DeleteConnection_RequestParameters"></a>

The request uses the following URI parameters.

 ** [cleanSession](#API_iotdata_DeleteConnection_RequestSyntax) **   <a name="iot-iotdata_DeleteConnection-request-uri-cleanSession"></a>
Specifies whether to remove the client's persistent session state when disconnecting. Set to `TRUE` to delete all session information, including subscriptions and queued messages. Set to `FALSE` to preserve the session state for [persistent sessions](https://docs.aws.amazon.com/iot/latest/developerguide/mqtt.html#mqtt-persistent-sessions). For clean sessions this parameter will be ignored. By default, this is set to `FALSE` (preserves the session state).

 ** [clientId](#API_iotdata_DeleteConnection_RequestSyntax) **   <a name="iot-iotdata_DeleteConnection-request-uri-clientId"></a>
The unique identifier of the MQTT client to disconnect. The client ID can't start with a dollar sign (\$1).  
MQTT client IDs must be URL encoded (percent-encoded) when they contain characters that are not valid in HTTP requests, such as spaces, forward slashes (/), and UTF-8 characters.  
Length Constraints: Minimum length of 1. Maximum length of 128.  
Pattern: `^[^$].*`   
Required: Yes

 ** [preventWillMessage](#API_iotdata_DeleteConnection_RequestSyntax) **   <a name="iot-iotdata_DeleteConnection-request-uri-preventWillMessage"></a>
Controls if AWS IoT Core publishes the client's Last Will and Testament (LWT) message upon disconnection. Set to `TRUE` to prevent publishing the LWT message. Set to `FALSE` to ensure that LWT is published. By default, this is set to `FALSE` (LWT message is published).

## Request Body
<a name="API_iotdata_DeleteConnection_RequestBody"></a>

The request does not have a request body.

## Response Syntax
<a name="API_iotdata_DeleteConnection_ResponseSyntax"></a>

```
HTTP/1.1 200
```

## Response Elements
<a name="API_iotdata_DeleteConnection_ResponseElements"></a>

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

## Errors
<a name="API_iotdata_DeleteConnection_Errors"></a>

 ** ForbiddenException **   
The caller isn't authorized to make the request.  
HTTP Status Code: 403

 ** InternalFailureException **   
An unexpected error has occurred.    
 ** message **   
The message for the exception.
HTTP Status Code: 500

 ** InvalidRequestException **   
The request is not valid.    
 ** message **   
The message for the exception.
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The specified resource does not exist.    
 ** message **   
The message for the exception.
HTTP Status Code: 404

 ** ThrottlingException **   
The rate exceeds the limit.    
 ** message **   
The message for the exception.
HTTP Status Code: 429

## See Also
<a name="API_iotdata_DeleteConnection_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/iot-data-2015-05-28/DeleteConnection) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/iot-data-2015-05-28/DeleteConnection) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/iot-data-2015-05-28/DeleteConnection) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/iot-data-2015-05-28/DeleteConnection) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/iot-data-2015-05-28/DeleteConnection) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/iot-data-2015-05-28/DeleteConnection) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/iot-data-2015-05-28/DeleteConnection) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/iot-data-2015-05-28/DeleteConnection) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/iot-data-2015-05-28/DeleteConnection) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/iot-data-2015-05-28/DeleteConnection) 

# DeleteThingShadow
<a name="API_iotdata_DeleteThingShadow"></a>

Deletes the shadow for the specified thing.

Requires permission to access the [DeleteThingShadow](https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions) action.

For more information, see [DeleteThingShadow](http://docs.aws.amazon.com/iot/latest/developerguide/API_DeleteThingShadow.html) in the AWS IoT Developer Guide.

## Request Syntax
<a name="API_iotdata_DeleteThingShadow_RequestSyntax"></a>

```
DELETE /things/thingName/shadow?name=shadowName HTTP/1.1
```

## URI Request Parameters
<a name="API_iotdata_DeleteThingShadow_RequestParameters"></a>

The request uses the following URI parameters.

 ** [shadowName](#API_iotdata_DeleteThingShadow_RequestSyntax) **   <a name="iot-iotdata_DeleteThingShadow-request-uri-shadowName"></a>
The name of the shadow.  
Length Constraints: Minimum length of 1. Maximum length of 64.  
Pattern: `[$a-zA-Z0-9:_-]+` 

 ** [thingName](#API_iotdata_DeleteThingShadow_RequestSyntax) **   <a name="iot-iotdata_DeleteThingShadow-request-uri-thingName"></a>
The name of the thing.  
Length Constraints: Minimum length of 1. Maximum length of 128.  
Pattern: `[a-zA-Z0-9:_-]+`   
Required: Yes

## Request Body
<a name="API_iotdata_DeleteThingShadow_RequestBody"></a>

The request does not have a request body.

## Response Syntax
<a name="API_iotdata_DeleteThingShadow_ResponseSyntax"></a>

```
HTTP/1.1 200

payload
```

## Response Elements
<a name="API_iotdata_DeleteThingShadow_ResponseElements"></a>

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

The response returns the following as the HTTP body.

 ** [payload](#API_iotdata_DeleteThingShadow_ResponseSyntax) **   <a name="iot-iotdata_DeleteThingShadow-response-payload"></a>
The state information, in JSON format.

## Errors
<a name="API_iotdata_DeleteThingShadow_Errors"></a>

 ** InternalFailureException **   
An unexpected error has occurred.    
 ** message **   
The message for the exception.
HTTP Status Code: 500

 ** InvalidRequestException **   
The request is not valid.    
 ** message **   
The message for the exception.
HTTP Status Code: 400

 ** MethodNotAllowedException **   
The specified combination of HTTP verb and URI is not supported.    
 ** message **   
The message for the exception.
HTTP Status Code: 405

 ** ResourceNotFoundException **   
The specified resource does not exist.    
 ** message **   
The message for the exception.
HTTP Status Code: 404

 ** ServiceUnavailableException **   
The service is temporarily unavailable.    
 ** message **   
The message for the exception.
HTTP Status Code: 503

 ** ThrottlingException **   
The rate exceeds the limit.    
 ** message **   
The message for the exception.
HTTP Status Code: 429

 ** UnauthorizedException **   
You are not authorized to perform this operation.    
 ** message **   
The message for the exception.
HTTP Status Code: 401

 ** UnsupportedDocumentEncodingException **   
The document encoding is not supported.    
 ** message **   
The message for the exception.
HTTP Status Code: 415

## See Also
<a name="API_iotdata_DeleteThingShadow_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/iot-data-2015-05-28/DeleteThingShadow) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/iot-data-2015-05-28/DeleteThingShadow) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/iot-data-2015-05-28/DeleteThingShadow) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/iot-data-2015-05-28/DeleteThingShadow) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/iot-data-2015-05-28/DeleteThingShadow) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/iot-data-2015-05-28/DeleteThingShadow) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/iot-data-2015-05-28/DeleteThingShadow) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/iot-data-2015-05-28/DeleteThingShadow) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/iot-data-2015-05-28/DeleteThingShadow) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/iot-data-2015-05-28/DeleteThingShadow) 

# GetRetainedMessage
<a name="API_iotdata_GetRetainedMessage"></a>

Gets the details of a single retained message for the specified topic.

This action returns the message payload of the retained message, which can incur messaging costs. To list only the topic names of the retained messages, call [ListRetainedMessages](https://docs.aws.amazon.com/iot/latest/apireference/API_iotdata_ListRetainedMessages.html).

Requires permission to access the [GetRetainedMessage](https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html) action.

For more information about messaging costs, see [AWS IoT Core pricing - Messaging](http://aws.amazon.com/iot-core/pricing/#Messaging).

## Request Syntax
<a name="API_iotdata_GetRetainedMessage_RequestSyntax"></a>

```
GET /retainedMessage/topic HTTP/1.1
```

## URI Request Parameters
<a name="API_iotdata_GetRetainedMessage_RequestParameters"></a>

The request uses the following URI parameters.

 ** [topic](#API_iotdata_GetRetainedMessage_RequestSyntax) **   <a name="iot-iotdata_GetRetainedMessage-request-uri-topic"></a>
The topic name of the retained message to retrieve.  
Required: Yes

## Request Body
<a name="API_iotdata_GetRetainedMessage_RequestBody"></a>

The request does not have a request body.

## Response Syntax
<a name="API_iotdata_GetRetainedMessage_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "lastModifiedTime": number,
   "payload": blob,
   "qos": number,
   "topic": "string",
   "userProperties": blob
}
```

## Response Elements
<a name="API_iotdata_GetRetainedMessage_ResponseElements"></a>

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

The following data is returned in JSON format by the service.

 ** [lastModifiedTime](#API_iotdata_GetRetainedMessage_ResponseSyntax) **   <a name="iot-iotdata_GetRetainedMessage-response-lastModifiedTime"></a>
The Epoch date and time, in milliseconds, when the retained message was stored by AWS IoT.  
Type: Long

 ** [payload](#API_iotdata_GetRetainedMessage_ResponseSyntax) **   <a name="iot-iotdata_GetRetainedMessage-response-payload"></a>
The Base64-encoded message payload of the retained message body.  
Type: Base64-encoded binary data object

 ** [qos](#API_iotdata_GetRetainedMessage_ResponseSyntax) **   <a name="iot-iotdata_GetRetainedMessage-response-qos"></a>
The quality of service (QoS) level used to publish the retained message.  
Type: Integer  
Valid Range: Minimum value of 0. Maximum value of 1.

 ** [topic](#API_iotdata_GetRetainedMessage_ResponseSyntax) **   <a name="iot-iotdata_GetRetainedMessage-response-topic"></a>
The topic name to which the retained message was published.  
Type: String

 ** [userProperties](#API_iotdata_GetRetainedMessage_ResponseSyntax) **   <a name="iot-iotdata_GetRetainedMessage-response-userProperties"></a>
A base64-encoded JSON string that includes an array of JSON objects, or null if the retained message doesn't include any user properties.  
The following example `userProperties` parameter is a JSON string that represents two user properties. Note that it will be base64-encoded:  
 `[{"deviceName": "alpha"}, {"deviceCnt": "45"}]`   
Type: Base64-encoded binary data object

## Errors
<a name="API_iotdata_GetRetainedMessage_Errors"></a>

 ** InternalFailureException **   
An unexpected error has occurred.    
 ** message **   
The message for the exception.
HTTP Status Code: 500

 ** InvalidRequestException **   
The request is not valid.    
 ** message **   
The message for the exception.
HTTP Status Code: 400

 ** MethodNotAllowedException **   
The specified combination of HTTP verb and URI is not supported.    
 ** message **   
The message for the exception.
HTTP Status Code: 405

 ** ResourceNotFoundException **   
The specified resource does not exist.    
 ** message **   
The message for the exception.
HTTP Status Code: 404

 ** ServiceUnavailableException **   
The service is temporarily unavailable.    
 ** message **   
The message for the exception.
HTTP Status Code: 503

 ** ThrottlingException **   
The rate exceeds the limit.    
 ** message **   
The message for the exception.
HTTP Status Code: 429

 ** UnauthorizedException **   
You are not authorized to perform this operation.    
 ** message **   
The message for the exception.
HTTP Status Code: 401

## See Also
<a name="API_iotdata_GetRetainedMessage_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/iot-data-2015-05-28/GetRetainedMessage) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/iot-data-2015-05-28/GetRetainedMessage) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/iot-data-2015-05-28/GetRetainedMessage) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/iot-data-2015-05-28/GetRetainedMessage) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/iot-data-2015-05-28/GetRetainedMessage) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/iot-data-2015-05-28/GetRetainedMessage) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/iot-data-2015-05-28/GetRetainedMessage) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/iot-data-2015-05-28/GetRetainedMessage) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/iot-data-2015-05-28/GetRetainedMessage) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/iot-data-2015-05-28/GetRetainedMessage) 

# GetThingShadow
<a name="API_iotdata_GetThingShadow"></a>

Gets the shadow for the specified thing.

Requires permission to access the [GetThingShadow](https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions) action.

For more information, see [GetThingShadow](http://docs.aws.amazon.com/iot/latest/developerguide/API_GetThingShadow.html) in the AWS IoT Developer Guide.

## Request Syntax
<a name="API_iotdata_GetThingShadow_RequestSyntax"></a>

```
GET /things/thingName/shadow?name=shadowName HTTP/1.1
```

## URI Request Parameters
<a name="API_iotdata_GetThingShadow_RequestParameters"></a>

The request uses the following URI parameters.

 ** [shadowName](#API_iotdata_GetThingShadow_RequestSyntax) **   <a name="iot-iotdata_GetThingShadow-request-uri-shadowName"></a>
The name of the shadow.  
Length Constraints: Minimum length of 1. Maximum length of 64.  
Pattern: `[$a-zA-Z0-9:_-]+` 

 ** [thingName](#API_iotdata_GetThingShadow_RequestSyntax) **   <a name="iot-iotdata_GetThingShadow-request-uri-thingName"></a>
The name of the thing.  
Length Constraints: Minimum length of 1. Maximum length of 128.  
Pattern: `[a-zA-Z0-9:_-]+`   
Required: Yes

## Request Body
<a name="API_iotdata_GetThingShadow_RequestBody"></a>

The request does not have a request body.

## Response Syntax
<a name="API_iotdata_GetThingShadow_ResponseSyntax"></a>

```
HTTP/1.1 200

payload
```

## Response Elements
<a name="API_iotdata_GetThingShadow_ResponseElements"></a>

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

The response returns the following as the HTTP body.

 ** [payload](#API_iotdata_GetThingShadow_ResponseSyntax) **   <a name="iot-iotdata_GetThingShadow-response-payload"></a>
The state information, in JSON format.

## Errors
<a name="API_iotdata_GetThingShadow_Errors"></a>

 ** InternalFailureException **   
An unexpected error has occurred.    
 ** message **   
The message for the exception.
HTTP Status Code: 500

 ** InvalidRequestException **   
The request is not valid.    
 ** message **   
The message for the exception.
HTTP Status Code: 400

 ** MethodNotAllowedException **   
The specified combination of HTTP verb and URI is not supported.    
 ** message **   
The message for the exception.
HTTP Status Code: 405

 ** ResourceNotFoundException **   
The specified resource does not exist.    
 ** message **   
The message for the exception.
HTTP Status Code: 404

 ** ServiceUnavailableException **   
The service is temporarily unavailable.    
 ** message **   
The message for the exception.
HTTP Status Code: 503

 ** ThrottlingException **   
The rate exceeds the limit.    
 ** message **   
The message for the exception.
HTTP Status Code: 429

 ** UnauthorizedException **   
You are not authorized to perform this operation.    
 ** message **   
The message for the exception.
HTTP Status Code: 401

 ** UnsupportedDocumentEncodingException **   
The document encoding is not supported.    
 ** message **   
The message for the exception.
HTTP Status Code: 415

## See Also
<a name="API_iotdata_GetThingShadow_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/iot-data-2015-05-28/GetThingShadow) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/iot-data-2015-05-28/GetThingShadow) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/iot-data-2015-05-28/GetThingShadow) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/iot-data-2015-05-28/GetThingShadow) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/iot-data-2015-05-28/GetThingShadow) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/iot-data-2015-05-28/GetThingShadow) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/iot-data-2015-05-28/GetThingShadow) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/iot-data-2015-05-28/GetThingShadow) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/iot-data-2015-05-28/GetThingShadow) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/iot-data-2015-05-28/GetThingShadow) 

# ListNamedShadowsForThing
<a name="API_iotdata_ListNamedShadowsForThing"></a>

Lists the shadows for the specified thing.

Requires permission to access the [ListNamedShadowsForThing](https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions) action.

## Request Syntax
<a name="API_iotdata_ListNamedShadowsForThing_RequestSyntax"></a>

```
GET /api/things/shadow/ListNamedShadowsForThing/thingName?nextToken=nextToken&pageSize=pageSize HTTP/1.1
```

## URI Request Parameters
<a name="API_iotdata_ListNamedShadowsForThing_RequestParameters"></a>

The request uses the following URI parameters.

 ** [nextToken](#API_iotdata_ListNamedShadowsForThing_RequestSyntax) **   <a name="iot-iotdata_ListNamedShadowsForThing-request-uri-nextToken"></a>
The token to retrieve the next set of results.

 ** [pageSize](#API_iotdata_ListNamedShadowsForThing_RequestSyntax) **   <a name="iot-iotdata_ListNamedShadowsForThing-request-uri-pageSize"></a>
The result page size.  
Valid Range: Minimum value of 1. Maximum value of 100.

 ** [thingName](#API_iotdata_ListNamedShadowsForThing_RequestSyntax) **   <a name="iot-iotdata_ListNamedShadowsForThing-request-uri-thingName"></a>
The name of the thing.  
Length Constraints: Minimum length of 1. Maximum length of 128.  
Pattern: `[a-zA-Z0-9:_-]+`   
Required: Yes

## Request Body
<a name="API_iotdata_ListNamedShadowsForThing_RequestBody"></a>

The request does not have a request body.

## Response Syntax
<a name="API_iotdata_ListNamedShadowsForThing_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "nextToken": "string",
   "results": [ "string" ],
   "timestamp": number
}
```

## Response Elements
<a name="API_iotdata_ListNamedShadowsForThing_ResponseElements"></a>

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

The following data is returned in JSON format by the service.

 ** [nextToken](#API_iotdata_ListNamedShadowsForThing_ResponseSyntax) **   <a name="iot-iotdata_ListNamedShadowsForThing-response-nextToken"></a>
The token to use to get the next set of results, or **null** if there are no additional results.  
Type: String

 ** [results](#API_iotdata_ListNamedShadowsForThing_ResponseSyntax) **   <a name="iot-iotdata_ListNamedShadowsForThing-response-results"></a>
The list of shadows for the specified thing.  
Type: Array of strings  
Length Constraints: Minimum length of 1. Maximum length of 64.  
Pattern: `[$a-zA-Z0-9:_-]+` 

 ** [timestamp](#API_iotdata_ListNamedShadowsForThing_ResponseSyntax) **   <a name="iot-iotdata_ListNamedShadowsForThing-response-timestamp"></a>
The Epoch date and time the response was generated by AWS IoT.  
Type: Long

## Errors
<a name="API_iotdata_ListNamedShadowsForThing_Errors"></a>

 ** InternalFailureException **   
An unexpected error has occurred.    
 ** message **   
The message for the exception.
HTTP Status Code: 500

 ** InvalidRequestException **   
The request is not valid.    
 ** message **   
The message for the exception.
HTTP Status Code: 400

 ** MethodNotAllowedException **   
The specified combination of HTTP verb and URI is not supported.    
 ** message **   
The message for the exception.
HTTP Status Code: 405

 ** ResourceNotFoundException **   
The specified resource does not exist.    
 ** message **   
The message for the exception.
HTTP Status Code: 404

 ** ServiceUnavailableException **   
The service is temporarily unavailable.    
 ** message **   
The message for the exception.
HTTP Status Code: 503

 ** ThrottlingException **   
The rate exceeds the limit.    
 ** message **   
The message for the exception.
HTTP Status Code: 429

 ** UnauthorizedException **   
You are not authorized to perform this operation.    
 ** message **   
The message for the exception.
HTTP Status Code: 401

## See Also
<a name="API_iotdata_ListNamedShadowsForThing_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/iot-data-2015-05-28/ListNamedShadowsForThing) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/iot-data-2015-05-28/ListNamedShadowsForThing) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/iot-data-2015-05-28/ListNamedShadowsForThing) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/iot-data-2015-05-28/ListNamedShadowsForThing) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/iot-data-2015-05-28/ListNamedShadowsForThing) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/iot-data-2015-05-28/ListNamedShadowsForThing) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/iot-data-2015-05-28/ListNamedShadowsForThing) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/iot-data-2015-05-28/ListNamedShadowsForThing) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/iot-data-2015-05-28/ListNamedShadowsForThing) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/iot-data-2015-05-28/ListNamedShadowsForThing) 

# ListRetainedMessages
<a name="API_iotdata_ListRetainedMessages"></a>

Lists summary information about the retained messages stored for the account.

This action returns only the topic names of the retained messages. It doesn't return any message payloads. Although this action doesn't return a message payload, it can still incur messaging costs.

To get the message payload of a retained message, call [GetRetainedMessage](https://docs.aws.amazon.com/iot/latest/apireference/API_iotdata_GetRetainedMessage.html) with the topic name of the retained message.

Requires permission to access the [ListRetainedMessages](https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html) action.

For more information about messaging costs, see [AWS IoT Core pricing - Messaging](http://aws.amazon.com/iot-core/pricing/#Messaging).

## Request Syntax
<a name="API_iotdata_ListRetainedMessages_RequestSyntax"></a>

```
GET /retainedMessage?maxResults=maxResults&nextToken=nextToken HTTP/1.1
```

## URI Request Parameters
<a name="API_iotdata_ListRetainedMessages_RequestParameters"></a>

The request uses the following URI parameters.

 ** [maxResults](#API_iotdata_ListRetainedMessages_RequestSyntax) **   <a name="iot-iotdata_ListRetainedMessages-request-uri-maxResults"></a>
The maximum number of results to return at one time.  
Valid Range: Minimum value of 1. Maximum value of 200.

 ** [nextToken](#API_iotdata_ListRetainedMessages_RequestSyntax) **   <a name="iot-iotdata_ListRetainedMessages-request-uri-nextToken"></a>
To retrieve the next set of results, the `nextToken` value from a previous response; otherwise **null** to receive the first set of results.

## Request Body
<a name="API_iotdata_ListRetainedMessages_RequestBody"></a>

The request does not have a request body.

## Response Syntax
<a name="API_iotdata_ListRetainedMessages_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "nextToken": "string",
   "retainedTopics": [ 
      { 
         "lastModifiedTime": number,
         "payloadSize": number,
         "qos": number,
         "topic": "string"
      }
   ]
}
```

## Response Elements
<a name="API_iotdata_ListRetainedMessages_ResponseElements"></a>

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

The following data is returned in JSON format by the service.

 ** [nextToken](#API_iotdata_ListRetainedMessages_ResponseSyntax) **   <a name="iot-iotdata_ListRetainedMessages-response-nextToken"></a>
The token for the next set of results, or null if there are no additional results.  
Type: String

 ** [retainedTopics](#API_iotdata_ListRetainedMessages_ResponseSyntax) **   <a name="iot-iotdata_ListRetainedMessages-response-retainedTopics"></a>
A summary list the account's retained messages. The information returned doesn't include the message payloads of the retained messages.  
Type: Array of [RetainedMessageSummary](API_iotdata_RetainedMessageSummary.md) objects

## Errors
<a name="API_iotdata_ListRetainedMessages_Errors"></a>

 ** InternalFailureException **   
An unexpected error has occurred.    
 ** message **   
The message for the exception.
HTTP Status Code: 500

 ** InvalidRequestException **   
The request is not valid.    
 ** message **   
The message for the exception.
HTTP Status Code: 400

 ** MethodNotAllowedException **   
The specified combination of HTTP verb and URI is not supported.    
 ** message **   
The message for the exception.
HTTP Status Code: 405

 ** ServiceUnavailableException **   
The service is temporarily unavailable.    
 ** message **   
The message for the exception.
HTTP Status Code: 503

 ** ThrottlingException **   
The rate exceeds the limit.    
 ** message **   
The message for the exception.
HTTP Status Code: 429

 ** UnauthorizedException **   
You are not authorized to perform this operation.    
 ** message **   
The message for the exception.
HTTP Status Code: 401

## See Also
<a name="API_iotdata_ListRetainedMessages_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/iot-data-2015-05-28/ListRetainedMessages) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/iot-data-2015-05-28/ListRetainedMessages) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/iot-data-2015-05-28/ListRetainedMessages) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/iot-data-2015-05-28/ListRetainedMessages) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/iot-data-2015-05-28/ListRetainedMessages) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/iot-data-2015-05-28/ListRetainedMessages) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/iot-data-2015-05-28/ListRetainedMessages) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/iot-data-2015-05-28/ListRetainedMessages) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/iot-data-2015-05-28/ListRetainedMessages) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/iot-data-2015-05-28/ListRetainedMessages) 

# Publish
<a name="API_iotdata_Publish"></a>

Publishes an MQTT message.

Requires permission to access the [Publish](https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions) action.

For more information about MQTT messages, see [MQTT Protocol](http://docs.aws.amazon.com/iot/latest/developerguide/mqtt.html) in the AWS IoT Developer Guide.

For more information about messaging costs, see [AWS IoT Core pricing - Messaging](http://aws.amazon.com/iot-core/pricing/#Messaging).

## Request Syntax
<a name="API_iotdata_Publish_RequestSyntax"></a>

```
POST /topics/topic?contentType=contentType&messageExpiry=messageExpiry&qos=qos&responseTopic=responseTopic&retain=retain HTTP/1.1
x-amz-mqtt5-user-properties: userProperties
x-amz-mqtt5-payload-format-indicator: payloadFormatIndicator
x-amz-mqtt5-correlation-data: correlationData

payload
```

## URI Request Parameters
<a name="API_iotdata_Publish_RequestParameters"></a>

The request uses the following URI parameters.

 ** [contentType](#API_iotdata_Publish_RequestSyntax) **   <a name="iot-iotdata_Publish-request-uri-contentType"></a>
A UTF-8 encoded string that describes the content of the publishing message.

 ** [correlationData](#API_iotdata_Publish_RequestSyntax) **   <a name="iot-iotdata_Publish-request-correlationData"></a>
The base64-encoded binary data used by the sender of the request message to identify which request the response message is for when it's received. `correlationData` is an HTTP header value in the API.

 ** [messageExpiry](#API_iotdata_Publish_RequestSyntax) **   <a name="iot-iotdata_Publish-request-uri-messageExpiry"></a>
A user-defined integer value that represents the message expiry interval in seconds. If absent, the message doesn't expire. For more information about the limits of `messageExpiry`, see [AWS IoT Core message broker and protocol limits and quotas ](https://docs.aws.amazon.com/general/latest/gr/iot-core.html#message-broker-limits) from the AWS Reference Guide.

 ** [payloadFormatIndicator](#API_iotdata_Publish_RequestSyntax) **   <a name="iot-iotdata_Publish-request-payloadFormatIndicator"></a>
An `Enum` string value that indicates whether the payload is formatted as UTF-8. `payloadFormatIndicator` is an HTTP header value in the API.  
Valid Values: `UNSPECIFIED_BYTES | UTF8_DATA` 

 ** [qos](#API_iotdata_Publish_RequestSyntax) **   <a name="iot-iotdata_Publish-request-uri-qos"></a>
The Quality of Service (QoS) level. The default QoS level is 0.  
Valid Range: Minimum value of 0. Maximum value of 1.

 ** [responseTopic](#API_iotdata_Publish_RequestSyntax) **   <a name="iot-iotdata_Publish-request-uri-responseTopic"></a>
A UTF-8 encoded string that's used as the topic name for a response message. The response topic is used to describe the topic which the receiver should publish to as part of the request-response flow. The topic must not contain wildcard characters.

 ** [retain](#API_iotdata_Publish_RequestSyntax) **   <a name="iot-iotdata_Publish-request-uri-retain"></a>
A Boolean value that determines whether to set the RETAIN flag when the message is published.  
Setting the RETAIN flag causes the message to be retained and sent to new subscribers to the topic.  
Valid values: `true` \$1 `false`   
Default value: `false` 

 ** [topic](#API_iotdata_Publish_RequestSyntax) **   <a name="iot-iotdata_Publish-request-uri-topic"></a>
The name of the MQTT topic.  
Required: Yes

 ** [userProperties](#API_iotdata_Publish_RequestSyntax) **   <a name="iot-iotdata_Publish-request-userProperties"></a>
A JSON string that contains an array of JSON objects. If you don’t use AWS SDK or AWS CLI, you must encode the JSON string to base64 format before adding it to the HTTP header. `userProperties` is an HTTP header value in the API.  
The following example `userProperties` parameter is a JSON string which represents two User Properties. Note that it needs to be base64-encoded:  
 `[{"deviceName": "alpha"}, {"deviceCnt": "45"}]` 

## Request Body
<a name="API_iotdata_Publish_RequestBody"></a>

The request accepts the following binary data.

 ** [payload](#API_iotdata_Publish_RequestSyntax) **   <a name="iot-iotdata_Publish-request-payload"></a>
The message body. MQTT accepts text, binary, and empty (null) message payloads.  
Publishing an empty (null) payload with **retain** = `true` deletes the retained message identified by **topic** from AWS IoT Core.

## Response Syntax
<a name="API_iotdata_Publish_ResponseSyntax"></a>

```
HTTP/1.1 200
```

## Response Elements
<a name="API_iotdata_Publish_ResponseElements"></a>

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

## Errors
<a name="API_iotdata_Publish_Errors"></a>

 ** InternalFailureException **   
An unexpected error has occurred.    
 ** message **   
The message for the exception.
HTTP Status Code: 500

 ** InvalidRequestException **   
The request is not valid.    
 ** message **   
The message for the exception.
HTTP Status Code: 400

 ** MethodNotAllowedException **   
The specified combination of HTTP verb and URI is not supported.    
 ** message **   
The message for the exception.
HTTP Status Code: 405

 ** ThrottlingException **   
The rate exceeds the limit.    
 ** message **   
The message for the exception.
HTTP Status Code: 429

 ** UnauthorizedException **   
You are not authorized to perform this operation.    
 ** message **   
The message for the exception.
HTTP Status Code: 401

## See Also
<a name="API_iotdata_Publish_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/iot-data-2015-05-28/Publish) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/iot-data-2015-05-28/Publish) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/iot-data-2015-05-28/Publish) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/iot-data-2015-05-28/Publish) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/iot-data-2015-05-28/Publish) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/iot-data-2015-05-28/Publish) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/iot-data-2015-05-28/Publish) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/iot-data-2015-05-28/Publish) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/iot-data-2015-05-28/Publish) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/iot-data-2015-05-28/Publish) 

# UpdateThingShadow
<a name="API_iotdata_UpdateThingShadow"></a>

Updates the shadow for the specified thing.

Requires permission to access the [UpdateThingShadow](https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions) action.

For more information, see [UpdateThingShadow](http://docs.aws.amazon.com/iot/latest/developerguide/API_UpdateThingShadow.html) in the AWS IoT Developer Guide.

## Request Syntax
<a name="API_iotdata_UpdateThingShadow_RequestSyntax"></a>

```
POST /things/thingName/shadow?name=shadowName HTTP/1.1

payload
```

## URI Request Parameters
<a name="API_iotdata_UpdateThingShadow_RequestParameters"></a>

The request uses the following URI parameters.

 ** [shadowName](#API_iotdata_UpdateThingShadow_RequestSyntax) **   <a name="iot-iotdata_UpdateThingShadow-request-uri-shadowName"></a>
The name of the shadow.  
Length Constraints: Minimum length of 1. Maximum length of 64.  
Pattern: `[$a-zA-Z0-9:_-]+` 

 ** [thingName](#API_iotdata_UpdateThingShadow_RequestSyntax) **   <a name="iot-iotdata_UpdateThingShadow-request-uri-thingName"></a>
The name of the thing.  
Length Constraints: Minimum length of 1. Maximum length of 128.  
Pattern: `[a-zA-Z0-9:_-]+`   
Required: Yes

## Request Body
<a name="API_iotdata_UpdateThingShadow_RequestBody"></a>

The request accepts the following binary data.

 ** [payload](#API_iotdata_UpdateThingShadow_RequestSyntax) **   <a name="iot-iotdata_UpdateThingShadow-request-payload"></a>
The state information, in JSON format.  
Required: Yes

## Response Syntax
<a name="API_iotdata_UpdateThingShadow_ResponseSyntax"></a>

```
HTTP/1.1 200

payload
```

## Response Elements
<a name="API_iotdata_UpdateThingShadow_ResponseElements"></a>

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

The response returns the following as the HTTP body.

 ** [payload](#API_iotdata_UpdateThingShadow_ResponseSyntax) **   <a name="iot-iotdata_UpdateThingShadow-response-payload"></a>
The state information, in JSON format.

## Errors
<a name="API_iotdata_UpdateThingShadow_Errors"></a>

 ** ConflictException **   
The specified version does not match the version of the document.    
 ** message **   
The message for the exception.
HTTP Status Code: 409

 ** InternalFailureException **   
An unexpected error has occurred.    
 ** message **   
The message for the exception.
HTTP Status Code: 500

 ** InvalidRequestException **   
The request is not valid.    
 ** message **   
The message for the exception.
HTTP Status Code: 400

 ** MethodNotAllowedException **   
The specified combination of HTTP verb and URI is not supported.    
 ** message **   
The message for the exception.
HTTP Status Code: 405

 ** RequestEntityTooLargeException **   
The payload exceeds the maximum size allowed.    
 ** message **   
The message for the exception.
HTTP Status Code: 413

 ** ServiceUnavailableException **   
The service is temporarily unavailable.    
 ** message **   
The message for the exception.
HTTP Status Code: 503

 ** ThrottlingException **   
The rate exceeds the limit.    
 ** message **   
The message for the exception.
HTTP Status Code: 429

 ** UnauthorizedException **   
You are not authorized to perform this operation.    
 ** message **   
The message for the exception.
HTTP Status Code: 401

 ** UnsupportedDocumentEncodingException **   
The document encoding is not supported.    
 ** message **   
The message for the exception.
HTTP Status Code: 415

## See Also
<a name="API_iotdata_UpdateThingShadow_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/iot-data-2015-05-28/UpdateThingShadow) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/iot-data-2015-05-28/UpdateThingShadow) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/iot-data-2015-05-28/UpdateThingShadow) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/iot-data-2015-05-28/UpdateThingShadow) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/iot-data-2015-05-28/UpdateThingShadow) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/iot-data-2015-05-28/UpdateThingShadow) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/iot-data-2015-05-28/UpdateThingShadow) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/iot-data-2015-05-28/UpdateThingShadow) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/iot-data-2015-05-28/UpdateThingShadow) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/iot-data-2015-05-28/UpdateThingShadow) 