Jump to Content

This API Documentation is now deprecated

We are excited to announce our new API Documentation.

Class GetRetainedMessageCommandProtected

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.

Example

Use a bare-bones client and the command you need to make an API call.

import { IoTDataPlaneClient, GetRetainedMessageCommand } from "@aws-sdk/client-iot-data-plane"; // ES Modules import
// const { IoTDataPlaneClient, GetRetainedMessageCommand } = require("@aws-sdk/client-iot-data-plane"); // CommonJS import
const client = new IoTDataPlaneClient(config);
const input = { // GetRetainedMessageRequest
topic: "STRING_VALUE", // required
};
const command = new GetRetainedMessageCommand(input);
const response = await client.send(command);
// { // GetRetainedMessageResponse
// topic: "STRING_VALUE",
// payload: "BLOB_VALUE",
// qos: Number("int"),
// lastModifiedTime: Number("long"),
// userProperties: "BLOB_VALUE",
// };

Param

GetRetainedMessageCommandInput

Returns

GetRetainedMessageCommandOutput

See

Throws

InternalFailureException (server fault)

An unexpected error has occurred.

Throws

InvalidRequestException (client fault)

The request is not valid.

Throws

MethodNotAllowedException (client fault)

The specified combination of HTTP verb and URI is not supported.

Throws

ResourceNotFoundException (client fault)

The specified resource does not exist.

Throws

ServiceUnavailableException (server fault)

The service is temporarily unavailable.

Throws

ThrottlingException (client fault)

The rate exceeds the limit.

Throws

UnauthorizedException (client fault)

You are not authorized to perform this operation.

Throws

IoTDataPlaneServiceException

Base exception class for all service exceptions from IoTDataPlane service.

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

Methods