import urllib.request, json

AUTH = "Basic OTMzMjkzNjcyNDp0SDh0VjBLMzhwc2tzZFl5eXpmUkhpR2NwR1owRGRCNw=="

# Test POST to /public/schedule
req = urllib.request.Request("https://api.repliz.com/public/schedule",
    data=json.dumps({"test": True}).encode(),
    headers={"Authorization": AUTH, "Content-Type": "application/json"},
    method="POST")
try:
    with urllib.request.urlopen(req, timeout=15) as r:
        print("POST /public/schedule:", r.status, r.read().decode()[:500])
except Exception as e:
    print(f"POST /public/schedule FAILED: {e}")

# Test GET /public/schedule
req2 = urllib.request.Request("https://api.repliz.com/public/schedule?page=1&limit=5",
    headers={"Authorization": AUTH})
try:
    with urllib.request.urlopen(req2, timeout=15) as r:
        data = json.loads(r.read())
        print("\n=== Existing Schedules ===")
        print(json.dumps(data, indent=2)[:2000])
except Exception as e:
    print(f"GET /public/schedule FAILED: {e}")
