Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -6,7 +6,8 @@ app = FastAPI()
|
|
| 6 |
# Constants
|
| 7 |
ACCESS_TOKEN = "2585415_877e3999ec927cff5d896269c348106949c50f9b8ad54fdaeac07ad00687ce3e"
|
| 8 |
FOLDER_ID = "90182650380"
|
| 9 |
-
TEMPLATE_ID = "
|
|
|
|
| 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 |
-
|
|
|
|
| 40 |
return {
|
| 41 |
"message": "✅ Video contractor list created successfully.",
|
| 42 |
-
"
|
| 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 |
+
}
|