import requests

awin_token = 'bebd7839-013a-434d-a3da-7db2ecefb6b1'
headers = {'Authorization': f'Bearer {awin_token}'}

# Try different Awin API endpoints
endpoints = [
    ('Accounts', 'https://api.awin.com/accounts'),
    ('Publisher account', 'https://api.awin.com/publishers/me'),
    ('Publisher programmes', f'https://api.awin.com/publishers/me/programmes'),
    ('Datafeed list', f'https://productdata.awin.com/datafeed/list/apikey/{awin_token}'),
]

for name, url in endpoints:
    try:
        r = requests.get(url, headers=headers, timeout=15)
        print(f'{name}: {r.status_code}')
        if r.ok:
            text = r.text[:500]
            print(f'  {text}')
        else:
            print(f'  {r.text[:200]}')
    except Exception as e:
        print(f'{name}: ERROR - {e}')
    print()
