microsoftgraph / microsoftgraph/msgraph-sdk-python

me-token-to-replace not being replaced

未關閉
#1,271 0 則留言 2 個 reaction 已指派 1 人 在 GitHub 檢視

@ramsessanchez 已經在處理了。

開始於 2026年5月18日。

type:bug
主要語言
Python
星號
630
分支
96
平均合併
15 小時 20 分鐘
30 天內合併 PR
3

描述

I am following the same tutorial as in #544 ( https://learn.microsoft.com/en-us/graph/tutorials/python?tabs=aad ) and getting the same error. As that issue is closed, I can't re-open it. The error is that the URL used in the ultimate request includes the path component me-token-to-replace:

https://graph.microsoft.com/v1.0//users/me-token-to-replace/mailFolders/inbox/messages?$orderby=receivedDateTime%20DESC&$select=from,isRead,receivedDateTime,subject&$top=25

And the error returned by the server is:

Response content: {"error":{"code":"ErrorInvalidUser","message":"The requested user 'me-token-to-replace' is invalid."}}

I would like to know if there has been any progress on solving this or workarounds? The ticket listed in the comments is still open and it was suggested it would be fixed more than a year ago. I have used both DeviceCodeCredential and InteractiveBrowserCredential with the same error.

One of the workarounds, using graph_client.users.by_user_id instead of graph_client.me might work except I can't hardcode the user_id in the long term.

If it makes any difference, I'm running on RHEL9, Python 3.9, msgraph sdk version 1.35.0 and all dependencies the latest versions downloaded as of today. Thanks for any help!

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。