lunduke-cli/examples/check-key.py

18 lines
327 B
Python
Raw Normal View History

2025-04-11 21:46:02 +00:00
import requests
from config.configuration import Config
2025-04-11 21:46:02 +00:00
cfg = Config()
2025-04-11 21:46:02 +00:00
username = cfg.username
url = cfg.get_api_url(endpoint='/site.json')
api_key = cfg.api_key
2025-04-11 21:46:02 +00:00
headers={
"api_key": api_key,
"api_username": username
}
response = requests.get(url,headers=headers)
print(response.status_code)
print(response.json())