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
|
||||
fi
|
||||
|
||||
# Add to inbox (no project)
|
||||
# Create task via POST /api/v1/task (singular endpoint)
|
||||
response=$(curl -s -X POST \
|
||||
-H "Authorization: Bearer $API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-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
|
||||
echo "✅ Added to Tududi inbox: $task_name"
|
||||
if [ -n "$task_uid" ]; then
|
||||
echo "✅ Added to Tududi: $task_name (uid: $task_uid)"
|
||||
else
|
||||
echo "⚠️ Failed to add task"
|
||||
echo "$response" | jq .
|
||||
echo "Response: $response"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user