import requests import json import sys # Configuration BASE_URL = "https://dev-api.oneskyit.com/v3/crud" # Using the API key found in the database API_KEY = "PHDXUJxx6IgmLNKxIBezTQ" # Event Device ID found in the database DEVICE_ID = "GZvFjgIIZQg" def get_headers(): headers = { "Content-Type": "application/json", "X-Aether-API-Key": API_KEY, "X-No-Account-ID": "bypass" } return headers def test_get_event_device(): print(f"--- Testing: Get Event Device by ID ({DEVICE_ID}) ---") url = f"{BASE_URL}/event_device/{DEVICE_ID}" headers = get_headers() try: response = requests.get(url, headers=headers) print(f"URL: {response.url}") print(f"Status Code: {response.status_code}") if response.status_code == 200: data = response.json().get('data', {}) print("✅ SUCCESS: Found Event Device.") # Verify Vision ID pattern (Strings only for ID fields) vision_fields = ["id", "event_device_id", "account_id", "event_id", "event_location_id"] for field in vision_fields: val = data.get(field) print(f" Field '{field}': {val} (type: {type(val).__name__})") if val is not None: assert isinstance(val, str), f"Error: Field '{field}' should be a string, but got {type(val).__name__}" # Check for any unexpected integer IDs for key, val in data.items(): if key.endswith("_id") and not key.endswith("external_id"): if isinstance(val, int): print(f" ❌ FAILURE: Integer leakage detected in field '{key}': {val}") # assert False, f"Integer leakage in '{key}'" else: print(f"❌ FAILURE: {response.text}") except Exception as e: print(f"Error during test: {e}") print("-" * 40 + "\n") if __name__ == "__main__": print(f"Starting Aether V3 Event Device E2E Tests against {BASE_URL}\n") test_get_event_device() print("Tests Complete.")