Game Endpoints have three different API sections:

  • Get the Game Details
  • Create a New Game
  • Delete a Game

These three API sections contain specific information comprising various properties whenever the APIs are called.

Get the Game Details

This endpoint lists all ChainEngine console games. It returns the game id, account id, game name, and a link to the game's image.

📘

Prerequisites:

Ensure that you have the following requirements ready before calling the Get the Game Details endpoints:

  • gameId : to check a game.
  • API Secret: credential to call the endpoint.
  • API Key: credential to call the endpoint.

You can find each of the requirements mentioned above within your ChainEngine console.

Payload Response

The payload from the Get the Game Details endpoint returns the following attributes:

AttributeTypeDescription
idstringThe gameId of the game.
namestringThe name of the game.
descriptionstringThe description of the game.
accountIdstringThe identifier of the account linked with the game.
blockchainstringThe blockchain name of the game. 'Polygon' is currently the only supported blockchain.
imagestringThe image path of the game's image.

Endpoint

Below is the available endpoints list for the Get the Game Details:

Endpoint
Get a List of All Games - GET/games
Get Game by Id - GET/games/{id}

Sample Object

An example object returned by the Get a List of All Games endpoint is shown below:

[
  {
    "id": "6a18d45f-d0aa-47c7-9e3e-373a3e691a66",
    "name": "The Journey to the North",
    "description": "Experience the adventure of the nordic warriors as they conquer the northern land.",
    "accountId": "015eeff0-0133-4fb9-9a44-dcc832d96c3d",
    "blockchain": "POLYGON",
    "image": "/images/006b7978-6886-421e-a9e9-9d5dfc87cd88"
  }
]

Create a New Game

This endpoint allows you to create a new game. The new game can be found and managed within the ChainEngine console.

📘

Prerequisites:

Ensure that you have the following requirements ready before calling the Create a New Game endpoints:

  • API Secret: credential to call the endpoint.
  • API Key: credential to call the endpoint.

You can find each of the requirements mentioned above within your ChainEngine console.

Payload Response

The Create a New Game payload returns the following attributes:

AttributeTypeDescription
idstringThe newly created game id.
namestringThe name of the newly created game.
descriptionstringThe description of the newly created game.
accountIdstringThe identifier of the account linked with the newly created game.
blockchainstringThe blockchain name of the newly created game. 'Polygon' is currently the only supported blockchain.
imagestringThe image path of the newly created game.

Endpoint

Below is the available endpoints list for the Create a New Game:

Endpoint
Create New Game - POST/games

Sample Object

An example object returned by the Create New Game endpoint is shown below:

{
  "id": "c78d7bc5-a76e-4893-b54c-ec36f65074cd",
  "name": "The Adventure of Saga 2",
  "description": "The saga adventure's sequel uncovers the dark truth of the kingdom.",
  "accountId": "015eeff0-0133-4fb9-9a44-dcc832d96c3d",
  "blockchain": "POLYGON",
  "image": "/images/0801157e-fd81-4ec1-a2b9-6f03bf619e92"
}

Delete a Game

This endpoint deletes games by gameId. All the game information is deleted from the ChainEngine console, including the player.

📘

Prerequisites:

Ensure that you have the following requirements ready before calling the Delete a Game Endpoints:

  • gameId : to check a game.
  • API Secret: credential to call the endpoint.
  • API Key: credential to call the endpoint.

You can find each of the requirements mentioned above within your ChainEngine console.

Payload Response

The payload from the Delete a Game endpoint returns No attributes.

Endpoint

Below is the available endpoints list for the Delete Game:

Endpoint
Delete Game by Id - DELETE/games/{id}

Sample Object

An example object returned by the Delete Game by Id endpoint is shown below:

Ok