Player Service - Gnome-Lackey/mtglm-docs GitHub Wiki
Contracts
POST Player PUT Player GET All Players GET Player DELETE Player GET All Player Roles PUT Player Role
[POST] /players
Create a new player
Request Body
{
email: string;
epithet?: string;
favoriteColors?: string[];
id: string;
name: string;
userName: string;
}
Request Headers
{
Authorization: Bearer Identity Token;
}
Response Body
{
status: number;
data: {
colors?: string[];
displayName?: string;
email: string;
epithet?: string;
id: string;
userName: string;
}
}
[PUT] /players/{player_id}
Update a existing player
Request Body
{
email?: string;
epithet?: string;
favoriteColors?: string[];
name?: string;
userName?: string;
}
Request Headers
{
Authorization: Bearer Identity Token;
}
Response Body
{
status: number;
data: {
colors?: string[];
displayName?: string;
email: string;
epithet?: string;
id: string;
userName: string;
}
}
[GET] /players
Get all players, or query all players
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 |
|---|---|---|
| name | string | ?name=liliana |
| userName | string | ?userName=ofTheVeil |
| season | string | ?season=12345678-1234-1234-1234-123456789011 |
Request Headers
{
Authorization: Bearer Identity Token;
}
Response Body
{
status: number;
data: [
{
colors?: string[];
displayName?: string;
email: string;
epithet?: string;
id: string;
userName: string;
},
...
]
}
[GET] /players/{player id}
Get an existing player
Request Headers
{
Authorization: Bearer Identity Token;
}
Response Body
{
status: number;
data: {
colors?: string[];
displayName?: string;
email: string;
epithet?: string;
id: string;
userName: string;
}
}
[DELETE] /players/{player id}
Remove an existing player
Request Headers
{
Authorization: Bearer Identity Token;
}
Response Body
{
status: number;
data: {
message: string;
}
}
[GET] players/roles
Get the roles for all players
Request Headers
{
Authorization: Bearer Identity Token;
}
Response Body
{
status: number;
data: {
displayName?: string;
email: string;
id: string;
userName: string;
role: string;
}
}
[PUT] players/{player id}/roles
Get the roles for all players
Request Body
{
role: string;
}
Request Headers
{
Authorization: Bearer Identity Token;
}
Response Body
{
status: number;
data: {
displayName?: string;
email: string;
id: string;
userName: string;
role: string;
}
}