1
0

check_projects.py 510 B

123456789101112131415
  1. import requests
  2. import urllib3
  3. urllib3.disable_warnings()
  4. auth = requests.post(
  5. 'https://192.168.130.161/taiga/api/v1/auth',
  6. json={'type': 'normal', 'username': 'FrancoisLange', 'password': 'BTSai123'},
  7. verify=False
  8. ).json()
  9. headers = {'Authorization': f'Bearer {auth["auth_token"]}'}
  10. projs = requests.get('https://192.168.130.161/taiga/api/v1/projects', headers=headers, verify=False).json()
  11. print("Projects:")
  12. for p in projs:
  13. print(f"ID: {p['id']}, Name: {p['name']}, Slug: {p['slug']}")