From 6379a3c27f5bc5a3b7338882f0b24b588b375db0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Baumk=C3=B6tter?= Date: Tue, 11 Jul 2023 23:44:03 +0000 Subject: [PATCH] public agent endpoints --- models/Agent.json | 7 ++- reference/SpaceTraders.json | 114 ++++++++++++++++++++++++++++++++++++ 2 files changed, 119 insertions(+), 2 deletions(-) diff --git a/models/Agent.json b/models/Agent.json index 2cc3710..f971d08 100644 --- a/models/Agent.json +++ b/models/Agent.json @@ -5,7 +5,7 @@ "accountId": { "type": "string", "minLength": 1, - "description": "Account ID that is tied to this agent." + "description": "Account ID that is tied to this agent. Only included on your own agent." }, "symbol": { "type": "string", @@ -26,10 +26,13 @@ "type": "string", "minLength": 1, "description": "The faction the agent started with." + }, + "shipCount": { + "type": "integer", + "description": "How many ships are owned by the agent." } }, "required": [ - "accountId", "symbol", "headquarters", "credits", diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index b039e4f..4a827aa 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -858,6 +858,120 @@ } ] }, + "/agents": { + "get": { + "description": "Fetch agents details.", + "operationId": "get-agents", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "items": { + "$ref": "../models/Agent.json" + }, + "type": "array" + }, + "meta": { + "$ref": "../models/Meta.json" + } + }, + "required": [ + "data", + "meta" + ], + "type": "object" + } + } + }, + "description": "Successfully fetched agents details." + } + }, + "summary": "List Agents", + "tags": [ + "Agents" + ], + "parameters": [ + { + "schema": { + "type": "integer", + "minimum": 1, + "default": 1 + }, + "in": "query", + "name": "page", + "description": "What entry offset to request" + }, + { + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 20, + "default": 10 + }, + "in": "query", + "name": "limit", + "description": "How many entries to return per page" + } + ], + "security": [ + {}, + { + "AgentToken": [] + } + ] + } + }, + "/agents/{agentSymbol}": { + "get": { + "description": "Fetch agent details.", + "operationId": "get-agent", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "$ref": "../models/Agent.json" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "Successfully fetched agent details." + } + }, + "summary": "Get Agent", + "tags": [ + "Agents" + ], + "parameters": [ + { + "description": "The agent symbol", + "in": "path", + "name": "agentSymbol", + "required": true, + "schema": { + "default": "FEBA66", + "type": "string" + } + } + ], + "security": [ + {}, + { + "AgentToken": [] + } + ] + } + }, "/my/agent": { "get": { "description": "Fetch your agent's details.",