Comment on page

Tournaments API

Game implementation of the tournaments tool.
After completing the required steps; For the implementation on the game side, we tried to make it in the simple but most secure way. Please, make sure to use the Development API key during the development and testing of your integration to work with a private tournament and avoid having test data in production. This key will only work for private tournaments.
We have defined two core endpoints: get tournaments and submit scores.

Client Side: Get Tournaments

The first part of the implementation takes place on the game client/backend side. This first endpoint will provide the active tournaments for your game, given an API Key.
The most critical element will be the _id field, as it will define which tournament you want to submit the player's score to in the second part of the implementation.
Please notice that you'll only be able to access private tournaments and submit scores using a Development API Key.
We recommend adding the active tournament with a visible component in the game so that the player can select and play to it (or instead set it as default).
Get Tournaments

Server Side: Submit Score

This second part of the implementation is the most critical one. Here you'll submit each player score, which will affect its ranking and be displayed in the leaderboard.
Given the critical nature of this functionality, we need to insist on the importance of calling this method from the Game Server or Backend.
You won't be able to submit a score to a public event with a Development API Key
We have chosen to be extra cautious and secure it with an RSA Signature using your private API key. We use this signature method to be sure that the score is sent from a verified server and reduces vulnerabilities and exploits of malicious agents. This provides reliability to the leaderboards displayed in Elixir.
To implement this accurately, the game developer must never expose his private key. And this should be done server-side, not client-side!
You can submit multiple scores for each player. The scores will be grouped by the defined userId or externalUserId you provide with each score, and the total aggregate result will be displayed in the leaderboard.
Submit Score

Additional Tournament Info

If you want to extract the best out of the Elixir Tournaments feature, including these two endpoints will make you stand out:

Tournament Leaderboard

You can access the tournament leaderboard via API to display it inside your game. Apart from the general ranking, you will have access to the player rank. In case you want to display it on your client or if you want to know the winners and assign rewards for a finished tournament.
Get Leaderboard

Tournament Scores

As a verifiable source, this endpoint will provide all scores given a tournament and a specific period. This way, game developers can contrast their data against the data in Elixir to avoid malicious activity and fake scores.
Get Scores
Last modified 26d ago