File size: 1,618 Bytes
c024705
 
 
 
 
eeacc46
c024705
 
 
 
 
 
 
 
 
 
 
 
 
 
eeacc46
c024705
 
 
 
 
 
 
 
 
 
 
 
 
eeacc46
c024705
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import requests
import json

# Test the professional sessions endpoint
try:
    response = requests.get('https://prodevroger-ishingiro.hf.space/professional/sessions')
    print('=== PROFESSIONAL SESSIONS ===')
    print(f'Status: {response.status_code}')
    if response.status_code == 200:
        data = response.json()
        print(f'Number of sessions: {len(data)}')
        for session in data:
            print(f'User: {session.get("userAccount", "N/A")}, Status: {session.get("bookingStatus", "N/A")}, Risk: {session.get("riskLevel", "N/A")}')
    else:
        print(f'Error: {response.text}')
except Exception as e:
    print(f'Error connecting to API: {e}')

print('\n=== PROFESSIONAL USERS ===')
try:
    response = requests.get('https://prodevroger-ishingiro.hf.space/professional/users')
    print(f'Status: {response.status_code}')
    if response.status_code == 200:
        data = response.json()
        print(f'Number of users: {len(data)}')
        for user in data:
            print(f'User: {user.get("username", "N/A")}, Sessions: {user.get("totalSessions", 0)}')
    else:
        print(f'Error: {response.text}')
except Exception as e:
    print(f'Error connecting to API: {e}')

print('\n=== DASHBOARD STATS ===')
try:
    response = requests.get('https://prodevroger-ishingiro.hf.space/professional/dashboard-stats')
    print(f'Status: {response.status_code}')
    if response.status_code == 200:
        data = response.json()
        print(f'Dashboard Stats: {data}')
    else:
        print(f'Error: {response.text}')
except Exception as e:
    print(f'Error connecting to API: {e}')