【发布时间】:2023-01-13 16:03:48
【问题描述】:
我使用 Microsoft Graph 1.85 sdk for PHP 来管理 onedrive 帐户中的文件管理,在获得访问令牌后,我成功地使用此语法上传和下载文件
use Microsoft\Graph\Graph;
$graph = new Graph();
$graph->setAccessToken($user_accessToken);
// upload
$graph->createRequest("PUT", "/me/drive/root:/" . $folder_in_onedrive . $file . ":/content")->upload($uploadfile);
// download
$graph->createRequest("GET", "/me/drive/root:/" . $folder_in_onedrive . $anotherfile . ":/content")->download($target_dir . $anotherfile);
现在我想在图形 api 中创建另一个请求类型 get sharing link 使用类型和范围参数,我在文档中知道请求应该是这样的:
$graph->createRequest("POST", "/me/drive/root:/" . $folder_in_onedrive . $file . ":/createLink")
/* Now im pretty sure d'ont know how to handle this type of request to get the url to the file in my case an image to display*/
【问题讨论】: