如何获取PowerPoint文件以前版本(即修改前的版本)的下载链接?

问题描述 投票:0回答:0

我已经编写了一个代码来获取当前文件,但我需要获取同一文件的先前版本来比较和识别更改。

这是我使用图形 API 获取当前文件的代码:

import requests
import msal
    access_token = access_token['access_token']

_,item_id,drive_id = Api_connect().trail_file()

url = f"https://graph.microsoft.com/v1.0/me/drives/{drive_id}/items/{item_id}/"

# Set the headers with the access token
headers = {
    "Authorization": "Bearer " + access_token,
    "Content-Type": "application/json"
}

# Send a GET request to the API endpoint to retrieve the version history
response = requests.get(url, headers=headers)

# Print the response
print(response.content)
open(file_name, 'wb').write(result.content)

有人可以建议我如何获取此文件的先前版本吗?

python-3.x python-requests microsoft-graph-api msal
© www.soinside.com 2019 - 2024. All rights reserved.