REST API
A plugin for xTIPP that adds a stateless REST API with a Swagger UI. It is built on the plugin system of xTIPP, so no file of xTIPP is changed, and the plugin survives updates of xTIPP.
The key page of the plugin is in German, like xTIPP itself. The API and its Swagger documentation are in English.
The plugin uses internal classes of xTIPP (Ranking, Season, Game, Bonus, BonusTip, TipPointCalculation,
SendTipConfirmationEmail), so it is pinned to xTIPP 1.0.36 (xtipp_max in plugin.json). If you use the plugin,
wait with the xTIPP update until the plugin is updated.
Features
- Read leagues, seasons, matchdays/rounds with their games, your own tips, the tip overview and the rankings (single season and all-time).
- Create, change and delete your own tips, with the same rules as the tip page: deadline, no draw tips for knockout games when the extra time counts, email confirmation.
- Read the bonus questions and give, change and delete your own answers, with the same rules as the bonus page: deadline, clubs/players which can be chosen, number of answers.
- Authentication with a personal API key as Bearer token. No username and password, no session, no cookie.
- Every user has one key and manages it on their own page: create, regenerate, revoke, delete, with an optional expiry date.
- The administrator decides who may use the API: all users, only administrators
or only members of the role
API-Benutzer. - A Swagger UI at
/api/docswith the complete description of the API, only for logged-in users with access to the API. All calls can be tried out there.
Quick start
-
Open API-Schlüssel in the profile menu and create your key. Copy it, it is shown only once.
-
Call the API with the key as Bearer token:
curl -H "Authorization: Bearer xtk_..." https://your-site/api/v1/leagues -
Follow the ids from there: leagues → seasons → matchdays → games. See Endpoints.
Limitations
- Not covered: the bonus overview (answers of other users), tip groups, messages, news, profiles and administration.
- The API depends on internal classes of xTIPP and is pinned to 1.0.36. Check it after an update of xTIPP.
- A key has the full rights of its user. There are no scopes.
- There are no CORS headers, so browser applications on another address cannot call the API.