Mr-Help commited on
Commit
9153366
·
verified ·
1 Parent(s): 0f92424

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -0
app.py CHANGED
@@ -109,6 +109,20 @@ def get_task_name(task_id):
109
  task_name = "Task name wasn't not found"
110
  return task_name
111
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
  @app.post("/updates")
113
  async def task_update(request: Request):
114
  data = await request.json()
 
109
  task_name = "Task name wasn't not found"
110
  return task_name
111
 
112
+ def get_task_details(task_id):
113
+ url = f"https://api.clickup.com/api/v2/task/{task_id}"
114
+ headers = {"Authorization": ACCESS_TOKEN}
115
+
116
+ response = requests.get(url, headers=headers)
117
+
118
+ if response.status_code == 200:
119
+ task_data = response.json()
120
+ else:
121
+ print(f"Error: {response.status_code}, {response.text}")
122
+ task_data = invalid data
123
+
124
+ return task_data
125
+
126
  @app.post("/updates")
127
  async def task_update(request: Request):
128
  data = await request.json()