Foxpile

Getting started

Quick start

Make your first authenticated request in four steps.

1. Register an application

Create an application in the developer portal and keep its secret server-side.

2. Authorize a user

Redirect the user through the flow described in the authentication guide.

3. Exchange the code

curl -X POST "https://compagnon-api.foxwar.net/oauth/token" \
  -H "Content-Type: application/json" \
  -d '{"client_id":"CLIENT_ID","client_secret":"CLIENT_SECRET","grant_type":"authorization_code","code":"CODE","redirect_uri":"REDIRECT_URI"}'

4. Call the API

const response = await fetch("https://compagnon-api.foxwar.net/v1/stockpiles/maps", {
  headers: { Authorization: `Bearer ${token}` },
});

if (!response.ok) throw new Error(`API error: ${response.status}`);
const stockpiles = await response.json();