GetUsagePlanKeyCommand

Gets a usage plan key of a given key identifier.

Example Syntax

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

import { APIGatewayClient, GetUsagePlanKeyCommand } from "@aws-sdk/client-api-gateway"; // ES Modules import
// const { APIGatewayClient, GetUsagePlanKeyCommand } = require("@aws-sdk/client-api-gateway"); // CommonJS import
const client = new APIGatewayClient(config);
const input = { // GetUsagePlanKeyRequest
  usagePlanId: "STRING_VALUE", // required
  keyId: "STRING_VALUE", // required
};
const command = new GetUsagePlanKeyCommand(input);
const response = await client.send(command);
// { // UsagePlanKey
//   id: "STRING_VALUE",
//   type: "STRING_VALUE",
//   value: "STRING_VALUE",
//   name: "STRING_VALUE",
// };

GetUsagePlanKeyCommand Input

See GetUsagePlanKeyCommandInput for more details

Parameter
Type
Description
keyId
Required
string | undefined

The key Id of the to-be-retrieved UsagePlanKey resource representing a plan customer.

usagePlanId
Required
string | undefined

The Id of the UsagePlan resource representing the usage plan containing the to-be-retrieved UsagePlanKey resource representing a plan customer.

GetUsagePlanKeyCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
id
string | undefined

The Id of a usage plan key.

name
string | undefined

The name of a usage plan key.

type
string | undefined

The type of a usage plan key. Currently, the valid key type is API_KEY.

value
string | undefined

The value of a usage plan key.

Throws

Name
Fault
Details
BadRequestException
client

The submitted request is not valid, for example, the input is incomplete or incorrect. See the accompanying error message for details.

NotFoundException
client

The requested resource is not found. Make sure that the request URI is correct.

TooManyRequestsException
client

The request has reached its throttling limit. Retry after the specified time period.

UnauthorizedException
client

The request is denied because the caller has insufficient permissions.

APIGatewayServiceException
Base exception class for all service exceptions from APIGateway service.