An api for reviewing pokemons and their owners using Asp.net, Entity Framework, and Swagger. The api grants the ability to get, put, update, and delete entities with a script to seed a starter database.
The usage of the api is described below with the placeholders from the seed script for context.
To note: All requests apply to all entities in the api so the format for Get /Category/
would be the same if you wanted to Get /Country/
.
GET /Category/
curl -X 'GET' \ 'https://localhost:7142/api/Category' \ -H 'accept: text/plain'
[ { "id": 1, "name": "Electric" }, { "id": 2, "name": "Water" }, { "id": 3, "name": "Leaf" }, ]
POST /Category/
curl -X 'POST' \ 'https://localhost:7142/api/Category' \ -H 'accept: */*' \ -H 'Content-Type: application/json' \ -d '{ "name": "SomeCategoryName" }'
If code 204 (Successful Request): Sucessfully Created
GET /Category/{categoryId}
curl -X 'GET' \ 'https://localhost:7142/api/Category/1' \ -H 'accept: text/plain'
{ "id": 1, "name": "Electric" }
PUT /Category/{categoryId}
curl -X 'PUT' \ 'https://localhost:7142/api/Category/1' \ -H 'accept: */*' \ -H 'Content-Type: application/json' \ -d '{ "id": 1, "name": "Lightning" }'
date: Mon,04 Jul 2022 18:33:37 GMT server: Kestrel
DELETE /Category/{categoryId}
curl -X 'DELETE' \ 'https://localhost:7142/api/Category/1002' \ -H 'accept: */*'
date: Mon,04 Jul 2022 18:39:48 GMT server: Kestrel
GET /Category/pokemon/{categoryId}
curl -X 'GET' \ 'https://localhost:7142/api/Category/pokemon/1' \ -H 'accept: text/plain'
[ { "id": 1, "name": "Pikachu", "birthDate": "1903-01-01T00:00:00" }, { "id": 1002, "name": "string", "birthDate": "2022-07-01T14:04:04.921" }, { "id": 1003, "name": "Evevee", "birthDate": "2022-07-01T15:39:48.712" } ]