# Connect your foosball table to packeroo

> The public packeroo API with a guide, a reference and runnable examples in Python, JavaScript, C#, PHP, Go, Java, curl and for the ESP32. Today you pair a table device with a table.

## What you can build today

A device at a table asks for a code and gets its token with it. It shows the code, whoever manages the location enters it in the packeroo app, and from then on the device signs in with its token. It reads which table, location and organization it is paired with. Two operations do this: `POST /device-pairings` and `GET /device`. In the sandbox a third one lets a device confirm its code itself: `POST /sandbox/device-pairings/confirm`.

The [guide](https://developers.packeroo.com/en/guides/pair-a-table-device/) has the whole program in eight languages, from asking for the code to the first answer with 200.

## What is planned

These parts are decided but not built yet. They are listed so you know where the API is going:

- read the queue of a table: which match is running, who plays next
- start a match at the table, report goals live and report the result from the table
- recognize players by their chip
- organization keys for intranets, dashboards and chat bots
- webhooks

We name a date once it is fixed. If you need an organization key, [put your name down](mailto:info@packeroo.com?subject=Organization%20key) and we write to you once it exists. Every new operation appears in the [changelog](https://developers.packeroo.com/en/changelog/) on the day it becomes public.

## In three steps

1. **Ask for a code.** Your device sends `POST /device-pairings` and gets a code of six characters, valid for ten minutes, and its token.
2. **Show the code.** The device shows the code as two groups of three and as a QR code. Whoever manages the location scans it with their phone, or types it in the app: under Profile › Organization › Tables, then "Pair a device" at the table, or at `app.packeroo.com/verbinden`.
3. **Sign in.** The device asks `GET /device` every five seconds. Until the code has been entered, the answer is 401; then it is 200 with the table, location and organization.

## Everything for the integration

- [Quickstart](https://developers.packeroo.com/en/quickstart/)
  From the code to a paired device, in eight languages.
- [Pair a table device](https://developers.packeroo.com/en/guides/pair-a-table-device/)
  The guide with the complete program, the error cases and the rules for the display at the table.
- [Concepts](https://developers.packeroo.com/en/concepts/)
  Tokens, idempotency keys, error answers, rate limits, User-Agent, times and versions.
- [Reference](https://developers.packeroo.com/en/reference/)
  Every public operation with schemas, errors and code samples in many languages.
- [Postman and OpenAPI](https://developers.packeroo.com/en/downloads/)
  The collection with a sandbox environment, and the contract as JSON and YAML.
- [For AI assistants](https://developers.packeroo.com/en/ai/)
  `llms.txt`, every page as Markdown and the OpenAPI file at fixed addresses.

## Sandbox and contact

To try things out there is the sandbox at `https://api.qm.packeroo.com/api/v1`; tokens there start with `pkd_test_`. There your device pairs itself, with a test table of its own and without signing up with us: the [quickstart](https://developers.packeroo.com/en/quickstart/) shows how. We answer questions at [info@packeroo.com](mailto:info@packeroo.com).
