import requests, os

token = os.environ.get("ADMIN_TOKEN", "")
if not token:
    token = input("ADMIN_TOKEN: ").strip()

resp = requests.get("http://localhost:28175/v1/admin/departments-all",
    headers={"Authorization": f"Bearer {token}"})
for d in resp.json().get("data", []):
    print(f'{d["id"]:>3d} | {d["name"]}')
