@@ -7,7 +7,7 @@ class TogglClientApi(object):
7
7
"username" : "" ,
8
8
"workspace_name" : "" ,
9
9
"base_url" : "https://api.track.toggl.com/api" ,
10
- "ver_api" : 8 ,
10
+ "ver_api" : 9 ,
11
11
"base_url_report" : "https://api.track.toggl.com/reports/api" ,
12
12
"ver_report" : 2 ,
13
13
}
@@ -56,11 +56,11 @@ def get_workspace_by_name(self, name):
56
56
def get_workspaces (self ):
57
57
return self .query ("/workspaces" )
58
58
59
- def get_projects (self ):
60
- return self .query ("/workspaces/%i/projects" % self .workspace_id )
59
+ def get_projects (self , active = True ):
60
+ return self .query ("/workspaces/%i/projects" % self .workspace_id , params = { "active" : active } )
61
61
62
62
def get_workspace_members (self , workspace_id ):
63
- response = self .query ("/workspaces/" + str (workspace_id ) + "/workspace_users " )
63
+ response = self .query ("/workspaces/" + str (workspace_id ) + "/users " )
64
64
return response
65
65
66
66
"""
@@ -120,7 +120,7 @@ def get_project_times(self, project_id, start_date, end_date, extra_params={}):
120
120
return json_response
121
121
122
122
def get_dashboard_data (self , params = {}):
123
- dashboard_response = self .query ("/dashboard /%i" % self .workspace_id , params )
123
+ dashboard_response = self .query ("/workspaces /%i/dashboard/all_activity " % self .workspace_id , params )
124
124
125
125
if dashboard_response .status_code != requests .codes .ok :
126
126
dashboard_response .raise_for_status ()
@@ -144,7 +144,7 @@ def create_time_entry(self, json_data):
144
144
}
145
145
}
146
146
"""
147
- response = self .query ("/time_entries" , method = "POST" , json_data = json_data )
147
+ response = self .query ("/workspaces/%i/ time_entries" % self . workspace_id , method = "POST" , json_data = json_data )
148
148
149
149
if response .status_code != requests .codes .ok :
150
150
response .raise_for_status ()
0 commit comments