#!/bin/bash
# Quick test script for ADMS API endpoints
# Usage: bash test_api.sh https://your-adms.cloud.com

CLOUD_URL="${1:-https://adms.elmntointernet.com}"

echo "Testing ADMS Sync API endpoints..."
echo "Cloud URL: $CLOUD_URL"
echo ""

# Test health endpoint
echo "1️⃣  Testing /api/sync/health"
curl -s "$CLOUD_URL/api/sync/health" | python3 -m json.tool
echo ""

# Test users endpoint
echo "2️⃣  Testing /api/sync/users"
curl -s "$CLOUD_URL/api/sync/users" | python3 -m json.tool | head -20
echo ""

# Test devices endpoint
echo "3️⃣  Testing /api/sync/devices"
curl -s "$CLOUD_URL/api/sync/devices" | python3 -m json.tool
echo ""

# Test status endpoint
echo "4️⃣  Testing /api/sync/status"
curl -s "$CLOUD_URL/api/sync/status" | python3 -m json.tool
echo ""

echo "✅ API test complete!"
