microsoft-todo
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDrive Microsoft To Do via Microsoft Graph with . The user's OAuth
bearer token is in ; every call needs
. Base URL:
.
curl + jq$MICROSOFT_TODO_TOKENAuthorization: Bearer $MICROSOFT_TODO_TOKENhttps://graph.microsoft.com/v1.0Failures are — show verbatim.
means the token expired (re-install). / on a write means
the user only granted → ask them to re-connect with read+write.
{"error":{"code","message"}}message401403ErrorAccessDeniedTasks.Readbash
G="https://graph.microsoft.com/v1.0"; AUTH="Authorization: Bearer $MICROSOFT_TODO_TOKEN"通过借助Microsoft Graph驱动Microsoft To Do。用户的OAuth承载令牌存储在中;每次调用都需要。基础URL:
.
curl + jq$MICROSOFT_TODO_TOKENAuthorization: Bearer $MICROSOFT_TODO_TOKENhttps://graph.microsoft.com/v1.0失败响应格式为——直接显示内容。表示令牌已过期(重新安装)。写入操作时出现/意味着用户仅授予了权限→请用户重新连接并授予读写权限。
{"error":{"code","message"}}message401403ErrorAccessDeniedTasks.Readbash
G="https://graph.microsoft.com/v1.0"; AUTH="Authorization: Bearer $MICROSOFT_TODO_TOKEN"Task lists
任务列表
curl -sS -H "$AUTH" "$G/me/todo/lists" | jq '.value[] | {id, displayName, wellknownListName}'
undefinedcurl -sS -H "$AUTH" "$G/me/todo/lists" | jq '.value[] | {id, displayName, wellknownListName}'
undefinedTasks
任务
bash
LIST="LIST_ID"bash
LIST="LIST_ID"Open tasks in a list (filter notStarted/inProgress; $top caps page size)
列表中的未完成任务(筛选notStarted/inProgress状态;$top限制每页数量)
curl -sS -H "$AUTH"
"$G/me/todo/lists/$LIST/tasks?$filter=status ne 'completed'&$top=50"
| jq '.value[] | {id, title, status, due: .dueDateTime.dateTime}'
"$G/me/todo/lists/$LIST/tasks?$filter=status ne 'completed'&$top=50"
| jq '.value[] | {id, title, status, due: .dueDateTime.dateTime}'
curl -sS -H "$AUTH"
"$G/me/todo/lists/$LIST/tasks?$filter=status ne 'completed'&$top=50"
| jq '.value[] | {id, title, status, due: .dueDateTime.dateTime}'
"$G/me/todo/lists/$LIST/tasks?$filter=status ne 'completed'&$top=50"
| jq '.value[] | {id, title, status, due: .dueDateTime.dateTime}'
Create (confirm first). dueDateTime/reminderDateTime are optional.
创建任务(需先确认)。dueDateTime/reminderDateTime为可选参数。
curl -sS -X POST -H "$AUTH" -H "Content-Type: application/json"
-d '{"title":"Follow up with Alex","dueDateTime":{"dateTime":"2026-06-30T17:00:00","timeZone":"UTC"}}'
"$G/me/todo/lists/$LIST/tasks" | jq '{id, title, status}'
-d '{"title":"Follow up with Alex","dueDateTime":{"dateTime":"2026-06-30T17:00:00","timeZone":"UTC"}}'
"$G/me/todo/lists/$LIST/tasks" | jq '{id, title, status}'
curl -sS -X POST -H "$AUTH" -H "Content-Type: application/json"
-d '{"title":"Follow up with Alex","dueDateTime":{"dateTime":"2026-06-30T17:00:00","timeZone":"UTC"}}'
"$G/me/todo/lists/$LIST/tasks" | jq '{id, title, status}'
-d '{"title":"Follow up with Alex","dueDateTime":{"dateTime":"2026-06-30T17:00:00","timeZone":"UTC"}}'
"$G/me/todo/lists/$LIST/tasks" | jq '{id, title, status}'
Complete: PATCH the task with {"status":"completed"}
完成任务:通过PATCH请求将任务状态设置为{"status":"completed"}
curl -sS -X PATCH -H "$AUTH" -H "Content-Type: application/json"
-d '{"status":"completed"}' "$G/me/todo/lists/$LIST/tasks/TASK_ID" | jq '{title, status}'
-d '{"status":"completed"}' "$G/me/todo/lists/$LIST/tasks/TASK_ID" | jq '{title, status}'
undefinedcurl -sS -X PATCH -H "$AUTH" -H "Content-Type: application/json"
-d '{"status":"completed"}' "$G/me/todo/lists/$LIST/tasks/TASK_ID" | jq '{title, status}'
-d '{"status":"completed"}' "$G/me/todo/lists/$LIST/tasks/TASK_ID" | jq '{title, status}'
undefinedGotchas
注意事项
- OData params (,
$filter,$top) need the$selectescaped in the shell ($) and URL-encoded spaces — quote the whole URL.\$filter - is the user's default "Tasks" list — a good fallback when they don't name a list.
wellknownListName: "defaultList" - Pagination via ; follow it for "all tasks".
@odata.nextLink
- OData参数(、
$filter、$top)在shell中需要对$select进行转义($),并且空格需要进行URL编码——请将整个URL用引号包裹。\$filter - 是用户的默认“Tasks”列表——当用户未指定列表时,这是一个不错的备选。
wellknownListName: "defaultList" - 通过进行分页;如需获取“所有任务”,请跟随该链接。
@odata.nextLink