Skip to content

WyimaginowaneKoniki/SoccerStatistics.Api

Repository files navigation

License: MIT .NetCoreVersion: 3.1

SoccerStatistics REST API

Overview

SoccerStatistics is a REST API application to search information about Football leagues,teams,players etc.

Table of contents

API Versioning

The first part of the URI path specifies the API version you wish to access in the format v{version_number}.

For example, most current version of the API is accessible via:

http://localhost:{port}/swagger/index.html

URI Summary

The following table summarises all the available resource URIs, and the effect of each verb on them. Each of them is relative to the base URI for our API: http://localhost:{port}/api.

Resource GET
/leagues/ Returns list of available leagues
/leagues/{id} Returns league by ID
/matches/ Returns list of recent matches
/matches/{id} Returns match by ID
/players/ Returns list of available players
/players/{id} Returns player by ID
/rounds/{id} Returns round by ID
/stadiums/ Returns list of available stadiums
/stadiums/{id} Returns stadium by ID
/teams/ Returns list of available teams
/teams/{id} Returns team by ID

HTTP Responses

For example, a request to the /leagues/ resource might return this:

If an error occurred - see HTTP Response Codes).

{
   "Id":1,
   "FullName":"Blick, Nicolas and Mraz Group",
   "ShortName":"Blick, Nicolas and Mraz",
   "CreatedAt":1973,
   "Coach":"Katrina Bergstrom",
   "City":"Berniermouth",
   "Players":
        {"Id":1,
        "Name":"Melyna",
        "Surname":"Klocko",
        "Height":191,
        "Weight":66,
        "Birthday":"1980-12-24T00:00:00",
        "Nationality":"Burundi",
        "DominantLeg":0,
        "Nick":"Klocko_Rowe22",
        "Number":89,
        "Id":2,
        "Name":"Ayla",
        "Surname":"Reichert",
        "Height":181,
        "Weight":58,
        "Birthday":"1980-05-16T00:00:00",
        "Nationality":"Ecuador",
        "DominantLeg":1,
        "Nick":"Reichert_Dare",
        "Number":1},
   "Stadium":
        {"Id":1,
        "Name":"Nitzsche Inc Stadium",
        "Country":"Turks and Caicos Islands",
        "City":"Powlowskibury",
        "BuiltAt":1943,
        "Capacity":30112,
        "FieldSize":"96x06",
        "Cost":362488.25,
        "VipCapacity":5499,
        "IsForDisabled":true,
        "Lighting":51713,
        "Architect":"Lazaro Rogahn",
        "IsNational":true}
  }

HTTP Response Codes

Each response will be returned with one of the following HTTP status codes:

  • 200 OK The request was successful
  • 400 Bad Request There was a problem with the request (security, malformed, data validation, etc.)
  • 404 Not found An attempt was made to access a resource that does not exist in the API
  • 500 Server Error An error on the server occurred

Sample error response:

{
  "type": "https://tools.ietf.org/html/rfc7231#section-6.5.4",
  "title": "Not Found",
  "status": 404,
  "traceId": "|953bb372-40d8e72e899583c2."
}

Technologies

Contributors