microsoftgraph / microsoftgraph/msgraph-sdk-python

[Error] sites get_by_path_with_path is not working with invalid request.

オープン
#279 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

bug dependency:metadata
主要言語
Python
スター
630
フォーク
96
平均マージ
15時間 20分
マージ済み PR(30日)
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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、指定された SharePoint パスを使って get_by_path_with_path への Python 呼び出しを再現し、Microsoft Graph に送信されるリクエストを調べます。エンコードされたパスと返された invalidRequest 応答を、想定される API リクエストと比較します。ダウンロードが成功するか、SDK の制限と必要な使用方法が文書化されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
api
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。