Fix: Use correct endpoint POST /api/v1/task (singular) for task creation
This commit is contained in:
@@ -19,19 +19,19 @@ if [ -z "$API_KEY" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Add to inbox (no project)
|
# Create task via POST /api/v1/task (singular endpoint)
|
||||||
response=$(curl -s -X POST \
|
response=$(curl -s -X POST \
|
||||||
-H "Authorization: Bearer $API_KEY" \
|
-H "Authorization: Bearer $API_KEY" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{\"name\":\"$task_name\"}" \
|
-d "{\"name\":\"$task_name\"}" \
|
||||||
"$API_URL/tasks")
|
"$API_URL/task")
|
||||||
|
|
||||||
task_id=$(echo "$response" | jq -r '.id // empty')
|
task_uid=$(echo "$response" | jq -r '.uid // empty')
|
||||||
|
|
||||||
if [ -n "$task_id" ]; then
|
if [ -n "$task_uid" ]; then
|
||||||
echo "✅ Added to Tududi inbox: $task_name"
|
echo "✅ Added to Tududi: $task_name (uid: $task_uid)"
|
||||||
else
|
else
|
||||||
echo "⚠️ Failed to add task"
|
echo "⚠️ Failed to add task"
|
||||||
echo "$response" | jq .
|
echo "Response: $response"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user