AWS IoT Data Plane 2015-05-28
- Client: Aws\IotDataPlane\IotDataPlaneClient
- Service ID: data.iot
- Version: 2015-05-28
This page describes the parameters and results for the operations of the AWS IoT Data Plane (2015-05-28), and shows how to use the Aws\IotDataPlane\IotDataPlaneClient object to call the described operations. This documentation is specific to the 2015-05-28 API version of the service.
Operation Summary
Each of the following operations can be created from a client using
$client->getCommand('CommandName'), where "CommandName" is the
name of one of the following operations. Note: a command is a value that
encapsulates an operation and the parameters used to create an HTTP request.
You can also create and send a command immediately using the magic methods
available on a client object: $client->commandName(/* parameters */).
You can send the command asynchronously (returning a promise) by appending the
word "Async" to the operation name: $client->commandNameAsync(/* parameters */).
- DeleteConnection ( array $params = [] )
- Disconnects a connected MQTT client from Amazon Web Services IoT Core.
- DeleteThingShadow ( array $params = [] )
- Deletes the shadow for the specified thing.
- GetConnection ( array $params = [] )
- Retrieves connection information for the specified MQTT client.
- GetRetainedMessage ( array $params = [] )
- Gets the details of a single retained message for the specified topic.
- GetThingShadow ( array $params = [] )
- Gets the shadow for the specified thing.
- ListNamedShadowsForThing ( array $params = [] )
- Lists the shadows for the specified thing.
- ListRetainedMessages ( array $params = [] )
- Lists summary information about the retained messages stored for the account.
- ListSubscriptions ( array $params = [] )
- Returns a list of all subscriptions for MQTT clients with active sessions, including offline clients with persistent sessions.
- Publish ( array $params = [] )
- Publishes an MQTT message.
- SendDirectMessage ( array $params = [] )
- Sends an MQTT message directly to a specific client identified by its client ID.
- UpdateThingShadow ( array $params = [] )
- Updates the shadow for the specified thing.
Paginators
Paginators handle automatically iterating over paginated API results. Paginators are associated with specific API operations, and they accept the parameters that the corresponding API operation accepts. You can get a paginator from a client class using getPaginator($paginatorName, $operationParameters). This client supports the following paginators:
Operations
DeleteConnection
$result = $client->deleteConnection([/* ... */]); $promise = $client->deleteConnectionAsync([/* ... */]);
Disconnects a connected MQTT client from Amazon Web Services IoT Core. When you disconnect a client, Amazon Web Services IoT Core closes the client's network connection and optionally cleans the session state.
Requires permission to access the DeleteConnection action.
Parameter Syntax
$result = $client->deleteConnection([
'cleanSession' => true || false,
'clientId' => '<string>', // REQUIRED
'preventWillMessage' => true || false,
]);
Parameter Details
Members
- cleanSession
-
- Type: boolean
Specifies whether to remove the client's persistent session state when disconnecting. Set to
TRUEto delete all session information, including subscriptions and queued messages. Set toFALSEto preserve the session state for persistent sessions. For clean sessions this parameter will be ignored. By default, this is set toFALSE(preserves the session state). - clientId
-
- Required: Yes
- Type: string
The unique identifier of the MQTT client to disconnect. The client ID can't start with a dollar sign ($).
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.
- preventWillMessage
-
- Type: boolean
Controls if Amazon Web Services IoT Core publishes the client's Last Will and Testament (LWT) message upon disconnection. Set to
TRUEto prevent publishing the LWT message. Set toFALSEto ensure that LWT is published. By default, this is set toFALSE(LWT message is published).
Result Syntax
[]
Result Details
Errors
- ForbiddenException:
The caller isn't authorized to make the request.
- ResourceNotFoundException:
The specified resource does not exist.
- InvalidRequestException:
The request is not valid.
- ThrottlingException:
The rate exceeds the limit.
- InternalFailureException:
An unexpected error has occurred.
DeleteThingShadow
$result = $client->deleteThingShadow([/* ... */]); $promise = $client->deleteThingShadowAsync([/* ... */]);
Deletes the shadow for the specified thing.
Requires permission to access the DeleteThingShadow action.
For more information, see DeleteThingShadow in the IoT Developer Guide.
Parameter Syntax
$result = $client->deleteThingShadow([
'shadowName' => '<string>',
'thingName' => '<string>', // REQUIRED
]);
Parameter Details
Members
- shadowName
-
- Type: string
The name of the shadow.
- thingName
-
- Required: Yes
- Type: string
The name of the thing.
Result Syntax
[
'payload' => <string || resource || Psr\Http\Message\StreamInterface>,
]
Result Details
Members
- payload
-
- Required: Yes
- Type: blob (string|resource|Psr\Http\Message\StreamInterface)
The state information, in JSON format.
Errors
- ResourceNotFoundException:
The specified resource does not exist.
- InvalidRequestException:
The request is not valid.
- ThrottlingException:
The rate exceeds the limit.
- UnauthorizedException:
You are not authorized to perform this operation.
- ServiceUnavailableException:
The service is temporarily unavailable.
- InternalFailureException:
An unexpected error has occurred.
- MethodNotAllowedException:
The specified combination of HTTP verb and URI is not supported.
- UnsupportedDocumentEncodingException:
The document encoding is not supported.
GetConnection
$result = $client->getConnection([/* ... */]); $promise = $client->getConnectionAsync([/* ... */]);
Retrieves connection information for the specified MQTT client.
Requires permission to access the GetConnection action.
Parameter Syntax
$result = $client->getConnection([
'clientId' => '<string>', // REQUIRED
'includeSocketInformation' => true || false,
]);
Parameter Details
Members
- clientId
-
- Required: Yes
- Type: string
The unique identifier of the MQTT client to retrieve connection information. The client ID can't start with a dollar sign ($).
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.
- includeSocketInformation
-
- Type: boolean
Specifies if socket information (sourcePort, targetPort, sourceIp, targetIp) should be included in the GetConnection response. Set to
TRUEto include socket information. Set toFALSEto omit socket information. By default, this is set toFALSE. See the developer guide for how to authorize this parameter.
Result Syntax
[
'cleanSession' => true || false,
'clientId' => '<string>',
'connected' => true || false,
'connectedSince' => <integer>,
'disconnectReason' => '<string>',
'disconnectedSince' => <integer>,
'keepAliveDuration' => <integer>,
'sessionExpiry' => <integer>,
'sourceIp' => '<string>',
'sourcePort' => <integer>,
'targetIp' => '<string>',
'targetPort' => <integer>,
'thingName' => '<string>',
'vpcEndpointId' => '<string>',
]
Result Details
Members
- cleanSession
-
- Type: boolean
Indicates whether the client is using a clean session. Returns
truefor clean sessions orfalsefor persistent sessions. - clientId
-
- Type: string
The unique identifier of the MQTT client. This is the same client ID that was used when the client established the connection.
- connected
-
- Type: boolean
The connection state of the client. Returns
trueif the client is currently connected, orfalseif the client is not connected. - connectedSince
-
- Type: long (int|float)
Unix timestamp (in milliseconds) indicating when the client connected. Present only when connected is true.
- disconnectReason
-
- Type: string
The reason for the last disconnection, if the client is currently disconnected. See the developer guide for valid disconnect reasons.
- disconnectedSince
-
- Type: long (int|float)
Unix timestamp (in milliseconds) indicating when the client disconnected. Present only when connected is false. This information is available for 30 minutes after the client disconnects.
- keepAliveDuration
-
- Type: int
The keep-alive interval in seconds that the client specified when establishing the connection.
- sessionExpiry
-
- Type: long (int|float)
The session expiry interval in seconds for the MQTT client connection. This is configured by the user. This value indicates how long the session will remain active after the client disconnects.
- sourceIp
-
- Type: string
The IP address of the client that initiated the connection.
- sourcePort
-
- Type: int
The client's source port.
- targetIp
-
- Type: string
The IP address of the Amazon Web Services IoT Core endpoint that the client connected to. For clients connected to VPC endpoints, this is the private IP address of the network interface the client is connected to.
- targetPort
-
- Type: int
The port number of the Amazon Web Services IoT Core endpoint that the client connected to.
- thingName
-
- Type: string
The name of the thing associated with the principal of the MQTT client, if applicable.
- vpcEndpointId
-
- Type: string
The ID of the VPC endpoint. Present for clients connected to IoT Core via a VPC endpoint.
Errors
- InvalidRequestException:
The request is not valid.
- ForbiddenException:
The caller isn't authorized to make the request.
- ResourceNotFoundException:
The specified resource does not exist.
- ThrottlingException:
The rate exceeds the limit.
- InternalFailureException:
An unexpected error has occurred.
GetRetainedMessage
$result = $client->getRetainedMessage([/* ... */]); $promise = $client->getRetainedMessageAsync([/* ... */]);
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.
Requires permission to access the GetRetainedMessage action.
For more information about messaging costs, see Amazon Web Services IoT Core pricing - Messaging.
Parameter Syntax
$result = $client->getRetainedMessage([
'topic' => '<string>', // REQUIRED
]);
Parameter Details
Members
- topic
-
- Required: Yes
- Type: string
The topic name of the retained message to retrieve.
Result Syntax
[
'lastModifiedTime' => <integer>,
'payload' => <string || resource || Psr\Http\Message\StreamInterface>,
'qos' => <integer>,
'topic' => '<string>',
'userProperties' => <string || resource || Psr\Http\Message\StreamInterface>,
]
Result Details
Members
- lastModifiedTime
-
- Type: long (int|float)
The Epoch date and time, in milliseconds, when the retained message was stored by IoT.
- payload
-
- Type: blob (string|resource|Psr\Http\Message\StreamInterface)
The Base64-encoded message payload of the retained message body.
- qos
-
- Type: int
The quality of service (QoS) level used to publish the retained message.
- topic
-
- Type: string
The topic name to which the retained message was published.
- userProperties
-
- Type: blob (string|resource|Psr\Http\Message\StreamInterface)
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
userPropertiesparameter is a JSON string that represents two user properties. Note that it will be base64-encoded:[{"deviceName": "alpha"}, {"deviceCnt": "45"}]
Errors
- InvalidRequestException:
The request is not valid.
- ResourceNotFoundException:
The specified resource does not exist.
- ThrottlingException:
The rate exceeds the limit.
- UnauthorizedException:
You are not authorized to perform this operation.
- ServiceUnavailableException:
The service is temporarily unavailable.
- InternalFailureException:
An unexpected error has occurred.
- MethodNotAllowedException:
The specified combination of HTTP verb and URI is not supported.
GetThingShadow
$result = $client->getThingShadow([/* ... */]); $promise = $client->getThingShadowAsync([/* ... */]);
Gets the shadow for the specified thing.
Requires permission to access the GetThingShadow action.
For more information, see GetThingShadow in the IoT Developer Guide.
Parameter Syntax
$result = $client->getThingShadow([
'shadowName' => '<string>',
'thingName' => '<string>', // REQUIRED
]);
Parameter Details
Members
- shadowName
-
- Type: string
The name of the shadow.
- thingName
-
- Required: Yes
- Type: string
The name of the thing.
Result Syntax
[
'payload' => <string || resource || Psr\Http\Message\StreamInterface>,
]
Result Details
Members
- payload
-
- Type: blob (string|resource|Psr\Http\Message\StreamInterface)
The state information, in JSON format.
Errors
- InvalidRequestException:
The request is not valid.
- ResourceNotFoundException:
The specified resource does not exist.
- ThrottlingException:
The rate exceeds the limit.
- UnauthorizedException:
You are not authorized to perform this operation.
- ServiceUnavailableException:
The service is temporarily unavailable.
- InternalFailureException:
An unexpected error has occurred.
- MethodNotAllowedException:
The specified combination of HTTP verb and URI is not supported.
- UnsupportedDocumentEncodingException:
The document encoding is not supported.
ListNamedShadowsForThing
$result = $client->listNamedShadowsForThing([/* ... */]); $promise = $client->listNamedShadowsForThingAsync([/* ... */]);
Lists the shadows for the specified thing.
Requires permission to access the ListNamedShadowsForThing action.
Parameter Syntax
$result = $client->listNamedShadowsForThing([
'nextToken' => '<string>',
'pageSize' => <integer>,
'thingName' => '<string>', // REQUIRED
]);
Parameter Details
Members
- nextToken
-
- Type: string
The token to retrieve the next set of results.
- pageSize
-
- Type: int
The result page size.
- thingName
-
- Required: Yes
- Type: string
The name of the thing.
Result Syntax
[
'nextToken' => '<string>',
'results' => ['<string>', ...],
'timestamp' => <integer>,
]
Result Details
Members
- nextToken
-
- Type: string
The token to use to get the next set of results, or null if there are no additional results.
- results
-
- Type: Array of strings
The list of shadows for the specified thing.
- timestamp
-
- Type: long (int|float)
The Epoch date and time the response was generated by IoT.
Errors
- ResourceNotFoundException:
The specified resource does not exist.
- InvalidRequestException:
The request is not valid.
- ThrottlingException:
The rate exceeds the limit.
- UnauthorizedException:
You are not authorized to perform this operation.
- ServiceUnavailableException:
The service is temporarily unavailable.
- InternalFailureException:
An unexpected error has occurred.
- MethodNotAllowedException:
The specified combination of HTTP verb and URI is not supported.
ListRetainedMessages
$result = $client->listRetainedMessages([/* ... */]); $promise = $client->listRetainedMessagesAsync([/* ... */]);
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 with the topic name of the retained message.
Requires permission to access the ListRetainedMessages action.
For more information about messaging costs, see Amazon Web Services IoT Core pricing - Messaging.
Parameter Syntax
$result = $client->listRetainedMessages([
'maxResults' => <integer>,
'nextToken' => '<string>',
]);
Parameter Details
Members
- maxResults
-
- Type: int
The maximum number of results to return at one time.
- nextToken
-
- Type: string
To retrieve the next set of results, the
nextTokenvalue from a previous response; otherwise null to receive the first set of results.
Result Syntax
[
'nextToken' => '<string>',
'retainedTopics' => [
[
'lastModifiedTime' => <integer>,
'payloadSize' => <integer>,
'qos' => <integer>,
'topic' => '<string>',
],
// ...
],
]
Result Details
Members
- nextToken
-
- Type: string
The token for the next set of results, or null if there are no additional results.
- retainedTopics
-
- Type: Array of RetainedMessageSummary structures
A summary list the account's retained messages. The information returned doesn't include the message payloads of the retained messages.
Errors
- InvalidRequestException:
The request is not valid.
- ThrottlingException:
The rate exceeds the limit.
- UnauthorizedException:
You are not authorized to perform this operation.
- ServiceUnavailableException:
The service is temporarily unavailable.
- InternalFailureException:
An unexpected error has occurred.
- MethodNotAllowedException:
The specified combination of HTTP verb and URI is not supported.
ListSubscriptions
$result = $client->listSubscriptions([/* ... */]); $promise = $client->listSubscriptionsAsync([/* ... */]);
Returns a list of all subscriptions for MQTT clients with active sessions, including offline clients with persistent sessions.
Requires permission to access the ListSubscriptions action.
Parameter Syntax
$result = $client->listSubscriptions([
'clientId' => '<string>', // REQUIRED
'maxResults' => <integer>,
'nextToken' => '<string>',
]);
Parameter Details
Members
- clientId
-
- Required: Yes
- Type: string
The unique identifier of the MQTT client to list subscriptions for. The client ID can't start with a dollar sign ($).
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.
- maxResults
-
- Type: int
The maximum number of subscriptions to return in a single request. By default, this is set to 20.
- nextToken
-
- Type: string
To retrieve the next set of results, the
nextTokenvalue from a previous response; otherwise null to receive the first set of results.
Result Syntax
[
'nextToken' => '<string>',
'subscriptions' => [
[
'qos' => <integer>,
'topicFilter' => '<string>',
],
// ...
],
]
Result Details
Members
- nextToken
-
- Type: string
The token to use to get the next set of results, or null if there are no additional results.
- subscriptions
-
- Type: Array of SubscriptionSummary structures
A list of topic filters and their associated Quality of Service (QoS) levels that the client is subscribed to.
Errors
- InvalidRequestException:
The request is not valid.
- ForbiddenException:
The caller isn't authorized to make the request.
- ResourceNotFoundException:
The specified resource does not exist.
- ThrottlingException:
The rate exceeds the limit.
- InternalFailureException:
An unexpected error has occurred.
Publish
$result = $client->publish([/* ... */]); $promise = $client->publishAsync([/* ... */]);
Publishes an MQTT message.
Requires permission to access the Publish action.
For more information about MQTT messages, see MQTT Protocol in the IoT Developer Guide.
For more information about messaging costs, see Amazon Web Services IoT Core pricing - Messaging.
Parameter Syntax
$result = $client->publish([
'contentType' => '<string>',
'correlationData' => '<string>',
'messageExpiry' => <integer>,
'payload' => <string || resource || Psr\Http\Message\StreamInterface>,
'payloadFormatIndicator' => 'UNSPECIFIED_BYTES|UTF8_DATA',
'qos' => <integer>,
'responseTopic' => '<string>',
'retain' => true || false,
'topic' => '<string>', // REQUIRED
'userProperties' => '<string>',
]);
Parameter Details
Members
- contentType
-
- Type: string
A UTF-8 encoded string that describes the content of the publishing message.
- correlationData
-
- Type: string
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.
correlationDatais an HTTP header value in the API. - messageExpiry
-
- Type: long (int|float)
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 Amazon Web Services IoT Core message broker and protocol limits and quotas from the Amazon Web Services Reference Guide. - payload
-
- Type: blob (string|resource|Psr\Http\Message\StreamInterface)
The message body. MQTT accepts text, binary, and empty (null) message payloads.
Publishing an empty (null) payload with retain =
truedeletes the retained message identified by topic from Amazon Web Services IoT Core. - payloadFormatIndicator
-
- Type: string
An
Enumstring value that indicates whether the payload is formatted as UTF-8.payloadFormatIndicatoris an HTTP header value in the API. - qos
-
- Type: int
The Quality of Service (QoS) level. The default QoS level is 0.
- responseTopic
-
- Type: string
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
-
- Type: boolean
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|falseDefault value:
false - topic
-
- Required: Yes
- Type: string
The name of the MQTT topic.
- userProperties
-
- Type: string (string|number|array|map or anything parsable by json_encode)
A JSON string that contains an array of JSON objects. If you don’t use Amazon Web Services SDK or CLI, you must encode the JSON string to base64 format before adding it to the HTTP header.
userPropertiesis an HTTP header value in the API.The following example
userPropertiesparameter is a JSON string which represents two User Properties. Note that it needs to be base64-encoded:[{"deviceName": "alpha"}, {"deviceCnt": "45"}]
Result Syntax
[]
Result Details
Errors
- InternalFailureException:
An unexpected error has occurred.
- InvalidRequestException:
The request is not valid.
- UnauthorizedException:
You are not authorized to perform this operation.
- MethodNotAllowedException:
The specified combination of HTTP verb and URI is not supported.
- ThrottlingException:
The rate exceeds the limit.
SendDirectMessage
$result = $client->sendDirectMessage([/* ... */]); $promise = $client->sendDirectMessageAsync([/* ... */]);
Sends an MQTT message directly to a specific client identified by its client ID.
SendDirectMessage targets a single client ID. The receiving client does not need to subscribe to the topic, but the receiver's policy must allow iot:Receive on the specified topic.
Requires permission to access the SendDirectMessage action.
For more information about messaging costs, see Amazon Web Services IoT Core pricing.
Parameter Syntax
$result = $client->sendDirectMessage([
'clientId' => '<string>', // REQUIRED
'confirmation' => true || false,
'contentType' => '<string>',
'correlationData' => '<string>',
'payload' => <string || resource || Psr\Http\Message\StreamInterface>,
'payloadFormatIndicator' => 'UNSPECIFIED_BYTES|UTF8_DATA',
'responseTopic' => '<string>',
'timeout' => <integer>,
'topic' => '<string>', // REQUIRED
'userProperties' => '<string>',
]);
Parameter Details
Members
- clientId
-
- Required: Yes
- Type: string
The unique identifier of the MQTT client to send the message to.
Client IDs must not exceed 128 characters and can't start with a dollar sign ($). 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. For more information, see Amazon Web Services IoT Core message broker and protocol limits and quotas.
- confirmation
-
- Type: boolean
A Boolean value that specifies whether to wait for delivery confirmation from the receiving client.
When set to
true, the API delivers the message at QoS 1 and waits for the client to send a delivery confirmation (PUBACK) before returning a successful response. If delivery confirmation is not received within the specifiedtimeoutperiod, the API returns HTTP 504.When set to
false, the API delivers the message at QoS 0 and returns after Amazon Web Services IoT Core attempts to deliver the message.Valid values:
true|falseDefault value:
false - contentType
-
- Type: string
The MQTT5 content type property forwarded to the receiving client (for example,
application/json). - correlationData
-
- Type: string
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.
correlationDatais an HTTP header value in the API. - payload
-
- Type: blob (string|resource|Psr\Http\Message\StreamInterface)
The message body. MQTT accepts text, binary, and empty (null) message payloads.
- payloadFormatIndicator
-
- Type: string
An
Enumstring value that indicates whether the payload is formatted as UTF-8.payloadFormatIndicatoris an HTTP header value in the API. - responseTopic
-
- Type: string
A UTF-8 encoded string that's used as the topic name for a response message. The response topic describes the topic which the receiver should publish to as part of the request-response flow. The topic must not contain wildcard characters. For more information, see Amazon Web Services IoT Core message broker and protocol limits and quotas.
- timeout
-
- Type: int
An integer that represents the maximum time, in seconds, to wait for a delivery confirmation (PUBACK) from the receiving client after the message has been delivered. This parameter is only used when
confirmationis set totrue. Ifconfirmationisfalse, this parameter is ignored.The total API response time may be higher than this value due to internal processing. Set your HTTP client timeout to a value greater than this parameter.
Valid range: 1 to 15 seconds.
Default value:
5seconds. - topic
-
- Required: Yes
- Type: string
The topic of the outbound MQTT Publish message to the receiving client. For more information, see Amazon Web Services IoT Core message broker and protocol limits and quotas.
- userProperties
-
- Type: string (string|number|array|map or anything parsable by json_encode)
A JSON string that contains an array of JSON objects. If you don't use Amazon Web Services SDK or CLI, you must encode the JSON string to base64 format before adding it to the HTTP header.
userPropertiesis an HTTP header value in the API.For MQTT 3.1.1 clients, user properties are silently dropped.
The following example
userPropertiesparameter is a JSON string which represents two User Properties. Note that it needs to be base64-encoded:[{"deviceName": "alpha"}, {"deviceCnt": "45"}]
Result Syntax
[
'message' => '<string>',
'traceId' => '<string>',
]
Result Details
Members
- message
-
- Type: string
The status message indicating the result of the operation.
- traceId
-
- Type: string
A unique identifier for the request. Include this value when contacting Amazon Web Services Support for troubleshooting.
Errors
- InternalFailureException:
An unexpected error has occurred.
- InvalidRequestException:
The request is not valid.
- ResourceNotFoundException:
The specified resource does not exist.
- UnauthorizedException:
You are not authorized to perform this operation.
- ForbiddenException:
The caller isn't authorized to make the request.
- ThrottlingException:
The rate exceeds the limit.
- RequestEntityTooLargeException:
The payload exceeds the maximum size allowed.
- GatewayTimeoutException:
The delivery confirmation was not received from the client within the specified timeout period.
UpdateThingShadow
$result = $client->updateThingShadow([/* ... */]); $promise = $client->updateThingShadowAsync([/* ... */]);
Updates the shadow for the specified thing.
Requires permission to access the UpdateThingShadow action.
For more information, see UpdateThingShadow in the IoT Developer Guide.
Parameter Syntax
$result = $client->updateThingShadow([
'payload' => <string || resource || Psr\Http\Message\StreamInterface>, // REQUIRED
'shadowName' => '<string>',
'thingName' => '<string>', // REQUIRED
]);
Parameter Details
Members
- payload
-
- Required: Yes
- Type: blob (string|resource|Psr\Http\Message\StreamInterface)
The state information, in JSON format.
- shadowName
-
- Type: string
The name of the shadow.
- thingName
-
- Required: Yes
- Type: string
The name of the thing.
Result Syntax
[
'payload' => <string || resource || Psr\Http\Message\StreamInterface>,
]
Result Details
Members
- payload
-
- Type: blob (string|resource|Psr\Http\Message\StreamInterface)
The state information, in JSON format.
Errors
- ConflictException:
The specified version does not match the version of the document.
- RequestEntityTooLargeException:
The payload exceeds the maximum size allowed.
- InvalidRequestException:
The request is not valid.
- ThrottlingException:
The rate exceeds the limit.
- UnauthorizedException:
You are not authorized to perform this operation.
- ServiceUnavailableException:
The service is temporarily unavailable.
- InternalFailureException:
An unexpected error has occurred.
- MethodNotAllowedException:
The specified combination of HTTP verb and URI is not supported.
- UnsupportedDocumentEncodingException:
The document encoding is not supported.
Shapes
ConflictException
Description
The specified version does not match the version of the document.
Members
- message
-
- Type: string
The message for the exception.
ForbiddenException
Description
The caller isn't authorized to make the request.
Members
- message
-
- Type: string
GatewayTimeoutException
Description
The delivery confirmation was not received from the client within the specified timeout period.
Members
- message
-
- Type: string
The message for the exception.
InternalFailureException
Description
An unexpected error has occurred.
Members
- message
-
- Type: string
The message for the exception.
InvalidRequestException
Description
The request is not valid.
Members
- message
-
- Type: string
The message for the exception.
MethodNotAllowedException
Description
The specified combination of HTTP verb and URI is not supported.
Members
- message
-
- Type: string
The message for the exception.
RequestEntityTooLargeException
Description
The payload exceeds the maximum size allowed.
Members
- message
-
- Type: string
The message for the exception.
ResourceNotFoundException
Description
The specified resource does not exist.
Members
- message
-
- Type: string
The message for the exception.
RetainedMessageSummary
Description
Information about a single retained message.
Members
- lastModifiedTime
-
- Type: long (int|float)
The Epoch date and time, in milliseconds, when the retained message was stored by IoT.
- payloadSize
-
- Type: long (int|float)
The size of the retained message's payload in bytes.
- qos
-
- Type: int
The quality of service (QoS) level used to publish the retained message.
- topic
-
- Type: string
The topic name to which the retained message was published.
ServiceUnavailableException
Description
The service is temporarily unavailable.
Members
- message
-
- Type: string
The message for the exception.
SubscriptionSummary
Description
Contains information about a subscription for an MQTT client, including the topic filter and Quality of Service (QoS) level.
Members
- qos
-
- Required: Yes
- Type: int
The Quality of Service (QoS) level for the subscription. Valid values are 0 (at most once) and 1 (at least once).
- topicFilter
-
- Required: Yes
- Type: string
The topic filter pattern that the client is subscribed to. May include MQTT wildcards such as + (single-level) and # (multi-level).
ThrottlingException
Description
The rate exceeds the limit.
Members
- message
-
- Type: string
The message for the exception.
UnauthorizedException
Description
You are not authorized to perform this operation.
Members
- message
-
- Type: string
The message for the exception.
UnsupportedDocumentEncodingException
Description
The document encoding is not supported.
Members
- message
-
- Type: string
The message for the exception.