🎮Setting Up Webhooks for Real Game Data

Objective: To establish webhooks that enable the exchange of real game data between your game and Ludo Rewards.

Example

fetch('https://game-server-dev.fly.dev/api/v1/webhook', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer your_bearer_token_here'
  },
  body: JSON.stringify({
    data: [
      {
        key1: 'value1',
        key2: 'value2'
      }
    ]
  })
});

Endpoint Details

Authentication

Requests to the endpoint require authentication using a bearer token.

Obtaining a Bearer Token

  • Tokens can created on the Ludo platform.

  • Ensure the token is included in the header of your requests.

Using the Bearer Token

Add the token to the Authorization header as follows:

Authorization: Bearer YOUR_ACCESS_TOKEN

Data Submission

You can submit data in a key-value format. Our team will assist in mapping your data to our existing schema.

Sample JSON Request

{
  "key1": "value1",
  "key2": "value2"
}

Type of Data

Depending on the use case, different types of game data are needed. Refer to the list of required and optional data points below:

  1. Player Information:

    • Player ID or Username

    • Player Inventory (items owned by the player)

    • Player Level (if applicable)

    • Player Statistics (e.g., experience points, in-game currency) (if applicable)

    Items and Inventory:

    • All Game Items

    • Item Attributes (e.g., name, description, rarity)

    • Item Ownership (which player owns which items)

    • Item Availability (items in the game's marketplace)

    Achievements and Progress:

    • List of Achievements

    • Player Progress in Achievements

    • Unlocked Achievements

    • Achievement Rewards

    Currency and Transactions:

    • In-Game Currency (if applicable)

    • Currency Transactions (e.g., purchases, transfers)

    • Currency Balances for Players

    Game Events:

    • Game Events (e.g., in-game events, tournaments)

    • Event Details (event name, date, rewards)

    • Player Participation in Events

    User Profiles:

    • Player Profiles (e.g., avatars, bios)

    Game State:

    • Current Game State (e.g., active, paused)

    Leaderboards:

    • Leaderboard Data (e.g., top players, scores)

    • Player Rankings

Last updated