Change API endpoint

This commit is contained in:
Tobias Manske 2021-07-03 22:43:38 +02:00
parent 5c6a76c96f
commit b90ae26781
Signed by: tobias
GPG Key ID: D5914DC71F2F9352
2 changed files with 10 additions and 9 deletions

View File

@ -31,20 +31,20 @@ else:
# Class containing the endpoint URLs for Toggl
# --------------------------------------------
class Endpoints:
WORKSPACES = "https://www.toggl.com/api/v8/workspaces"
CLIENTS = "https://www.toggl.com/api/v8/clients"
PROJECTS = "https://www.toggl.com/api/v8/projects"
TASKS = "https://www.toggl.com/api/v8/tasks"
WORKSPACES = "https://api.track.toggl.com/api/v8/workspaces"
CLIENTS = "https://api.track.toggl.com/api/v8/clients"
PROJECTS = "https://api.track.toggl.com/api/v8/projects"
TASKS = "https://api.track.toggl.com/api/v8/tasks"
REPORT_WEEKLY = "https://toggl.com/reports/api/v2/weekly"
REPORT_DETAILED = "https://toggl.com/reports/api/v2/details"
REPORT_SUMMARY = "https://toggl.com/reports/api/v2/summary"
START_TIME = "https://www.toggl.com/api/v8/time_entries/start"
TIME_ENTRIES = "https://www.toggl.com/api/v8/time_entries"
CURRENT_RUNNING_TIME = "https://www.toggl.com/api/v8/time_entries/current"
START_TIME = "https://api.track.toggl.com/api/v8/time_entries/start"
TIME_ENTRIES = "https://api.track.toggl.com/api/v8/time_entries"
CURRENT_RUNNING_TIME = "https://api.track.toggl.com/api/v8/time_entries/current"
@staticmethod
def STOP_TIME(pid):
return "https://www.toggl.com/api/v8/time_entries/" + str(pid) + "/stop"
return "https://api.track.toggl.com/api/v8/time_entries/" + str(pid) + "/stop"
# ------------------------------------------------------

View File

@ -34,7 +34,8 @@ class TogglPyTests(unittest.TestCase):
self.toggl.setAPIKey(self.api_key)
def test_connect(self):
response = self.toggl.request("https://www.toggl.com/api/v8/clients")
response = self.toggl.request("https://api.track.toggl.com/api/v8/clients")
pi.track.toggl.com/
self.assertTrue(response is not None)
def test_putTimeEntry(self):