Fix: Use /api/v1/inbox endpoint (POST content field) instead of /task
This commit is contained in:
@@ -22,7 +22,7 @@ if [ "$dry_run" == "true" ]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Add to Tududi
|
# Add to Tududi inbox
|
||||||
API_URL="${TUDUDI_API_URL:-https://todo.dilain.com/api/v1}"
|
API_URL="${TUDUDI_API_URL:-https://todo.dilain.com/api/v1}"
|
||||||
API_KEY="${TUDUDI_API_KEY:-}"
|
API_KEY="${TUDUDI_API_KEY:-}"
|
||||||
|
|
||||||
@@ -34,15 +34,15 @@ fi
|
|||||||
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 "{\"content\":\"$task_name\"}" \
|
||||||
"$API_URL/task")
|
"$API_URL/inbox")
|
||||||
|
|
||||||
task_uid=$(echo "$response" | jq -r '.uid // empty' 2>/dev/null) || task_uid=""
|
task_uid=$(echo "$response" | jq -r '.uid // empty' 2>/dev/null) || task_uid=""
|
||||||
|
|
||||||
if [ -n "$task_uid" ]; then
|
if [ -n "$task_uid" ]; then
|
||||||
echo "✅ Added to Tududi: $task_name"
|
echo "✅ Added to Tududi inbox: $task_name"
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
echo "⚠️ Failed to add task: $task_name"
|
echo "⚠️ Failed to add to inbox: $task_name"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -19,12 +19,12 @@ if [ -z "$API_KEY" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
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 \
|
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 "{\"content\":\"$task_name\"}" \
|
||||||
"$API_URL/task")
|
"$API_URL/inbox")
|
||||||
|
|
||||||
task_uid=$(echo "$response" | jq -r '.uid // empty')
|
task_uid=$(echo "$response" | jq -r '.uid // empty')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user