Skip to content

manav809/NarutoAPI

Repository files navigation

Naruto API: The API Hidden in the Leaf

Manav Minesh Patel

Naruto Gif

Table of Contents: File Structure and Organization

├── 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

HTTP Endpoints and Protocols

GET Requests:

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 Requests and POST Requests:

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 Requests:

DELETE/api/character/${id}

Response Body:

[
  {
    "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"
          }
        ]
      }
    ]
  }
]

Project Requirements and Status Checklist:

  • 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

About

Intro to APIs Course

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages