microsoftgraph / microsoftgraph/msgraph-sdk-python
[Error] sites get_by_path_with_path is not working with invalid request.
未關閉
還沒有人認領這個 Issue。
bug
dependency:metadata
- 主要語言
- Python
- 星號
- 630
- 分支
- 96
- 平均合併
- 15 小時 20 分鐘
- 30 天內合併 PR
- 3
描述
Client id and secret was made with having API permission as below.
Files.Read.All
Files.ReadWrite.All
Sites.FullControl.All
What I want to download file of URL is https://mngenvmcap115298.sharepoint.com/sites/sampleteam/Shared%20Documents/general/PDF-ER.docx
async def getfile():
file = await client.sites.by_site_id("0aa18ca9-16b0-4673-abf0-b14ec9649ee4").get_by_path_with_path("/Shared%20Documents/General/PDF-ER.docx").get()
return file
value = asyncio.run(getfile())
error is here
{"message": null, "response_status_code": 400, "response_headers": "Headers({'cache-control': 'no-store, no-cache', 'transfer-encoding': 'chunked', 'content-type': 'application/json', 'content-encoding': 'gzip', 'vary': 'Accept-Encoding', 'strict-transport-security': 'max-age=31536000', 'request-id': 'ec72f171-946a-4628-8d06-1cc51cd368ce', 'client-request-id': '6b0d9456-23c7-4633-af1a-91cfca73d637', 'x-ms-ags-diagnostic': '{\"ServerInfo\":{\"DataCenter\":\"Japan East\",\"Slice\":\"E\",\"Ring\":\"5\",\"ScaleUnit\":\"000\",\"RoleInstance\":\"TY1PEPF0000A88F\"}}', 'date': 'Tue, 01 Aug 2023 08:38:04 GMT'})", "additional_data": {}, "error": {"additional_data": {}, "code": "invalidRequest", "details": null, "inner_error": {"additional_data": {"date": "8:38:05"}, "client_request_id": "6b0d9456-23c7-4633-af1a-91cfca73d637", "date": null, "odata_type": null, "request_id": "ec72f171-946a-4628-8d06-1cc51cd368ce"}, "message": "Invalid request", "target": null}}
How can I resolve?
Using msgraph-core 1.0.0a4, msgraph-sdk 1.0.0a13 which might be latest since I installl it today. WSL2, Python 3.10.12
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
首先,使用提供的 SharePoint 路徑重現對 get_by_path_with_path 的 Python 呼叫,並檢查它傳送至 Microsoft Graph 的要求。將編碼後的路徑和傳回的 invalidRequest 回應與預期的 API 要求進行比較;下載成功,或已記錄 SDK 的限制和必要用法,即表示完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python
- 領域
- api
- Issue 類型
- 缺陷
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100