Skip to content

Match Service

Matthew Pfister edited this page Apr 17, 2020 · 8 revisions

Contracts

[POST] /matches

Create a new match

Request Body

{
  games: number;
  isSeasonPoint: boolean;
  losers: string[];
  season: string;
  winners: string[];
  wins: number;
}

Request Headers

{
  Authorization: Bearer Identity Token;
}

Response Body

{
  status: number;
  data: {
    id: string;
    isSeasonPoint: boolean;
    games: number;
    wins: number;
    losers: string[];
    season: string;
    winners: string[];
  }
}

[PUT] /matches/{match_id}

Update a existing match

Request Body

{
  games?: number;
  isSeasonPoint?: boolean;
  losers?: string[];
  season?: string;
  winners?: string;
  wins?: number;
}

Request Headers

{
  Authorization: Bearer Identity Token;
}

Response Body

{
  status: number;
  data: {
    id: string;
    isSeasonPoint: boolean;
    games: number;
    wins: number;
    losers: string[];
    season: string;
    winners: string[];
  }
}

[GET] /matches

Get all matches, or query all matches

Query Parameters

Parameter Data type Examples
winners string OR string[] ?winners=12345678-1234-1234-1234-123456789011
?winners|=12345678-1234-1234-1234-123456789011,?12345678-1234-1234-1234-123456789011
losers string OR string[] ?losers=12345678-1234-1234-1234-123456789011
?losers|=12345678-1234-1234-1234-123456789011,?12345678-1234-1234-1234-123456789011
season string ?season=12345678-1234-1234-1234-123456789011
seasonPoint boolean ?seasonPoint=true

Request Headers

{
  Authorization: Bearer Identity Token;
}

Response Body

{
  status: number;
  data: {
    id: string;
    isSeasonPoint: boolean;
    games: number;
    wins: number;
    losers: string[];
    season: string;
    winners: string[];
  }
}

Clone this wiki locally