- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
GetGatewayResponsesCommand
Gets the GatewayResponses collection on the given RestApi. If an API developer has not added any definitions for gateway responses, the result will be the API Gateway-generated default GatewayResponses collection for the supported response types.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { APIGatewayClient, GetGatewayResponsesCommand } from "@aws-sdk/client-api-gateway"; // ES Modules import
// const { APIGatewayClient, GetGatewayResponsesCommand } = require("@aws-sdk/client-api-gateway"); // CommonJS import
const client = new APIGatewayClient(config);
const input = { // GetGatewayResponsesRequest
restApiId: "STRING_VALUE", // required
position: "STRING_VALUE",
limit: Number("int"),
};
const command = new GetGatewayResponsesCommand(input);
const response = await client.send(command);
// { // GatewayResponses
// items: [ // ListOfGatewayResponse
// { // GatewayResponse
// responseType: "DEFAULT_4XX" || "DEFAULT_5XX" || "RESOURCE_NOT_FOUND" || "UNAUTHORIZED" || "INVALID_API_KEY" || "ACCESS_DENIED" || "AUTHORIZER_FAILURE" || "AUTHORIZER_CONFIGURATION_ERROR" || "INVALID_SIGNATURE" || "EXPIRED_TOKEN" || "MISSING_AUTHENTICATION_TOKEN" || "INTEGRATION_FAILURE" || "INTEGRATION_TIMEOUT" || "API_CONFIGURATION_ERROR" || "UNSUPPORTED_MEDIA_TYPE" || "BAD_REQUEST_PARAMETERS" || "BAD_REQUEST_BODY" || "REQUEST_TOO_LARGE" || "THROTTLED" || "QUOTA_EXCEEDED" || "WAF_FILTERED",
// statusCode: "STRING_VALUE",
// responseParameters: { // MapOfStringToString
// "<keys>": "STRING_VALUE",
// },
// responseTemplates: {
// "<keys>": "STRING_VALUE",
// },
// defaultResponse: true || false,
// },
// ],
// position: "STRING_VALUE",
// };
GetGatewayResponsesCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
restApiId Required | string | undefined | The string identifier of the associated RestApi. |
limit | number | undefined | The maximum number of returned results per page. The default value is 25 and the maximum value is 500. The GatewayResponses collection does not support pagination and the limit does not apply here. |
position | string | undefined | The current pagination position in the paged result set. The GatewayResponse collection does not support pagination and the position does not apply here. |
GetGatewayResponsesCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
items | GatewayResponse[] | undefined | Returns the entire collection, because of no pagination support. |
position | string | undefined | The current pagination position in the paged result set. The GatewayResponse collection does not support pagination and the position does not apply here. |
Throws
Name | Fault | Details |
---|
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. |