Skip to main content

Get All Currencies

API to retrieve all currency information owned by the player.

URL Verification

This API uses the service-api.playnanoo.com domain.

API Information

  • URL: https://service-api.playnanoo.com/currency/v20250301/all
  • 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

This API has no additional request parameters.

Response Data

Res Class

FieldTypeDescription
itemsList<ItemModel>Currency list

ItemModel Class

FieldTypeDescription
currency_codestringCurrency code
currency_amountdoubleCurrency amount owned

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 code
  • Message: Error message
  • WithdrawalKey: Key required for recovery if account is in withdrawal grace period (provided only for accounts in withdrawal grace period)
  • BlockKey: Key provided for blocked accounts (provided only for blocked accounts)

ItemModel Class

[Serializable]
public class ItemModel
{
public string currency_code;

public double currency_amount;
}

Get All Currencies Class

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.Networking;

public class CurrencyAll
{
static string path = "https://service-api.playnanoo.com/currency/v20250301/all";

[Serializable]
public class Req : DeviceInfo
{
public IEnumerator Send(Action<Res> onSuccess, Action<BaseResponse> onError)
{
yield return HttpClient.Send<Req, Res>(
UnityWebRequest.kHttpVerbPUT,
path,
requireToken: true,
body: this,
onSuccess: onSuccess,
onError: onError
);
}
}

[Serializable]
public class Res : BaseResponse
{
public List<ItemModel> items = new List<ItemModel>();
}

[Serializable]
public class ItemModel
{
public string currency_code;

public double currency_amount;
}
}

Usage Example

public void GetAllCurrencies()
{
CurrencyAll.Req req = new CurrencyAll.Req();

StartCoroutine(req.Send(
onSuccess: res =>
{
Debug.Log("Get all currencies successful");

foreach (var item in res.items)
{
Debug.Log($"Currency code: {item.currency_code}");
Debug.Log($"Amount owned: {item.currency_amount}");
}
},
onError: error =>
{
Debug.LogError($"Get all currencies failed: [{error.ErrorCode}] {error.Message}");
}
));
}
Currency Query

This API retrieves all currencies owned by the player at once. It is efficient to use when starting the game or displaying currency status.