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**, **Players** and **Stats** requests, mirroring the endpoints documented in the [Admin API reference](/1.x/admin/authentication).
The collection's **Admin API** folder contains **Game channels**, **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
102 changes: 102 additions & 0 deletions content/docs/1.x/admin/game-channel-api.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
description: Manage game channels via the admin API. Create, update, delete and list channels and their storage.
title: Game channel admin API
seoTitle: Admin game channels API
---

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

export const service = 'GameChannelAdminAPI'

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

## Overview

The game channel admin API lets you create, update, delete and list [game channels](/1.x/http/game-channel-api) programmatically, as well as read their storage props.

## Endpoints

<ServiceDocumentation
service={service}
metaDescription="Talo's game channel admin API lets you manage game channels and their storage props server-side using admin API keys."
/>

## Types

### GameChannel

```ts
type GameChannel = {
id: number
name: string
owner: PlayerAlias | null
totalMessages: number
memberCount: number // cost of the X-Talo-Include-Dev-Data header
props: Prop[]
autoCleanup: boolean
private: boolean
temporaryMembership: boolean
createdAt: string
updatedAt: string
}
```

### Prop

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

### GameChannelStorageProp

```ts
type GameChannelStorageProp = {
key: string
value: string
createdBy: PlayerAlias
lastUpdatedBy: PlayerAlias
createdAt: string
updatedAt: string
}
```

### PlayerAlias

```ts
type PlayerAlias = {
id: number
service: string
identifier: string
displayName: string
player: Player // aliases are omitted to avoid a circular reference
lastSeenAt: string
createdAt: string
updatedAt: string
}
```

### RejectedProp

```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
}
```

Creating or updating a channel whose props fail the size or profanity checks returns `400` with `errors.props` and a `rejectedProps` array.
2 changes: 0 additions & 2 deletions content/docs/1.x/admin/game-config-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ export const pageToc = [

The game config admin API lets you read and update your [live config](/1.x/http/game-config-api) programmatically, as well as schedule future changes. This is useful for automating changes like raising the level cap ahead of a patch or enabling an event at a specific time.

Reading config requires the `read:gameConfig` scope. Updating config and managing scheduled changes requires the `write:gameConfig` scope.

## Endpoints

<ServiceDocumentation
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", "player-api"],
"pages": ["authentication", "common-errors", "dev-data", "bruno-collection", "game-channel-api", "game-config-api", "game-stat-api", "leaderboard-api", "player-api"],
"title": "Admin API reference",
"icon": "admin"
}
Loading