I am trying to create a lambda service on AWS and have it accessed from outside via the API gateway with no authentication or restriction required.
To make things ea
On the API Gateway dashboard choose Resources, click Actions and choose Deploy API. Before your first deployment the only response you'll get is the {"message":"Forbidden"}
.
The only other reason that I've experienced which I don't see mentioned here is literally that you tried to reach the API too quickly after being published. I hit publish and see the "your API is reachable at" domain name, and immediately copy and pasted that into Postman to check it.
I get the forbidden message. Change nothing. Check all settings to ensure that I haven't done anything - everything is correct. Kinda tearing my hair out.
Return a few minutes later to try because I'm quite sure I'm doing it all correct - it works.
DNS man. No matter how fast the Internet is - it ain't instant :)
You need to deploy your api on stage and use stage url go to Resources, click Actions and choose Deploy API
Now if you are getting error
{"message":"Forbidden"}.
Please check following steps
1 ) If you enable api key copy and pass your key in postman
2) Now you still getting same error means you will need to create usage plan
3) set limit and assign plan to your api
If you set 'API' key required to true, you need to pass the api key as header.
API Key is passed as header field 'x-api-key'. Even after adding this field in header, this issue may occur. In that case, please validate below points
I might be too late but one of the reasons API Gateway would give "forbidden" message is when you pass data in request Body on a GET operation. To solve the problem either make your resource POST or you do not pass data in request Body.
There are a few things to do when we receive the {message: forbidden} in the API Gateway:
CORS enabled?
API Key enabled?
If you are still facing issues, let me know so me or one of our cloud gurus @levarne can help.