Closed mdewey closed 5 years ago
https://github.com/PerseusRipple/unit-3/tree/master/SafariApi thank you for your help and patience. very fun getting into APIs and C#
Your homework was marked: Meets Expectations
“Ring that bell!” — via Mark Dewey
Take the Safari Online.
Let's Continue our safari adventure
We are taking a surprise trip to the Savannah for a safari to see all sorts of exotic animals. During our time their we want to keep track of all the animals we have seen. For this, we need to create an API to help record what we see.
Objectives
Requirements
For .NET Students, install the
sdg-api
template using the commanddotnet new -i SDG.templates.Web.API
Explorer Mode (C#)
[x] Your database will be named called
SafariVacation
[x] This will have 1 table called
SeenAnimals
that has the following columnsId
Species
CountOfTimesSeen
LocationOfLastSeen
NOTE: This should be made all in the code using
Entity Framework
and not created in thepgcli
.[ ] Your API should have the following endpoints:
GET /Animals
Endpoint that returns all animals you have seenGET /Search?species=lion
that returns all animals where the species name contains the species parameterPOST /Animal
endpoint that adds an animal to the database. THis should take a JSON bodyExplorer Mode (Ruby)
[ ] Your rails application will be named called
safari_vacation
[ ] This will have 1 model called
Animal
that has the following columnsspecies
(string)seen_count
(int)last_seen_location
(string)NOTE: This should be made using
rails generate model
and not created in thepgcli
.[ ] Your API should have the following endpoints:
GET /animals
that returns all the animals as JSONGET /animals?species=lion
that returns all animals as JSON where the species name contains the species parameterPOST /animal
that adds an animal to the database. This should take a JSON bodyAdventure Mode (C#)
GET /Animal/{location}
that returns animals of only that locationPUT /Animal/{id}
endpoint that adds 1 to the count of times seen for that animal (given by id)DELETE /Animal/{id}
endpoint that deletes that animal id from the databaseLocation
be its own tableSearch
endpoint to search by an animal or by locationPUT /Animal/{animal}/{amount}
endpoint that adds{amount}
to that animalAdventure Mode (Ruby)
GET /animals?location={location}
that returns animals of only that locationPUT /animals/increment
that adds 1 to the count of times seen for that animal (given by id)DELETE /animals/{id}
endpoint that deletes that animal id from the databaseEpic Mode
Additional Resources
.NET
Here are the interesting commands you will need for tonight's assignment
NOTES: