Files
ToneAPI_backend/reference/OpenAPI.yml
T
2023-04-04 18:31:24 +02:00

593 lines
16 KiB
YAML

openapi: 3.0.2
info:
title: ToneAPI
version: '1.0'
contact:
name: Legonzaur
url: 'https://github.com/Legonzaur'
license:
name: The Unlicense
url: 'https://unlicense.org/'
description: 'Stats tracking API for Titanfall 2 Northstar '
servers:
- url: 'https://tone.sleepycat.date/v1'
paths:
/client/servers:
get:
summary: List of servers
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
title: Server
type: object
properties:
id:
type: integer
example: 1
name:
type: string
example: fvnknoots 7v7
examples:
Example 1:
value:
- id: 1
name: fvnknoots 7v7
operationId: get-server-list
description: An array containing the list of servers as objects
parameters: []
/client/weapons:
get:
summary: Statistics for all weapons
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
hemlock:
title: Weapon
type: object
properties:
max_kill_distance:
type: integer
avg_kill_distance:
type: number
kills:
type: integer
examples:
Example 1:
value:
hemlock:
max_kill_distance: 0
avg_kill_distance: 0
kills: 0
lstar:
max_kill_distance: 0
avg_kill_distance: 0
kills: 0
operationId: get-client-weapons
parameters:
- name: server
in: query
required: false
schema:
type: number
example: 2
description: Fetch data for specific server
- name: player
in: query
required: false
schema:
type: number
example: 1005930844007
description: Fetch data for specific player
requestBody:
content: {}
description: A JSON Object with weapon IDS as keys and weapon data as value
description: A JSON Object with weapon IDs as key and weapon data as value
parameters: []
'/client/weapons/{weaponId}':
parameters:
- schema:
type: string
example: epg
name: weaponId
in: path
required: true
description: ID of a weapon
get:
summary: Statistics for a single weapon
operationId: get-client-weapons-weaponId
requestBody:
content: {}
parameters:
- name: server
in: query
required: false
schema:
type: number
example: 2
description: Fetch data for specific server
- name: player
in: query
required: false
schema:
type: number
example: 1005930844007
description: Fetch data for specific player
description: Data for a specific weapon
responses:
'200':
description: OK
content:
application/json:
schema:
title: Weapon
type: object
properties:
max_kill_distance:
type: integer
x-stoplight:
id: npckmqv4zdoje
avg_kill_distance:
type: number
x-stoplight:
id: 8plgr96gp1ke8
kills:
type: integer
x-stoplight:
id: pha6hu1qjfsgk
/client/players:
get:
summary: Statistics for all players
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
'2250125460':
title: Player
type: object
properties:
name:
type: string
example: Legonzaur
deaths:
type: integer
kills:
type: integer
max_kill_distance:
type: integer
avg_kill_distance:
type: number
examples:
Example 1:
value:
'2250125460':
name: Legonzaur
deaths: 0
kills: 0
max_kill_distance: 0
avg_kill_distance: 0
operationId: get-client-players
parameters:
- name: weapon
in: query
required: false
schema:
type: string
example: epg
description: Fetch data for specific weapon
- name: server
in: query
required: false
schema:
type: number
example: 2
description: Fetch data for specific server
description: A JSON Object with player IDs as key and player data as value
'/client/players/{playerId}':
parameters:
- schema:
type: string
name: playerId
in: path
required: true
description: ID of a player
get:
summary: Statistics for a single player
responses:
'200':
description: OK
content:
application/json:
schema:
title: Player
type: object
properties:
name:
type: string
example: Legonzaur
deaths:
type: integer
x-stoplight:
id: xhi261df7kcqo
kills:
type: integer
x-stoplight:
id: ofjpw5sevnf64
max_kill_distance:
type: integer
x-stoplight:
id: qjqm0t2n6o93p
avg_kill_distance:
type: number
x-stoplight:
id: y0i5i1eja7v84
operationId: get-client-players-playerId
parameters:
- name: server
in: query
required: false
schema:
type: number
example: 2
description: Fetch data for specific server
- name: weapon
in: query
required: false
schema:
type: string
example: epg
description: Fetch data for specific weapon
description: Data for a specific player
'/servers/{serverId}':
parameters:
- schema:
type: string
example: '2'
name: serverId
in: path
required: true
description: ID of the server
post:
summary: ''
operationId: post-servers-serverId
responses:
'200':
description: OK
'403':
description: Forbidden
description: Used to test auth
security:
- Auth_Token: []
'/servers/{serverId}/kills':
post:
summary: Post kills
operationId: post-kills
responses:
'201':
description: Created
'400':
description: Bad Request
'401':
description: Unauthorized
parameters: []
security:
- Auth_Token: []
description: Allows a Northstar server to record kills on the database
requestBody:
content:
application/json:
schema:
title: Kill
type: object
properties:
id:
type: integer
readOnly: true
server:
type: string
readOnly: true
tone_version:
type: string
match_id:
type: string
game_mode:
type: string
map:
type: string
game_time:
type: string
format: time
player_count:
type: integer
attacker_name:
type: string
attacker_id:
type: integer
attacker_current_weapon:
type: string
attacker_current_weapon_mods:
type: integer
attacker_weapon_1:
type: string
attacker_weapon_1_mods:
type: integer
attacker_weapon_2:
type: string
attacker_weapon_2_mods:
type: integer
attacker_weapon_3:
type: string
attacker_weapon_3_mods:
type: integer
attacker_offhand_weapon_1:
type: integer
attacker_offhand_weapon_2:
type: integer
victim_name:
type: string
victim_id:
type: integer
victim_current_weapon:
type: string
victim_current_weapon_mods:
type: integer
victim_weapon_1:
type: string
victim_weapon_1_mods:
type: integer
victim_weapon_2:
type: string
victim_weapon_2_mods:
type: integer
victim_weapon_3:
type: string
victim_weapon_3_mods:
type: integer
victim_offhand_weapon_1:
type: integer
victim_offhand_weapon_2:
type: integer
cause_of_death:
type: string
distance:
type: number
required:
- cause_of_death
description: ''
parameters:
- schema:
type: string
example: '2'
name: serverId
in: path
required: true
description: ID of the server
components:
schemas:
Player:
title: Player
x-stoplight:
id: c9lv0bwq7hdx7
type: object
x-examples:
Example 1:
name: Legonzaur
deaths: 0
kills: 0
max_kill_distance: 0
avg_kill_distance: 0
properties:
name:
type: string
example: Legonzaur
deaths:
type: integer
x-stoplight:
id: xhi261df7kcqo
kills:
type: integer
x-stoplight:
id: ofjpw5sevnf64
max_kill_distance:
type: integer
x-stoplight:
id: qjqm0t2n6o93p
avg_kill_distance:
type: number
x-stoplight:
id: y0i5i1eja7v84
Weapon:
title: Weapon
x-stoplight:
id: l8j4cdsuxxrx0
type: object
x-examples:
Example 1:
max_kill_distance: 0
avg_kill_distance: 0
kills: 0
properties:
max_kill_distance:
type: integer
x-stoplight:
id: npckmqv4zdoje
avg_kill_distance:
type: number
x-stoplight:
id: 8plgr96gp1ke8
kills:
type: integer
x-stoplight:
id: pha6hu1qjfsgk
Server:
title: Server
x-stoplight:
id: g45919da0b3rc
type: object
properties:
id:
type: integer
example: 1
name:
type: string
example: fvnknoots 7v7
Kill:
title: Kill
x-stoplight:
id: 8w7qpo5dz7fo9
type: object
x-examples:
Example 1:
id: 0
server: string
tone_version: ks_3.0.0
match_id: 1cde15ee
game_mode: tdm
map: string
game_time: 385.417
player_count: 1
attacker_name: Legonzaur
attacker_id: 0
attacker_current_weapon: rspn101
attacker_current_weapon_mods: 0
attacker_weapon_1: rspn101
attacker_weapon_1_mods: 0
attacker_weapon_2: autopistol
attacker_weapon_2_mods: 0
attacker_weapon_3: defender
attacker_weapon_3_mods: 0
attacker_offhand_weapon_1: 0
attacker_offhand_weapon_2: 8
victim_name: Legonzaur
victim_id: 0
victim_current_weapon: rspn101
victim_current_weapon_mods: 0
victim_weapon_1: rspn101
victim_weapon_1_mods: 0
victim_weapon_2: autopistol
victim_weapon_2_mods: 0
victim_weapon_3: defender
victim_weapon_3_mods: 0
victim_offhand_weapon_1: 0
victim_offhand_weapon_2: 8
cause_of_death: frag_grenade
distance: 0
properties:
id:
type: integer
readOnly: true
server:
type: string
readOnly: true
tone_version:
type: string
match_id:
type: string
game_mode:
type: string
map:
type: string
game_time:
type: string
format: time
player_count:
type: integer
attacker_name:
type: string
attacker_id:
type: integer
attacker_current_weapon:
type: string
attacker_current_weapon_mods:
type: integer
attacker_weapon_1:
type: string
attacker_weapon_1_mods:
type: integer
attacker_weapon_2:
type: string
attacker_weapon_2_mods:
type: integer
attacker_weapon_3:
type: string
attacker_weapon_3_mods:
type: integer
attacker_offhand_weapon_1:
type: integer
attacker_offhand_weapon_2:
type: integer
victim_name:
type: string
victim_id:
type: integer
victim_current_weapon:
type: string
victim_current_weapon_mods:
type: integer
victim_weapon_1:
type: string
victim_weapon_1_mods:
type: integer
victim_weapon_2:
type: string
victim_weapon_2_mods:
type: integer
victim_weapon_3:
type: string
victim_weapon_3_mods:
type: integer
victim_offhand_weapon_1:
type: integer
victim_offhand_weapon_2:
type: integer
cause_of_death:
type: string
distance:
type: number
required:
- cause_of_death
securitySchemes:
Auth_Token:
type: http
scheme: basic
parameters:
server:
name: server
in: query
required: false
schema:
type: number
example: 2
description: Fetch data for specific server
player:
name: player
in: query
required: false
schema:
type: number
example: 1005930844007
description: Fetch data for specific player
weapon:
name: weapon
in: query
required: false
schema:
type: string
example: epg
description: Fetch data for specific weapon
responses: {}
examples: {}