Fix: Use /api/v1/inbox endpoint (POST content field) instead of /task

This commit is contained in:
Remora
2026-02-09 15:57:59 +01:00
parent 942a83244a
commit 2c1f7a1d6c
2 changed files with 8 additions and 8 deletions

View File

@@ -22,7 +22,7 @@ if [ "$dry_run" == "true" ]; then
exit 0
fi
# Add to Tududi
# Add to Tududi inbox
API_URL="${TUDUDI_API_URL:-https://todo.dilain.com/api/v1}"
API_KEY="${TUDUDI_API_KEY:-}"
@@ -34,15 +34,15 @@ fi
response=$(curl -s -X POST \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d "{\"name\":\"$task_name\"}" \
"$API_URL/task")
-d "{\"content\":\"$task_name\"}" \
"$API_URL/inbox")
task_uid=$(echo "$response" | jq -r '.uid // empty' 2>/dev/null) || task_uid=""
if [ -n "$task_uid" ]; then
echo "✅ Added to Tududi: $task_name"
echo "✅ Added to Tududi inbox: $task_name"
exit 0
else
echo "⚠️ Failed to add task: $task_name"
echo "⚠️ Failed to add to inbox: $task_name"
exit 1
fi

View File

@@ -19,12 +19,12 @@ if [ -z "$API_KEY" ]; then
exit 1
fi
# Create task via POST /api/v1/task (singular endpoint)
# Add to inbox via POST /api/v1/inbox (preferred for quick capture)
response=$(curl -s -X POST \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d "{\"name\":\"$task_name\"}" \
"$API_URL/task")
-d "{\"content\":\"$task_name\"}" \
"$API_URL/inbox")
task_uid=$(echo "$response" | jq -r '.uid // empty')