Open shayna-k opened 1 year ago
@shayna-k Could we also add a request to get poems from a certain route or a certain bus number? That should be pretty similar to requests already included, but might be nice to have this functionality as well. I've also sent a comment to the database team to ask about storing this info as well.
I really like the idea that we could send users poems written on the same physical bus they are riding, even if those poems were written when that bus was serving a different route. The CTA API provides us with unique bus numbers that we should be able to track and associate with a poem.
@bermanisaac this sounds good! Updated the issue with a placeholder note to be edited later based on how the data will be stored
General ideas for the requests we will handle:
GET:
1. Get all poems
endpoint URL:
/api/poems
description: Get all poems,request optional URL parameters
an example of a request with specifc params set might be:
the request above will return an array of poem objects written by "nick", 20 meters around the given GPS coordinates (121.121029, 23.1029381208)
response returns an Array of poem objects which look like the following:
POST:
1. Post poem
endpoint URL:
/api/add-poem
description: Post a poem to the databaserequest needs to contain a JSON object for a poem in the POST request which looks like:
response if everything went smoothly on the backend
if there was an issue, the API will return an error