Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/docs/1.x/admin/bruno-collection.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The full collection is available in [this repository](https://github.com/TaloDev

## Collection structure

The collection's **Admin API** folder contains **Game config**, **Leaderboards** and **Stats** requests, mirroring the endpoints documented in the [Admin API reference](/1.x/admin/authentication).
The collection's **Admin API** folder contains **Game config**, **Leaderboards**, **Players** and **Stats** requests, mirroring the endpoints documented in the [Admin API reference](/1.x/admin/authentication).

## Configure the environment

Expand Down
2 changes: 1 addition & 1 deletion content/docs/1.x/admin/meta.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"pages": ["authentication", "common-errors", "dev-data", "bruno-collection", "game-config-api", "game-stat-api", "leaderboard-api"],
"pages": ["authentication", "common-errors", "dev-data", "bruno-collection", "game-config-api", "game-stat-api", "leaderboard-api", "player-api"],
"title": "Admin API reference",
"icon": "admin"
}
94 changes: 94 additions & 0 deletions content/docs/1.x/admin/player-api.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
---
description: Manage players via the admin API. Search for players, update and delete them.
title: Player admin API
seoTitle: Admin players API
---

import { ServiceDocumentation } from '@/components/documentation/ServiceDocumentation'
import { generateServiceTOC } from '@/lib/api-docs'

export const service = 'PlayerAdminAPI'

export const pageToc = [
{ title: 'Overview', url: '#overview', depth: 2 },
{ title: 'Endpoints', url: '#endpoints', depth: 2 },
...generateServiceTOC(service),
{ title: 'Types', url: '#types', depth: 2 },
{ title: 'Player', url: '#player', depth: 3 },
{ title: 'PlayerAlias', url: '#playeralias', depth: 3 },
{ title: 'Prop', url: '#prop', depth: 3 },
{ title: 'RejectedProp', url: '#rejectedprop', depth: 3 },
]

## Overview

The player admin API lets you search for and read [players](/1.x/http/player-api) programmatically, as well as update their props and completely delete them.

## Endpoints

<ServiceDocumentation
service={service}
metaDescription="Talo's player admin API lets you manage players server-side using admin API keys."
/>

## Types

### Player

```ts
type Player = {
id: string
props: Prop[]
aliases: PlayerAlias[]
devBuild: boolean
createdAt: string
lastSeenAt: string
groups: {
id: string
name: string
}[]
}
```

### PlayerAlias

Each alias includes the player it belongs to, without its aliases to avoid a circular reference.

```ts
type PlayerAlias = {
id: number
service: string
identifier: string
displayName: string
player: Player
lastSeenAt: string
createdAt: string
updatedAt: string
}
```

### Prop

```ts
type Prop = {
key: string
value: string
}
```

### RejectedProp

Props that could not be saved are returned in `rejectedProps` when [updating a player](/1.x/admin/player-api#update-a-players-props-or-dev-build-status).

```ts
type RejectedProp = {
key: string
error:
| 'PROP_KEY_TOO_LONG'
| 'PROP_VALUE_TOO_LONG'
| 'PROP_ARRAY_TOO_LONG'
| 'PROP_CONTAINS_PROFANITY'
| 'PROP_KEY_RESERVED'
message: string
}
```
3 changes: 2 additions & 1 deletion public/bruno-collection.html

Large diffs are not rendered by default.

Loading