test_official_api.pyโข3.68 kB
"""
Test the updated Skulabs API client with official endpoints
"""
import asyncio
import os
from skulabs_client_working import SkulabsClient
SKULABS_API_KEY = "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IlJTQV9BUEkiLCJqa3UiOiJodHRwczovL2FwcC5za3VsYWJzLmNvbS9zL2FwaS9vYXV0aC9qd2tzIn0.eyJpc3MiOiJodHRwczovL2FwcC5za3VsYWJzLmNvbS9zL2FwaS9vYXV0aCIsInN1YiI6IjY4ZTMxOWQ2NDAzNmI5YTYyZmIzMzM1OCIsImFjY291bnRfaWQiOiI2NmE3ZWMwYmUyNWIwNWQwNzZjZDdkMWIiLCJzZWVkIjoiZnM3dWZKZ0pPb0x0OW84VlN6cFZiUSIsImF1ZCI6Imh0dHBzOi8vYXBwLnNrdWxhYnMuY29tL3MvYXBpL29hdXRoIiwic2NvcGVzIjpbInByb2ZpbGUiLCJlbWFpbCIsInBob25lIiwicGxhdGZvcm1PcGVuIiwicGxhdGZvcm1HZW5lcmljIiwicGxhdGZvcm1BcGkiLCJ1c2VyU3RhbmRhcmQiLCJ1c2VyTWFuYWdlciIsInVzZXJBZG1pbiIsImV2ZXJ5b25lIl0sImF1dGhfdGltZSI6MTc1OTcxMzc2NywiaWF0IjoxNzU5NzEzNzY3LCJqdGkiOiI2OGUzMTllNzRmZjE0ZGViNzBjOGI4MGIifQ.frhGzI2KFEl_rFfHT1wZ6KBNFkRV63v5uzC_CHnDd6YHan9J4cYtnOlHpND5SF5k-URxtEVw3cgG9wJzMBEUFvBHVbofJhyLXsn1lVbXd1tvxAFFXLFvHC0QFa8JKyjSBjdBEHSeRPg01w73F2qt9kgMxKTU_KEJuF0XkpYxW0Y_sQj2FXkUufzvYVEx787pFeLu6NJSvUQaNL9tWTXfS7qOQ0X8LCkPetKobZdcNZea0HeTxsLXrWiBQAShhZ3HJkIbkBOpWw8chIHTxynuj8pxWpLnRtzN-sXexPxvlnvLxIXTI99T7Of5rabYcuayCttTCJlGRRzWw5ZmTR61hw"
async def test_official_endpoints():
"""Test the official Skulabs API endpoints"""
print("๐งช Testing Official Skulabs API Endpoints")
print("=" * 60)
print("๐ Based on official documentation: https://skulabs.mintlify.app/")
print("=" * 60)
try:
async with SkulabsClient(SKULABS_API_KEY, "https://api.skulabs.com") as client:
# Test account info (still using the working endpoint)
print("1. Testing account info (confirmed working):")
account_info = await client.get_account_info()
print(f" โ
Account Info: {account_info}")
# Test official API endpoints
print("\n2. Testing inventory (official endpoint):")
inventory = await client.get_inventory()
print(f" ๐ฆ Inventory: {inventory}")
print("\n3. Testing products/items (official endpoint):")
products = await client.get_products()
print(f" ๐ Products: {products}")
print("\n4. Testing orders (official endpoint):")
orders = await client.get_orders()
print(f" ๐ Orders: {orders}")
print("\n5. Testing customers (official endpoint):")
customers = await client.get_customers()
print(f" ๐ฅ Customers: {customers}")
print("\n6. Testing specific product lookup:")
product = await client.get_product("DEMO-001")
print(f" ๐ Product: {product}")
print("\n7. Testing inventory update:")
update = await client.update_inventory("DEMO-001", 15, "Main")
print(f" ๐ Update: {update}")
print("\nโ
All tests completed!")
print("\n๐ Results Summary:")
print("- Account info: โ
REAL API data")
print("- Other endpoints: ๐ Testing official API endpoints")
print("- Fallback: Mock data if API endpoints fail")
print("\n๐ Next Steps:")
print("1. If endpoints return real data: โ
Ready for production!")
print("2. If endpoints return mock data: Check API key permissions")
print("3. Contact Skulabs support if needed: api-support@skulabs.com")
except Exception as e:
print(f"โ Error: {e}")
if __name__ == "__main__":
asyncio.run(test_official_endpoints())