Skip to main content

Leaderboard Rewards

Leaderboard​

The Leaderboard reward API allows clients to retrieve leaderboard rewards for the configured leaderboard positions of gamers. the reward is granted at the time of leaderboard reset.

info

Base Endpoint: /api/v1/

Available Endpoints​

1. Get Gamer Leaderboard Reward​

  • Method & Path: GET /leaderboard-reward
  • Description: Retrieves leaderboard rewards of given leaderboard.
  • Query Parameters:
    • leaderboardId: The ID of the application leaderboard .
  • Headers:
    • Authorization: Required. A valid authentication token.
  • Response:
    • A Array of objects. Json object containing the following fields:
      • id: Unique ID of leaderboard reward
      • leaderboardId: Unique ID of the leaderboard
      • rewardPosition: The position in the leaderboard for which the reward is configured.
      • leaderBoardRewardItems: Array of JSON object containing information about reward items
        • quantity: quantity of item to be granted
        • inventoryItem: JSON object containing information about inventory item.
          • id: Unique Id of the inventory item
          • name: Name of the inventory item
          • thumbnailId: Unique Id of thumbnail.

cURL Command​

curl --request GET \
--url 'https://api.yarsaplay.com/api/v1/leaderboard-rewards?leaderboardId=' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN'

Response Body​

[
{
"id": "<uuid>",
"leaderboardId": "<uuid>",
"rewardPosition": "<number>",
"leaderboardRewardItems": [
{
"quantity": "<number>",
"inventoryItem": {
"id": "<uuid>",
"name": "<string>",
"thumbnail": "string"
}
}
]
}
]