Player Data Load
API for loading public data from other players.
URL Verification
This API uses the service-storage-api.playnanoo.com domain.
API Information
- URL:
https://service-storage-api.playnanoo.com/storage/v20221001/playerDataLoad - 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 |
|---|---|---|---|
| player_uuid | string | Required | UUID of the player to query |
| storage_key | string | Required | Key of the data to load |
Response Data
Res Class
| Field | Type | Description |
|---|---|---|
| PlayerId | string | Player ID |
| StorageKey | string | Key of the saved data |
| StorageValue | string | Value of the saved data |
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 account is in withdrawal grace period (provided only for accounts in withdrawal grace period)BlockKey: Key provided if account is blocked (provided only for blocked accounts)
Player Data Load Class
using System;
using System.Collections;
using UnityEngine.Networking;
public class StoragePlayerLoad
{
static string path = "https://service-storage-api.playnanoo.com/storage/v20221001/playerDataLoad";
[Serializable]
public class Req : DeviceInfo
{
public string player_uuid; // UUID of the player to query
public string storage_key; // Key of the data to load
public IEnumerator Send(string player_uuid, string storage_key, Action<Res> onSuccess, Action<BaseResponse> onError)
{
if (!string.IsNullOrEmpty(player_uuid)) this.player_uuid = player_uuid;
if (!string.IsNullOrEmpty(storage_key)) this.storage_key = storage_key;
yield return HttpClient.Send<Req, Res>(
UnityWebRequest.kHttpVerbPUT,
path,
requireToken: true,
body: this,
onSuccess: onSuccess,
onError: onError
);
}
}
[Serializable]
public class Res : BaseResponse
{
public string PlayerId;
public string StorageKey;
public string StorageValue;
}
}
Usage Example
public void LoadOtherPlayerData(string targetPlayerUUID)
{
StoragePlayerLoad.Req req = new StoragePlayerLoad.Req();
StartCoroutine(req.Send(
player_uuid: targetPlayerUUID,
storage_key: "public_profile",
onSuccess: res =>
{
Debug.Log("Other player data loading successful");
Debug.Log($"Player ID: {res.PlayerId}");
Debug.Log($"Storage Key: {res.StorageKey}");
// JSON deserialization
var profile = JsonUtility.FromJson<PublicProfile>(res.StorageValue);
Debug.Log($"Player name: {profile.name}");
Debug.Log($"Level: {profile.level}");
},
onError: error =>
{
Debug.LogError($"Data loading failed: [{error.ErrorCode}] {error.Message}");
}
));
}
[Serializable]
public class PublicProfile
{
public string name;
public int level;
public string avatar;
}
Public Data
This API is for querying data from other players. Use it only for data that should be publicly shared, such as rankings and friend information.
Security Caution
Do not store sensitive personal information in this way. Only data that is safe to be public should be stored.