# Unsecured Game API

Initially to onboard the unsecured games, please request the OP games team to add your game build into our servers and configure the game to become a tournament-ready game.

#### Onboard new unsecured games:

1. Once the game is uploaded to colyseus server, Configure the game via CMS with necessary details such as developer details, game details, and game URL.
2. During the configuration, select the `Is unsecured game` option as `Yes`
3. Add the game into our smart contract to make it tournament ready.

{% hint style="info" %}
Unsecured games are always free and they don’t allow anyone to create/host a paid tournament.
{% endhint %}

#### Request Access:

1. The game developer needs to request access to our game integration team to utilize this API.
2. Once the game is configured, go to the API client module in the CMS and generate/create API client secrets for the game
3. Retrieve the client id and provide this ID to the game developer to access these APIs.

#### API Documentation:

#### <mark style="color:blue;">**Start tournament API**</mark>

**API Endpoint:**&#x20;

`https://backend.{TARGET_SERVER}.outplay.games/tournament-round/practise/{tournamentId}/start`

**API Endpoint Example:**

{% code overflow="wrap" %}

```
https://backend.dev.outplay.games/tournament-round/practise/4e285d38-b19c-41bd-8764-db4bf294ff32/start
```

{% endcode %}

**Description:**

This API is being used for starting the tournament gameplay in the Arcadia platform by calling the API from the game.

**Payload Description:**

TARGET\_SERVER - This indicates the server URL and points to a respective target server such as `dev, stage, prod`.

| Payload                                                       | Description                                                                                                                  | Payload type  |
| ------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ------------- |
| tournamentId (Required)                                       | UUID of the Arcadia tournament                                                                                               | param         |
| playerId (Required)                                           | UUID of the unique Arcadia players                                                                                           | body - string |
| clientId (Required)                                           | Game client ID - This is required for the authentication purposes                                                            | body - string |
| walletAddress (Optional)                                      | Players wallet address - It can be used to validate the current player’s wallet address against player’s info in our server. | body          |
| x-arcadia-player-ip (Optional but necessary to track user IP) | Pass the player’s IP address while starting the tournament gameplay                                                          | header        |

#### <mark style="color:blue;">End Tournament API</mark>

**API Endpoint:**

`https://backend.{TARGET_SERVER}.outplay.games/tournament-round/practise/{tournamentId}/end`

**Payload Description:**

TARGET\_SERVER - This indicates the server URL and points to a respective target server such as `dev, stage, prod`.

| Payload                      | Description                                                                                                                                                                            | Payload type  |
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
| tournamentId (Required)      | UUID of the Arcadia tournament                                                                                                                                                         | param         |
| playerId (Required)          | UUID of the unique Arcadia players                                                                                                                                                     | body - string |
| clientId (Required)          | Game client ID - This is required for the authentication purposes                                                                                                                      | body - string |
| score (Required)             | Player’s tournament gameplay score                                                                                                                                                     | body - number |
| otherPlayerScores (Optional) | <p>It is an array of objects which represents the other player’s score which will be posted along with current player’s score<br><code>\[{walletId: string, score: number}]</code></p> | body          |

<mark style="color:blue;">**POSTMAN EXAMPLE**</mark>&#x20;

Here below is an example on how to call the API from PostMan so that you can test the server working before integrating into the game itself.\
\
The API accepts JSON objects as param, so the info requested need to be passed as JSON {}\
\
Please note that the keys will be old and you will need to request to OP team a new sets of

```postman_json
playerId
clientId
tournamentId
```

<figure><img src="/files/oF5rHJawTAknhvskCZKR" alt=""><figcaption><p>actual working call from postman</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gitbook.arcadia.fun/colyseus-integration/arcadia-tournaments/unsecured-game-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
