Skip to main content

Games API Quickstart

Get started with the Send v5 Games API in minutes.

Prerequisites

  • Nile tenant ID
  • API access credentials
  • Basic understanding of REST APIs

Installation

Using cURL

# Test API connection
curl -X GET "https://api.your-domain/games/wheel/profiles" \
  -H "x-tenant-id: your-tenant-uuid"

Using Python

pip install requests
import requests

BASE_URL = "https://api.your-domain/games/wheel"
HEADERS = {"x-tenant-id": "your-tenant-uuid"}

response = requests.get(f"{BASE_URL}/profiles", headers=HEADERS)
print(response.json())

Using JavaScript

npm install axios
const axios = require('axios');

const baseURL = 'https://api.your-domain/games/wheel';
const headers = { 'x-tenant-id': 'your-tenant-uuid' };

axios.get(`${baseURL}/profiles`, { headers })
  .then(response => console.log(response.data));

Quick Example: Create a Wheel Game

Step 1: Create Prizes

curl -X POST "https://api.your-domain/games/wheel/prizes" \
  -H "x-tenant-id: your-tenant-uuid" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Grand Prize",
    "image": "https://example.com/grand-prize.png"
  }'

Step 2: Create a Config

curl -X POST "https://api.your-domain/games/wheel/configs" \
  -H "x-tenant-id": "your-tenant-uuid" \
  -H "Content-Type: application/json" \
  -d '{
    "prizes": [
      {"id": "prize-uuid-1", "probability": 0.1},
      {"id": "prize-uuid-2", "probability": 0.9}
    ],
    "volume": {"master": 80, "effects": 70}
  }'

Step 3: Create a Profile

curl -X POST "https://api.your-domain/games/wheel/profiles" \
  -H "x-tenant-id: your-tenant-uuid" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Summer Promotion",
    "version": "1.0",
    "config": "config-hash-from-step-2"
  }'
curl -X POST "https://api.your-domain/games/wheel/instances" \
  -H "x-tenant-id: your-tenant-uuid" \
  -H "Content-Type: application/json" \
  -d '{
    "profileId": "profile-uuid-from-step-3",
    "domain": "your-domain.com",
    "slug": "summer-promo"
  }'
Your wheel game is now live at: https://your-domain.com/summer-promo

Next Steps

  • Explore the API Playground to test endpoints interactively
  • Learn about Clean Architecture principles
  • Check out individual endpoint documentation in the sidebar

Common Patterns

Pagination

All list endpoints support pagination:
curl "https://api.your-domain/games/wheel/profiles?page=2&limit=50" \
  -H "x-tenant-id: your-tenant-uuid"

Filtering

Filter instances by status:
curl "https://api.your-domain/games/wheel/instances?status=active" \
  -H "x-tenant-id: your-tenant-uuid"

Config Deduplication

Configs are automatically deduplicated by content hash. If you POST the same config twice, you’ll get the same config ID back.

Support