- Go to services and select api gateway under aplication services
- Create api, new api: Lectures, create
- Actions create resource: TempSensor, create resource
- Actions create method: post, then we integrate with a lambda function (see another post to create lambda function).
- You will get something like:
You are about to give API Gateway permission to invoke your Lambda function:arn:aws:lambda:us-west-2:971111:function:RegisterLecture
- Click the test button (ligthening)
- in Request body, put the post in this case
Request:/tempsensor Status: 200
Latency: 161 ms
Agregado: temp001 28.30
9.Actions, deploy api, pick up [new], stagename:betahm, stage desc: blank, deployment desc: blank
10. After that we can use postman or RESTconsole to test Invoke URL, clicking the post/get method in left panel: https://aqxxxxkm6.execute-api.us-west-2.amazonaws.com/betahm/tempsensor
In case anyone else lands here with the same problem, here is what was going on: at the end of the tutorial, I clicked “Deploy API” in order to deploy the test call I had set up. This takes you to the “Stage Editor” for the given API stage. At the top of the editor page is an “Invoke URL”, which does not include the resource at the end of it. Clicking on the Invoke URL link brings up an authentication error response.
On the Stage Editor page, there is a left nav with the stage name. If you expand this you get a forward-slash; if you expand this, you get your resource. If you expand your resource you get your method, and if you click on the method you get an “Invoke URL” link (which is the same as the above but with the resource appended). This invoke URL link works, invoking the GET method and returning results.
Somewhat hidden, in my opinion, but once you know where to look for it it all makes sense.