Repository: matthewdowney/TogglPy (language: python)

Issue:
Update API Url Domain to api.track.toggl.com
toggl.com or www.toggl.com will no longer be a supported entry point for the Toggl Track API check:
- https://github.com/toggl/toggl_api_docs
- https://toggl.com/blog/api-documentation-change



Discussion / hints:
Deadline is End of June 2021 (see API docs link above).

Fix patch:
diff --git a/README.md b/README.md
index 0fb4034..8071d40 100644
--- a/README.md
+++ b/README.md
@@ -46,7 +46,7 @@ from toggl.TogglPy import Toggl
 toggl = Toggl()
 toggl.setAPIKey("mytogglapikey")
 
-response = toggl.request("https://www.toggl.com/api/v8/clients")
+response = toggl.request("https://api.track.toggl.com/api/v8/clients")
 
 # print the client name and id for each client in the response
 # list of returned values can be found in the Toggl docs:
@@ -61,7 +61,7 @@ data = {
     'some_key': 'some_value',
     'user_agent': 'TogglPy_test',
 }   
-response = toggl.request("https://www.toggl.com/api/v8/some/endpoint", parameters=data)
+response = toggl.request("https://api.track.toggl.com/api/v8/some/endpoint", parameters=data)
 ```
 
 ### Making a POST request to any Toggl endpoint:
@@ -78,7 +78,7 @@ data = {
         }
     }
 
-response = toggl.postRequest("https://www.toggl.com/api/v8/projects", parameters=data)
+response = toggl.postRequest("https://api.track.toggl.com/api/v8/projects", parameters=data)
 
 ```
 
diff --git a/toggl/TogglPy.py b/toggl/TogglPy.py
index 2a0eacd..9cb7247 100644
--- a/toggl/TogglPy.py
+++ b/toggl/TogglPy.py
@@ -29,20 +29,20 @@
 # 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"
 
 
 # ------------------------------------------------------


Test patch:
diff --git a/toggl/tests.py b/toggl/tests.py
index 8eb4938..fda8cdb 100644
--- a/toggl/tests.py
+++ b/toggl/tests.py
@@ -35,7 +35,7 @@ def setUp(self):
         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")
         self.assertTrue(response is not None)
 
     def test_putTimeEntry(self):