Using an api key in amazon api gateway

cdub picture cdub · Aug 21, 2016 · Viewed 41.9k times · Source

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"?

Answer

TimoSolo picture TimoSolo · Sep 7, 2016

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.