Andreas Selenwall
Andreas Selenwall

Reputation: 5785

Internal error message when calling a API Gateway based REST API

Need some help :) I have created a simple AWS API Gateway with a lambda backend just for trying it out. The only response is { "date": "2017-01-01" }, and the only method accepted is GET. When I test the API in the AWS Console it works fine. The response is as expected. But when I try to access it externally I get an Internal error message response. It kind of blows of course. Do I have to setup a elastic IP for this to work? I shouldn't have to add any roles to the API Gateway (I assume) since the role only declares what resources the API Gateway should be allowed to access? Or is there a "external access" role of some kind? Ot do I have to provide any HTTP-header when accessing the API?

Upvotes: 0

Views: 188

Answers (1)

Vijayanath Viswanathan
Vijayanath Viswanathan

Reputation: 8541

Please enable CORS if you accesing API from an external domain. Please see the screenshot below, which shows how to enable CORS

enter image description here

Upvotes: 1

Related Questions