Skip to main content

Prerequisites

1. Get Your API Key

  1. Log in to the Togacha Dashboard
  2. Create an organization or select an existing one
  3. Create a new app within the organization (or select an existing app)
  4. Copy the public API key from the app homepage
Your API key looks like: tgc_public_1234567890abcdef

2. Make Your First API Call

Using cURL

# Register a new player
curl -X POST https://togacha.com/players/register \
  -H "Content-Type: application/json" \
  -H "apikey: tgc_public_your_api_key" \
  -d '{
    "email": "[email protected]",
    "password": "password123",
    "password_confirmation": "password123"
  }'
You’ll receive a JWT token in the response:
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}

Using Unity SDK

using Togacha;

var client = new TogachaClient("https://togacha.com", "tgc_public_your_api_key");

var response = await client.RegisterPlayerAsync(
    "[email protected]",
    "password123",
    "password123"
);

client.SetAuthToken(response.Token);

3. Get Player Currencies

Once authenticated, you can retrieve currencies and balances:
curl -X GET https://togacha.com/currencies \
  -H "apikey: tgc_public_your_api_key" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Next Steps