Guest Authentication

Guest Authentication allows users to access the CrateBytes API without needing to register or link a Steam account. This method provides a seamless way for new users to get started while still ensuring that each player has a unique identifier within the system.

Endpoint

POST https://cratebytes.com/api/game/platform/guest
projectKey (body)
string
required

The project key for the game.

playerId (body)
string

The player ID for an existing player. This parameter is optional and should be used if you want to log in to an existing player account.

Response

token
string
required

Token that can be used to authenticate the player in future requests.

playerId
string
required

The player ID for the authenticated player used to log in to the player. account

Example Response

{
    "statusCode": 200,
    "data": {
        "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
        "playerId": "cm2s2i8n500000cml3tqr0ko9"
    }
}

Steam Authentication

Steam Authentication allows users to log in to the CrateBytes API using their Steam accounts. This method leverages Steam’s secure authentication system to ensure that the player’s identity is verified.

You have to add your steam publisher key and steam appid in your project settings

Endpoint

POST https://cratebytes.com/api/game/platform/steam
projectKey (body)
string
required

The project key for the game.

steamAuthTicket (body)
string
required

The Steam authentication ticket received from the Steam client.

Response

token
string
required

Token that can be used to authenticate the player in future requests.

playerId
string
required

The player ID for the authenticated player.

Example Response

{
    "statusCode": 200,
    "data": {
        "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
        "playerId": "cm2s2i8n500000cml3tqr0ko9"
    }
}