Match Service - Gnome-Lackey/mtglm-docs GitHub Wiki
Contracts
POST Match PUT Match GET All Matches GET Match DELETE Match
[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
For more information on how to use queries with this endpoint, see our service query FAQ page in the wiki.
| 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[];
},
...
]
}
[GET] /matches/{match id}
Get an existing match
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[];
}
}
[DELETE] /matches/{match id}
Remove an existing match
Request Headers
{
Authorization: Bearer Identity Token;
}
Response Body
{
status: number;
data: {
message: string;
}
}