Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using an API key in Amazon API Gateway

I have created an API Key and added it to my functions. I have then deployed the api and tested it but still get:

"message": "Forbidden" 

How do I pass the api key with my JSON request as I have been using "x-api-key": "theKey"?

like image 204
cdub Avatar asked Aug 21 '16 05:08

cdub


People also ask

What is API key in AWS API gateway?

API keys are alphanumeric string values that you distribute to application developer customers to grant access to your API. You can use API keys together with Lambda authorizers, IAM roles, or Amazon Cognito to control access to your APIs.


1 Answers

I had to add an API Usage plan, and then link the plan to the API stage.

Seems like this is the only way to link the key to the API, not sure if this is a recent change on AWS.

like image 75
TimoSolo Avatar answered Sep 19 '22 19:09

TimoSolo