Mr-Help commited on
Commit
f9a9fe0
·
verified ·
1 Parent(s): 3a6e872

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +6 -4
main.py CHANGED
@@ -6,7 +6,8 @@ app = FastAPI()
6
  # Constants
7
  ACCESS_TOKEN = "2585415_877e3999ec927cff5d896269c348106949c50f9b8ad54fdaeac07ad00687ce3e"
8
  FOLDER_ID = "90182650380"
9
- TEMPLATE_ID = "t-901804880155" # No "t-" prefix for API call
 
10
 
11
  @app.post("/")
12
  async def create_list_from_template(request: Request):
@@ -36,10 +37,11 @@ async def create_list_from_template(request: Request):
36
 
37
  if response.status_code == 200:
38
  result = response.json()
39
- print(result)
 
40
  return {
41
  "message": "✅ Video contractor list created successfully.",
42
- "list_id": result.get("id")
43
  }
44
  else:
45
  return {
@@ -50,4 +52,4 @@ async def create_list_from_template(request: Request):
50
  else:
51
  return {
52
  "message": f"Contractor type '{contractor_type}' is not handled. No action taken."
53
- }
 
6
  # Constants
7
  ACCESS_TOKEN = "2585415_877e3999ec927cff5d896269c348106949c50f9b8ad54fdaeac07ad00687ce3e"
8
  FOLDER_ID = "90182650380"
9
+ TEMPLATE_ID = "901804880155" # Remove the "t-" prefix for the API call
10
+ TEAM_ID = "90182086710" # Also known as Workspace or Space ID
11
 
12
  @app.post("/")
13
  async def create_list_from_template(request: Request):
 
37
 
38
  if response.status_code == 200:
39
  result = response.json()
40
+ list_id = result.get("id")
41
+ list_url = f"https://app.clickup.com/{TEAM_ID}/v/l/li/{list_id}"
42
  return {
43
  "message": "✅ Video contractor list created successfully.",
44
+ "list_url": list_url
45
  }
46
  else:
47
  return {
 
52
  else:
53
  return {
54
  "message": f"Contractor type '{contractor_type}' is not handled. No action taken."
55
+ }