Naruto API: The API Hidden in the Leaf
├── Controllers
│ ├── CharacterController.cs
│ └── ClanController.cs
├── Models
│ ├── Character.cs
│ ├── Clan.cs
│ ├── DataContext.cs
│ └── Response.cs
├── Properties
│ └── launchSettings.json
├── NarutoAPI.csproj
├── NarutoAPI.sln
├── Program.cs
├── README.md (We are here)
├── appsettings.Development.json
├── appsettings.json
Get all characters: GET/api/character/
Get specific character: GET/api/character/${id}
Get all clan: GET/api/clan/
Get specific clan: GET/api/clan/${id}
PUT/api/character/
POST/api/character/
Request Body:
{
"characterId": 0,
"characterName": "string",
"gender": "string",
"clanId": 0,
"clanName": "string"
}
PUT/api/clan/
POST/api/clan/
Request Body:
{
"clanId": int,
"clanName": "string",
"clanCharacters": [
{
"characterId": 0,
"characterName": "string",
"gender": "string",
"clanId": 0,
"clanName": "string"
}
]
}
** Note: clanCharacters is unnecessary
DELETE/api/character/${id}
[
{
"statusCode": 0,
"statusDescription": "string",
"charactersList": [
{
"characterId": 0,
"characterName": "string",
"gender": "string",
"clanId": 0,
"clanName": "string"
}
],
"clansList": [
{
"clanId": 0,
"clanName": "string",
"clanCharacters": [
{
"characterId": 0,
"characterName": "string",
"gender": "string",
"clanId": 0,
"clanName": "string"
}
]
}
]
}
]
- 3 Endpoints
- api/character/
- api/character/${id}
- api/clan/
- api/clan/${id}
- 3 Methods
- GET
- POST
- PUT
- DELETE
- 1 Controller
- Character Controller
- Clan Controller
- Response Model
- statusCode
- statusDescription
- charactersList
- clansList
- Two Tables
- Characters
- Clans
- One Foreign Key
- ClanID, One to Many from Clans table to Character Table
- Additional Constraint
- CharacterName not null