From b90ae26781358d4d8191412b0f388e718781b52f Mon Sep 17 00:00:00 2001 From: Tobias Manske Date: Sat, 3 Jul 2021 22:43:38 +0200 Subject: [PATCH] Change API endpoint --- toggl/TogglPy.py | 16 ++++++++-------- toggl/tests.py | 3 ++- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/toggl/TogglPy.py b/toggl/TogglPy.py index f203ca9..5b9844c 100644 --- a/toggl/TogglPy.py +++ b/toggl/TogglPy.py @@ -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" # ------------------------------------------------------ diff --git a/toggl/tests.py b/toggl/tests.py index e93e864..0e122d8 100644 --- a/toggl/tests.py +++ b/toggl/tests.py @@ -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):