Query Previous Season Range
API for querying rankings within a specific range from a previous season leaderboard.
URL Verification
This API uses the service-api.playnanoo.com domain.
API Information
- URL:
https://service-api.playnanoo.com/leaderboard/v20240301/range/prev - Method:
PUT - Authentication Required: Yes
DeviceInfo Inheritance
The Req class of this API inherits from DeviceInfo. All properties of DeviceInfo are automatically included.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| uid | string | Required | Table code |
| rotation_count | int | Required | Season number (previous season to query) |
| range_start | int | Required | Starting rank (starts from 1) |
| range_end | int | Required | Ending rank |
Response Data
Res Class
| Field | Type | Description |
|---|---|---|
| Items | List<RangeItemModel> | Ranking list |
Unity C# Implementation
BaseResponse Class
Base class for all API responses.
public class BaseResponse
{
public string ErrorCode;
public string Message;
public string WithdrawalKey;
public string BlockKey;
}
Field descriptions:
ErrorCode: Error codeMessage: Error messageWithdrawalKey: Key required for recovery if in withdrawal grace period (only provided for accounts in withdrawal grace period)BlockKey: Key provided if account is blocked (only provided for blocked accounts)
Query Previous Season Range Class
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.Networking;
public class RangePrev
{
static string path = "https://service-api.playnanoo.com/leaderboard/v20240301/range/prev";
[Serializable]
public class Req : DeviceInfo
{
public string uid;
public int rotation_count;
public int range_start;
public int range_end;
public IEnumerator Send(string table_code, int rotaionCount, int rangeStart, int rangeEnd, Action<Res> onSuccess, Action<BaseResponse> onError)
{
if (!string.IsNullOrEmpty(table_code)) this.uid = table_code;
this.rotation_count = rotaionCount;
this.range_start = rangeStart;
this.range_end = rangeEnd;
yield return HttpClient.Send<Req, Res>(
UnityWebRequest.kHttpVerbPUT,
path,
requireToken: true,
body: this,
onSuccess: onSuccess,
onError: onError
);
}
}
[Serializable]
public class Res : BaseResponse
{
public List<RangeItemModel> Items;
}
[Serializable]
public class RangeItemModel
{
public int Rank;
public int RotationCount;
public string RecordId;
public int Score;
public string ExtraData;
}
}
Usage Example
public void GetPreviousSeasonRange()
{
RangePrev.Req req = new RangePrev.Req();
StartCoroutine(req.Send(
table_code: "my_leaderboard_table",
rotaionCount: 1, // Previous season number
rangeStart: 1, // From rank 1
rangeEnd: 10, // To rank 10
onSuccess: res =>
{
Debug.Log("Previous season rankings retrieved successfully");
Debug.Log($"Records retrieved: {res.Items.Count}");
foreach (var item in res.Items)
{
Debug.Log($"Rank: {item.Rank}");
Debug.Log($"Player ID: {item.RecordId}");
Debug.Log($"Score: {item.Score}");
Debug.Log($"Season: {item.RotationCount}");
if (!string.IsNullOrEmpty(item.ExtraData))
{
Debug.Log($"Additional data: {item.ExtraData}");
}
}
},
onError: error =>
{
Debug.LogError($"Previous season ranking retrieval failed: [{error.ErrorCode}] {error.Message}");
}
));
}
Previous Season Range Query
You can specify a particular previous season using rotation_count and define a ranking range using range_start and range_end.
Season-based Rankings
Previous season ranking data is read-only and stored separately by season. It can be used for purposes such as querying top rankers of each season to distribute season rewards.