import requests import json # --- Configuration --- BASE_URL = "https://dev-api.oneskyit.com/v3/crud" # Standard Agent API Key API_KEY = "PMM4n50teUCaOMMTN8qOJA" # Test Targets: (Object Type, Valid ID Random) TARGETS = [ ("event_device", "GZvFjgIIZQg"), ("event_session", "F0PZd1bNcuD") ] def get_headers(): return { "Content-Type": "application/json", "X-Aether-API-Key": API_KEY, "x-no-account-id": "bypass" } def verify_vision_parity(obj_type, record_id): """ Verifies that the object returns ONLY string IDs for all ID fields (Vision Standard). """ print(f"--- Testing {obj_type}: {record_id} ---") url = f"{BASE_URL}/{obj_type}/{record_id}" try: response = requests.get(url, headers=get_headers()) print(f" Status: {response.status_code}") if response.status_code == 200: data = response.json().get('data', {}) failures = [] # Check all fields ending in _id (except external_id) for key, val in data.items(): if key == "id" or (key.endswith("_id") and not key.endswith("external_id")): if val is not None and not isinstance(val, str): failures.append(f"{key} is {type(val).__name__} ({val})") if not failures: print(f" āœ… Success: All ID fields are strings.") return True else: print(f" āŒ Failure: Integer leakage detected:") for f in failures: print(f" - {f}") return False else: print(f" āŒ Error: {response.text[:200]}") return False except Exception as e: print(f" šŸ’„ Exception: {e}") return False if __name__ == "__main__": print(f"Starting Aether V3 Event Vision Parity Tests\n") results = [] for obj_type, record_id in TARGETS: results.append(verify_vision_parity(obj_type, record_id)) print("-" * 40) if all(results): print("\nšŸŽ‰ ALL VISION PARITY TESTS PASSED!") else: print("\nāŒ SOME TESTS FAILED.")