# Games API

This section describes the structure of the Game API provided by DeBets and it is directed to game providers that are listing their games in DeBets website.

The Game API are simple REST JSON Http API that allow you do to the following things:

  • create games and edit their configuration
  • edit game tags and assign tags to games
  • edit game types
  • edit the configuration of your account

# Request format

The base URL of the API is the following:

https://api.debets.io/api/admin

From now on we will only show the relative URL of all API endpoints. The base URL above must be prepended to the relative URL in order to the the full URL.

When using DeBets staging environment simply add -test to the subdomain as usual:

https://api-test.debets.io/api/admin

All parameters are sent as querystring. The following types are used in this documentation:

integer
string
number
boolean
integerlist
stringlist
numberlist

The value of each parameter type is directly parsed from the querystring and produces and error in case the value that is given cannot be parsed into the expected format.

# Response format

Succesfull requests return an object with a response property whose value contains the result of the actual API call:

{
    "response": [
        {
            "id": "326",
            "config": {
                "name": "20 Hot Fruit Delights",
                "provablyFair": false,
                "verified": true
            },
            "createdAt": 1727457398
        }
    ]
}

Failing requests return an object with an error property containing the error message:

{

    "error": "not authorized"
}

# Authentication mechanism

All requests need to be authenticated. You have the following options:

  • you use HTTP headers to provide credentials on every request
  • you use the login API to obtain a session cookie

# Header based per-request authentication

You use the credentials that DeBets has provided you after the enrollment (the same username/password that you use to access the Backoffice) to add the following HTTP headers to your requests: debets-user, debets-password.

Authenticated request
curl -H "debets-user: myUser" -H "debets-password: myPassword" 'https://api.debets.io/api/admin/providers/games/list?id=3

# Login based authentication

To login use the following API:

/auth/login?user=myUser&password=myPassword

When successful it will return a response like the following:

{
    "response": {
        "id": "S014a84cf5",
        "userId": 2,
        "userType": "provider",
        "username": "myUsername",        
        "created": 1729193931
    }
}

The HTTP response will contain a set-cookie header. You will then have to provide this cookie in your API calls for them to be authenticated.

Use the following API to logout, providing the cookie as for the other API calls:

/auth/logout

# Games management API

# Add a game

Adds a new game to DeBets. The game must exist in your game server with the ID that you provide

Parameter type required description
gameId string ID of the game

# Remove a game

Removes a previosuly added game from DeBets

Parameter type required description
gameId string ID of the game

# List games

Returns the list of your games in DeBets

# Edit the game configuration

Changes the configuration settings of a game

Parameter type required description
gameId string ID of the game
name string name of the game
type string game type (see Game Connector)
disabled boolean when disabled the game cannot be played
hidden boolean hides the game from DeBets website
provablyFair boolean whether or not the game supports Provably Fair
buttonBgColor string sets the color for the game launch button (only used when no image is set for the game launch button)

This example request sets the name and type of the game:

/providers/games/config?gameId=374&type=pixi_slot&name=Lucky 777

# Upload the image for the game launch button

# Remove the image for the game launch button

# Game tags API

# Add a tag

Adds a new tag

Parameter type required description
tag string name of the tag to add

# Remove a tag

Removes a previously added tag

Parameter type required description
tag string name of the tag to remove

# List tags

Returns the list of existing tags

Parameter type required description
withcount boolean when true returns the number of games for each tag in the list

# List games with tags

Returns the list of existing tags

Parameter type required description
tags stringlist return games with these tags
match string use 'all' to return the games that have all requested tags or 'any' to return the games that have at least one of the requested tags (defaults to 'all')
resolve boolean when false returns only the list of gameIds instead of the list of game objects (defaults to true)

The following requests returns all games that have one of Buy Bonus and Megaways tags:

/providers/games/tags/list?tags=Buy Bonus,Megaways&match=any

# List the tags of a game

Returns the list of tags associated to a game

Parameter type required description
gameId string ID of the game

# Add tag to game

Adds the tag to the game

Parameter type required description
gameId string ID of the game
tag string tag to add

# Remove tag from game

Removes the tag from the game

Parameter type required description
gameId string ID of the game
tag string tag to remove

# Set tags for game

Set the tags for the game

Parameter type required description
gameId string ID of the game
tags stringlist tags to set

# Add tag to preferred tags

Adds the tag to the list of preferred ones

Parameter type required description
tag string tag to add

# Remove tag from preferred tags

Removes the tag from the list of preferred ones

Parameter type required description
tag string tag to remove

# List preferred tags

Returns the list of preferred tags