GET Request for Events - ActoKids/api GitHub Wiki
For AWS API setup see this link.
GET event object to DynamoDB
GET example curl:
curl -v https://8cex032b53.execute-api.us-west-2.amazonaws.com/sprint2_test/v1/events
GET event by Id example curl:
curl -v https://8cex032b53.execute-api.us-west-2.amazonaws.com/sprint2_test/v1/events/1
Important curl notes:
- Use GET for all events will return all events.
- The event id is passed as the request path parameter.
- Event id's 1 and 2 are valid and will return data.
- Failures responses:
- Error 404 for an event not found.
- Error 500 for Failure to connect or retrieve from the database.
Things to consider moving forward:
- Validation for empty id parameter. This should either go back to the full events page with an error message.
- Error 400 for an invalid id, if the id field is blank a 502 error will return from API Gateway of an internal server error since the path parameter is missing.
Branch Code for Lamda functions: link