Gameball Developers Guide
v3.0
v3.0
  • Introduction
  • What's New in V3.0
  • Installing Gameball
    • Web
      • Show Gameball Customer Widget
      • Track Customer Events
      • Track Orders & Cashback Reward
      • Integrate Redemption
      • Track Referrals
      • Go-Live Checklist
    • iOS
      • Getting Started
      • Initialize Gameball Customer Profile
      • Track Customer Events
      • Track Orders & Cashback Reward
      • Integrate Redemption
      • Track Referrals
      • Push Notifications
      • Go-Live Checklist
    • Android
      • Getting Started
      • Initialize Gameball SDK
      • Initialize Gameball Customer Profile
      • Track Customer Events
      • Track Referrals
      • Push Notifications
      • Go-Live Checklist
    • React Native
      • Getting Started
      • Initialize Gameball Customer Profile
      • Track Customer Events
      • Track Orders & Cashback Reward
      • Integrate Redemption
      • Track Referrals
      • Push Notifications
      • Go-Live Checklist
      • Migration from v1 to v2
    • Flutter
      • Getting Started
      • Initialize Gameball SDK
      • Initialize Gameball Customer Profile
      • Track Customer Events
      • Track Referrals
      • Go-Live Checklist
    • Generic Mobile App
      • Initialize Gameball Customer Profile
      • Track Customer Events
      • Track Orders & Cashback Reward
      • Integrate Redemption
      • Track Referrals
      • Push Notifications
    • Retail & Modern POS
      • Initialize Gameball Customer Profile
      • Track Orders & Cashback Reward
      • Track Refunds
      • Enable Redemption
        • Prepare POS for Redemption
        • Using Virtual ID
          • Using Virtual Card
  • REST API
    • Overview
      • Server-Side SDKs
    • Authentication
    • API Reference
      • Customer
      • Event
      • Transactions
      • Order
      • Coupons
      • Leaderboard 👑
      • Notifications 👑
      • Configurations 👑
      • Batches 👑
        • Batch Operations Data
      • OTP
      • Partner 🤝
        • Client 🤝
        • Redemption Rule 🤝
        • Cashback Rule 🤝
    • Webhooks
      • Notifications Webhook
      • Customer Profile Webhook
    • Errors
    • Object Reference
  • Tutorials
    • Build Custom UI Elements 👑
      • Display Reward Campaign Progress
      • Show VIP Tiers
      • Show Customer Points Balance
      • Build Leaderboards
      • Show Notifications Inbox
      • Adapt UI to Configurations
      • Advanced UI Techniques
        • Increase Sales with Cashback UI Elements
        • Derive Engagement with Rewards Campaigns UI Elements
    • Tracking Customer Events
    • Build your Own Notification System
    • Checkout Integration Example
    • Redemption Integration Options
      • Redeem with coupon system
        • Integrate your coupon system
          • Example using e-commerce platform(WooCommerce)
          • Example using a custom coupon system
        • Build couponing experience
          • Using Gameball widget
          • Build custom experience
            • Showing customers available points
            • Allowing customers to create coupons
            • Apply the discount code to your cart
        • Coupon integration reference
      • Redeem with direct debt
        • Get customers points balance
        • Redeem customer points
  • Third Party Integrations
    • Segment Integration
Powered by GitBook
On this page
  • Show today’s leaderboard
  • Show last month leaderboard
  • Show the all time leaderboard
  1. Tutorials
  2. Build Custom UI Elements 👑

Build Leaderboards

PreviousShow Customer Points BalanceNextShow Notifications Inbox

Last updated 1 year ago

In your app or web page you may need to display the leaderboard for your customers. In that case you can make use of the that can help you build the desired leaderboard UI in a flexible way that handles different cases.

The returns a list of customers ordered by their rank for a given period of time. A single element in the leaderboard list represents a customer with his status

{
    "displayName": "Player 1",
    "playerUniqueId": "5097238429738",
    "progress": 1748,
    "rank":1,
    "levelName": "Bronze",
    "levelIcon": "https://cdn.gameball.co/uploads/c007/level-bronze@2x.png"
}
…
…

Each customer element in the list has the customer's name, unique id, progress in the given period, rank among the leaderboard, and info about their VIP tier.

Note: Gameball doesn't currently support images for customers. In order to map your customers and their respective images, it has to be done manually.

Show today’s leaderboard

This can be done by sending the from query parameter as today’s date. Lets say today is the 24th of Dec 2021, then the request would be as following

https://api.gameball.co/api/v3.0/integrations/leaderboard?
from=2021-12-24 00:00

Show last month leaderboard

This can be done by sending the from and to query filter setting the boundaries of last month. For example if the current month is December, and you are looking for the previous month's (November) leaderboard. Then we would be setting the from and to dates as below

https://api.gameball.co/api/v3.0/integrations/leaderboard?
from=2021-11-01 00:00&to=2021-11-30 00:00

Show the all time leaderboard

From and to filters are omitted from the request.

https://api.gameball.co/api/v3.0/integrations/leaderboard
https://api.gameball.co/api/v3.0/integrations/leaderboard?
from=2021-11-01 00:00&to=2021-11-30 00:00&playerUniqueId=player456

This will return a playerRank object with the leaderboard list within the response that shows the customer rank even if he is not listed within the leaderboard.

"playerRank": {
    "rank": 70,
    "playersCount": 100
}

The accepts two important filters (from, to) as query strings. These filters control the returned leaderboard time window. Let's consider the following scenarios:

The can also be used to show a specific customer's rank by sending the Player Unique Id as a filter

leaderboard API
leaderboard API
Leaderboard API
leaderboard API